Fix pagination cut off power patch 2.38.1 - #269
Conversation
📝 WalkthroughWalkthroughChangesContingency filtering
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (7)
pom.xmlsrc/main/java/org/gridsuite/securityanalysis/server/repositories/specifications/ContingencySpecificationBuilder.javasrc/main/java/org/gridsuite/securityanalysis/server/service/FilterService.javasrc/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisResultService.javasrc/main/resources/application-local.yamlsrc/test/java/org/gridsuite/securityanalysis/server/FindContingenciesTest.javasrc/test/java/org/gridsuite/securityanalysis/server/SecurityAnalysisProviderMock.java
There was a problem hiding this comment.
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
📒 Files selected for processing (7)
pom.xmlsrc/main/java/org/gridsuite/securityanalysis/server/repositories/specifications/ContingencySpecificationBuilder.javasrc/main/java/org/gridsuite/securityanalysis/server/service/FilterService.javasrc/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisResultService.javasrc/main/resources/application-local.yamlsrc/test/java/org/gridsuite/securityanalysis/server/FindContingenciesTest.javasrc/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, butSecurityAnalysisProviderMock.getResultContingenciesSortedstill usesRESULT_CONTINGENCIES. The actual page contains bothl3sides. The expected page contains only one. Update that helper to useRESULT_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.
(cherry picked from commit 5d6adbd)
4511932 to
87968ab
Compare
|



PR Summary
Patch of #254