Replicate composite submodifications root network applicability after copy#984
Replicate composite submodifications root network applicability after copy#984
Conversation
📝 WalkthroughWalkthroughAdds a new NetworkModificationService method to fetch children UUIDs as a List, changes StudyService.copyModificationsToExclude to include descendant mappings by pairing original and copied descendant UUID lists, and updates tests to use repeated Changes
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/java/org/gridsuite/study/server/service/StudyService.java`:
- Around line 2504-2509: Don't zip descendant UUID lists positionally; instead,
for each original descendant UUID from
networkModificationService.findAllChildrenUuids(modificationsUuids) locate its
correct copy and populate mappingModificationsUuids. Concretely: iterate
originalChildren, for each originalChildUuid determine its parent/original
identity, use the existing mappingModificationsUuids to find the corresponding
copy-parent, then find the matching child UUID within the copy subtree (by
stable identifier such as externalId/name+type or by checking parent link) and
put(originalChildUuid, foundCopyChildUuid). Remove the Math.min positional zip
and ensure copyModificationsToExcludeFromTags(...) consumes this explicit
mapping so copies aren't mis-mapped or dropped.
🪄 Autofix (Beta)
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
Run ID: 21700046-e332-4e12-9dc2-54cfad004b05
📒 Files selected for processing (2)
src/main/java/org/gridsuite/study/server/service/NetworkModificationService.javasrc/main/java/org/gridsuite/study/server/service/StudyService.java
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/java/org/gridsuite/study/server/NetworkModificationTest.java (1)
2135-2139: Strengthen validation of repeateduuidssemantics and descendant mapping behavior.These assertions currently validate call count and a generic
uuidspresence, but they don’t prove repeated-query formatting or that original/copy descendant UUID sets are actually propagated. Consider asserting concrete query values per call (original UUIDs vs copied UUIDs) with non-empty children responses to fully cover the PR objective.Also applies to: 2158-2159, 2216-2220, 2239-2240
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/test/java/org/gridsuite/study/server/NetworkModificationTest.java` around lines 2135 - 2139, The test stubs and verifications need to explicitly validate repeated uuids query formatting and that descendant UUIDs are propagated; update the WireMock stubs and verifications in NetworkModificationTest so the children-uuids endpoint returns non-empty lists and use query-param matching (e.g., replace broad urlPathMatching-only stubs with urlPathEqualTo("/v1/network-composite-modifications/children-uuids") plus WireMock.withQueryParam("uuids", WireMock.equalTo(...)) or verify calls with WireMock.verify(getRequestedFor(urlPathEqualTo(...)).withQueryParam("uuids", equalTo(...))) to assert the first call carries the original UUID set and the second call carries the copied UUID set, and adjust the stubbed responses (mapper.writeValueAsString(List.of(...))) accordingly; apply the same change pattern to the other occurrences noted around the test (the other children-uuids stubs/verifications).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/test/java/org/gridsuite/study/server/NetworkModificationTest.java`:
- Around line 2135-2139: The test stubs and verifications need to explicitly
validate repeated uuids query formatting and that descendant UUIDs are
propagated; update the WireMock stubs and verifications in
NetworkModificationTest so the children-uuids endpoint returns non-empty lists
and use query-param matching (e.g., replace broad urlPathMatching-only stubs
with urlPathEqualTo("/v1/network-composite-modifications/children-uuids") plus
WireMock.withQueryParam("uuids", WireMock.equalTo(...)) or verify calls with
WireMock.verify(getRequestedFor(urlPathEqualTo(...)).withQueryParam("uuids",
equalTo(...))) to assert the first call carries the original UUID set and the
second call carries the copied UUID set, and adjust the stubbed responses
(mapper.writeValueAsString(List.of(...))) accordingly; apply the same change
pattern to the other occurrences noted around the test (the other children-uuids
stubs/verifications).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cdc991f7-7cbc-4606-973e-f6e1c78607ea
📒 Files selected for processing (1)
src/test/java/org/gridsuite/study/server/NetworkModificationTest.java
|


PR Summary