Skip to content

Fix pagination cut off power patch 2.38.1 - #269

Merged
flomillot merged 1 commit into
release-v2.38from
cut-power-patch-2.38.1
Aug 7, 2026
Merged

Fix pagination cut off power patch 2.38.1#269
flomillot merged 1 commit into
release-v2.38from
cut-power-patch-2.38.1

Conversation

@flomillot

@flomillot flomillot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Patch of #254

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Contingency filtering

Layer / File(s) Summary
Filter contract and service configuration
src/main/java/org/gridsuite/securityanalysis/server/repositories/specifications/ContingencySpecificationBuilder.java, src/main/java/org/gridsuite/securityanalysis/server/service/FilterService.java, src/main/resources/application-local.yaml, pom.xml
Nested contingency element identifiers are treated as non-parent filters. Cutoff-power resource filtering and local filter-server configuration were added. The Maven version is now 2.38.0.
Cutoff-power result querying
src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisResultService.java
Cutoff-power queries apply distinct results and return the service-specific empty page.
Two-sided violation regression coverage
src/test/java/org/gridsuite/securityanalysis/server/SecurityAnalysisProviderMock.java, src/test/java/org/gridsuite/securityanalysis/server/FindContingenciesTest.java
Fixtures and tests cover violations on both sides, nested element filtering, pagination, status, side, parent, sorting, and edge cases.

Suggested reviewers: khouadrired

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the pagination fix for cut-off power and the patch version.
Description check ✅ Passed The description identifies this pull request as a patch related to an existing pull request, which matches the changeset.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch cut-power-patch-2.38.1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@flomillot
flomillot changed the base branch from main to release-v2.38 August 7, 2026 09:45

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/org/gridsuite/securityanalysis/server/service/FilterService.java`:
- Around line 59-68: Remove the duplicate getResourceFilterCutOffPower(UUID,
String, GlobalFilter) declaration in FilterService, retaining a single
implementation with the existing equipment types and
ContingencyEntity.Fields.contingencyId behavior.

In
`@src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisResultService.java`:
- Around line 468-469: Update the cutoff-power contingency flow before
findCutOffPowerContingenciesPage to return an empty page when
stringGlobalFilters is non-null and allResourceFilters is empty, matching the
guard used by findNmKContingenciesPaged. Keep the existing specification
construction unchanged when resource filters are present.

In
`@src/test/java/org/gridsuite/securityanalysis/server/FindContingenciesTest.java`:
- Line 85: Update SecurityAnalysisProviderMock.getResultContingenciesSorted to
use RESULT_CONTINGENCIES_WITH_LIMIT_VIOLATIONS_ON_BOTH_SIDES instead of
RESULT_CONTINGENCIES, so the expected sorted contingencies include both l3 sides
persisted by the test.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0908fc97-f8b8-4c3b-bd8b-614d9fd2a519

📥 Commits

Reviewing files that changed from the base of the PR and between 77e7a18 and 4511932.

📒 Files selected for processing (7)
  • pom.xml
  • src/main/java/org/gridsuite/securityanalysis/server/repositories/specifications/ContingencySpecificationBuilder.java
  • src/main/java/org/gridsuite/securityanalysis/server/service/FilterService.java
  • src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisResultService.java
  • src/main/resources/application-local.yaml
  • src/test/java/org/gridsuite/securityanalysis/server/FindContingenciesTest.java
  • src/test/java/org/gridsuite/securityanalysis/server/SecurityAnalysisProviderMock.java

Comment thread src/main/java/org/gridsuite/securityanalysis/server/service/FilterService.java Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/org/gridsuite/securityanalysis/server/service/FilterService.java`:
- Around line 59-68: Remove the duplicate getResourceFilterCutOffPower(UUID,
String, GlobalFilter) declaration in FilterService, retaining a single
implementation with the existing equipment types and
ContingencyEntity.Fields.contingencyId behavior.

In
`@src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisResultService.java`:
- Around line 468-469: Update the cutoff-power contingency flow before
findCutOffPowerContingenciesPage to return an empty page when
stringGlobalFilters is non-null and allResourceFilters is empty, matching the
guard used by findNmKContingenciesPaged. Keep the existing specification
construction unchanged when resource filters are present.

In
`@src/test/java/org/gridsuite/securityanalysis/server/FindContingenciesTest.java`:
- Line 85: Update SecurityAnalysisProviderMock.getResultContingenciesSorted to
use RESULT_CONTINGENCIES_WITH_LIMIT_VIOLATIONS_ON_BOTH_SIDES instead of
RESULT_CONTINGENCIES, so the expected sorted contingencies include both l3 sides
persisted by the test.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0908fc97-f8b8-4c3b-bd8b-614d9fd2a519

📥 Commits

Reviewing files that changed from the base of the PR and between 77e7a18 and 4511932.

📒 Files selected for processing (7)
  • pom.xml
  • src/main/java/org/gridsuite/securityanalysis/server/repositories/specifications/ContingencySpecificationBuilder.java
  • src/main/java/org/gridsuite/securityanalysis/server/service/FilterService.java
  • src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisResultService.java
  • src/main/resources/application-local.yaml
  • src/test/java/org/gridsuite/securityanalysis/server/FindContingenciesTest.java
  • src/test/java/org/gridsuite/securityanalysis/server/SecurityAnalysisProviderMock.java
🛑 Comments failed to post (1)
src/test/java/org/gridsuite/securityanalysis/server/FindContingenciesTest.java (1)

85-85: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Update child-sorting expected data.

Line 85 persists RESULT_WITH_LIMIT_VIOLATIONS_ON_BOTH_SIDES, but SecurityAnalysisProviderMock.getResultContingenciesSorted still uses RESULT_CONTINGENCIES. The actual page contains both l3 sides. The expected page contains only one. Update that helper to use RESULT_CONTINGENCIES_WITH_LIMIT_VIOLATIONS_ON_BOTH_SIDES.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/org/gridsuite/securityanalysis/server/FindContingenciesTest.java`
at line 85, Update SecurityAnalysisProviderMock.getResultContingenciesSorted to
use RESULT_CONTINGENCIES_WITH_LIMIT_VIOLATIONS_ON_BOTH_SIDES instead of
RESULT_CONTINGENCIES, so the expected sorted contingencies include both l3 sides
persisted by the test.

@flomillot
flomillot requested a review from ghazwarhili August 7, 2026 09:57
@flomillot
flomillot force-pushed the cut-power-patch-2.38.1 branch from 4511932 to 87968ab Compare August 7, 2026 10:09
@flomillot flomillot changed the title Global filter cut power patch 2.38.1 Fix pagination cut off power patch 2.38.1 Aug 7, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@flomillot
flomillot merged commit fa77a7f into release-v2.38 Aug 7, 2026
5 checks passed
@flomillot
flomillot deleted the cut-power-patch-2.38.1 branch August 7, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants