Add endpoint to compare 2 process configs#49
Merged
FranckLecuyer merged 11 commits intomainfrom Mar 12, 2026
Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
dcc5785 to
0c49927
Compare
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
Contributor
|
can you provide an example of the output structure? |
khouadrired
approved these changes
Mar 6, 2026
antoinebhs
reviewed
Mar 11, 2026
Contributor
antoinebhs
left a comment
There was a problem hiding this comment.
LGTM I would suggest #64 to simplify/avoid sonar issue
...r-server/src/main/java/org/gridsuite/monitor/server/controllers/ProcessConfigController.java
Show resolved
Hide resolved
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@monitor-server/src/main/java/org/gridsuite/monitor/server/services/ProcessConfigService.java`:
- Around line 120-150: The helper compareSecurityAnalysisConfigs currently
compares only modificationUuids, parametersUuid, and contingencies; add a fourth
comparison for loadflowParametersUuid by creating a ProcessConfigFieldComparison
entry named "loadflowParameters" that checks
Objects.equals(config1.loadflowParametersUuid(),
config2.loadflowParametersUuid()) and includes both values; also add a
unit/service test for ProcessConfigService.compareSecurityAnalysisConfigs that
constructs SecurityAnalysisConfig instances differing each field in turn
(including loadflowParametersUuid) to assert each difference is detected so all
SecurityAnalysisConfig fields are enumerated by the comparison.
In
`@monitor-server/src/test/java/org/gridsuite/monitor/server/controllers/ProcessConfigControllerTest.java`:
- Around line 309-321: The controller currently lets IllegalArgumentException
from ProcessConfigService.compareProcessConfigs propagate as a ServletException
(500); add an exception mapping to convert IllegalArgumentException into a 400
Bad Request (either an `@ExceptionHandler` in ProcessConfigController or a small
`@ControllerAdvice` class that returns ResponseEntity.badRequest()) and update the
test in ProcessConfigControllerTest (the
compareProcessConfigsShouldThrowExceptionWhenDifferentTypes case) to expect
status().isBadRequest() from the
mockMvc.perform(get("/v1/process-configs/compare")...) call instead of
assertThrows(ServletException), ensuring the test still verifies the service was
invoked with compareProcessConfigs(uuid1, uuid2).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f99c26f1-fdc7-4e0d-87d4-268253d53945
📒 Files selected for processing (4)
monitor-server/src/main/java/org/gridsuite/monitor/server/controllers/ProcessConfigController.javamonitor-server/src/main/java/org/gridsuite/monitor/server/services/ProcessConfigService.javamonitor-server/src/test/java/org/gridsuite/monitor/server/controllers/ProcessConfigControllerTest.javamonitor-server/src/test/java/org/gridsuite/monitor/server/services/ProcessConfigServiceTest.java
🚧 Files skipped from review as they are similar to previous changes (2)
- monitor-server/src/main/java/org/gridsuite/monitor/server/controllers/ProcessConfigController.java
- monitor-server/src/test/java/org/gridsuite/monitor/server/services/ProcessConfigServiceTest.java
monitor-server/src/main/java/org/gridsuite/monitor/server/services/ProcessConfigService.java
Show resolved
Hide resolved
...rver/src/test/java/org/gridsuite/monitor/server/controllers/ProcessConfigControllerTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



PR Summary
Waiting for the loadflowParametersUuid to be added in the process config