Skip to content

Add endpoint to compare 2 process configs#49

Merged
FranckLecuyer merged 11 commits intomainfrom
compare_two_process_configs
Mar 12, 2026
Merged

Add endpoint to compare 2 process configs#49
FranckLecuyer merged 11 commits intomainfrom
compare_two_process_configs

Conversation

@FranckLecuyer
Copy link
Contributor

@FranckLecuyer FranckLecuyer commented Feb 25, 2026

PR Summary

Waiting for the loadflowParametersUuid to be added in the process config

@coderabbitai

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
@FranckLecuyer FranckLecuyer force-pushed the compare_two_process_configs branch from dcc5785 to 0c49927 Compare February 25, 2026 15:06
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
coderabbitai[bot]

This comment was marked as outdated.

Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
@khouadrired
Copy link
Contributor

can you provide an example of the output structure?

coderabbitai[bot]

This comment was marked as outdated.

Copy link
Contributor

@antoinebhs antoinebhs left a comment

Choose a reason for hiding this comment

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

LGTM I would suggest #64 to simplify/avoid sonar issue

FranckLecuyer and others added 3 commits March 11, 2026 17:29
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1160609 and 769c542.

📒 Files selected for processing (4)
  • monitor-server/src/main/java/org/gridsuite/monitor/server/controllers/ProcessConfigController.java
  • monitor-server/src/main/java/org/gridsuite/monitor/server/services/ProcessConfigService.java
  • monitor-server/src/test/java/org/gridsuite/monitor/server/controllers/ProcessConfigControllerTest.java
  • monitor-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

FranckLecuyer and others added 2 commits March 12, 2026 10:00
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
@sonarqubecloud
Copy link

@FranckLecuyer FranckLecuyer merged commit 2a5cd5b into main Mar 12, 2026
4 checks passed
@FranckLecuyer FranckLecuyer deleted the compare_two_process_configs branch March 12, 2026 10:08
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.

3 participants