Endpoint to get modifications from composite together with the modifications not found#775
Merged
FranckLecuyer merged 10 commits intomainfrom Mar 24, 2026
Merged
Conversation
…gether with the composite modifications not found. Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
…ations_with_error_checking Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com> # Conflicts: # src/test/java/org/gridsuite/modification/server/ModificationControllerTest.java
…ations_with_error_checking Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com> # Conflicts: # src/main/java/org/gridsuite/modification/server/NetworkModificationController.java # src/main/java/org/gridsuite/modification/server/service/NetworkModificationService.java
antoinebhs
reviewed
Mar 19, 2026
Contributor
antoinebhs
left a comment
There was a problem hiding this comment.
I think we can simplify a lot the code by adding a method to the repository and removing the metadata
src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/modification/server/NetworkModificationController.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
This comment was marked as outdated.
This comment was marked as outdated.
antoinebhs
reviewed
Mar 20, 2026
src/main/java/org/gridsuite/modification/server/service/NetworkModificationService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/main/java/org/gridsuite/modification/server/repositories/ModificationRepository.java (1)
81-82:⚠️ Potential issue | 🟠 MajorExistence check still excludes empty composites.
On Line 81, existence is derived from the sub-modification join table, so a valid composite with zero children is reported as missing. Query the composite entity/table directly instead.
Suggested fix
- `@Query`(value = "SELECT DISTINCT cast(id AS VARCHAR) FROM composite_modification_sub_modifications WHERE id IN (?1)", nativeQuery = true) + `@Query`("SELECT c.id FROM CompositeModificationEntity c WHERE c.id IN (?1)") Set<UUID> findExistingCompositeModificationIds(List<UUID> compositeIds);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/java/org/gridsuite/modification/server/repositories/ModificationRepository.java` around lines 81 - 82, The current repository method findExistingCompositeModificationIds queries the join table composite_modification_sub_modifications, which omits composites that have no sub-modifications; change the query to select IDs directly from the composite entity/table (the composite modification table, e.g., composite_modification) using the provided compositeIds parameter so empty composites are included in the existence check; update the `@Query` on findExistingCompositeModificationIds to query the composite table by id IN (?1) and return the Set<UUID>.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In
`@src/main/java/org/gridsuite/modification/server/repositories/ModificationRepository.java`:
- Around line 81-82: The current repository method
findExistingCompositeModificationIds queries the join table
composite_modification_sub_modifications, which omits composites that have no
sub-modifications; change the query to select IDs directly from the composite
entity/table (the composite modification table, e.g., composite_modification)
using the provided compositeIds parameter so empty composites are included in
the existence check; update the `@Query` on findExistingCompositeModificationIds
to query the composite table by id IN (?1) and return the Set<UUID>.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 20618273-84ba-4ee3-a938-e4b47ea7bd6b
📒 Files selected for processing (2)
src/main/java/org/gridsuite/modification/server/repositories/ModificationRepository.javasrc/main/java/org/gridsuite/modification/server/service/NetworkModificationService.java
🚧 Files skipped from review as they are similar to previous changes (1)
- src/main/java/org/gridsuite/modification/server/service/NetworkModificationService.java
|
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
Add new endpoint to get modifications from composite modifications, together with the composite modifications not found.