Skip to content

Share a composite modification nested in another composite - #1089

Open
flomillot wants to merge 1 commit into
mainfrom
feat/share-nested-composite-modification
Open

Share a composite modification nested in another composite#1089
flomillot wants to merge 1 commit into
mainfrom
feat/share-nested-composite-modification

Conversation

@flomillot

@flomillot flomillot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Follow-up of #1070.

A composite modification nested in another composite of a node can now be shared. The network modification server returns the container the composite has been taken out of: when it is a parent composite, the reference left behind is registered in the directory server as belonging to that composite (NETWORK_MODIFICATION).

Also adds GET /v1/network-composite-modifications/{uuid}/contains-shared-modification, relaying to the network modification server whether a composite modification contains a shared modification, so that the front can disable its sharing.

Requires gridsuite/network-modification-server#893.

The reference left behind by the shared composite belongs to its parent composite when it was nested in one, and to the node otherwise. Also expose whether a composite modification contains a shared modification.

Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 098db5a2-c45d-4a4b-a8a5-154d8c2fdcf7

📥 Commits

Reviewing files that changed from the base of the PR and between aa1bdc0 and 38e3d2e.

📒 Files selected for processing (6)
  • src/main/java/org/gridsuite/study/server/controller/NetworkModificationController.java
  • src/main/java/org/gridsuite/study/server/service/NetworkModificationService.java
  • src/main/java/org/gridsuite/study/server/service/StudyService.java
  • src/test/java/org/gridsuite/study/server/NetworkModificationTest.java
  • src/test/java/org/gridsuite/study/server/controller/NetworkModificationControllerTest.java
  • src/test/java/org/gridsuite/study/server/service/NetworkModificationServiceTest.java

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds an endpoint and service method to detect shared composite modifications. Composite sharing now returns the former container and creates references on either the parent composite or the study node.

Changes

Network modification sharing

Layer / File(s) Summary
Shared modification detection
src/main/java/org/gridsuite/study/server/controller/NetworkModificationController.java, src/main/java/org/gridsuite/study/server/service/NetworkModificationService.java, src/test/java/org/gridsuite/study/server/controller/NetworkModificationControllerTest.java, src/test/java/org/gridsuite/study/server/service/NetworkModificationServiceTest.java
The controller exposes contains-shared-modification. The service delegates the request to the network modification server. Controller and service tests validate the Boolean result.
Nested composite sharing
src/main/java/org/gridsuite/study/server/service/NetworkModificationService.java, src/main/java/org/gridsuite/study/server/service/StudyService.java, src/test/java/org/gridsuite/study/server/NetworkModificationTest.java
Composite extraction returns the former container. Sharing creates a NETWORK_MODIFICATION reference for nested composites and a STUDY_NODE reference for node containers. Tests cover both cases.

Sequence Diagram(s)

sequenceDiagram
  participant NetworkModificationController
  participant NetworkModificationService
  participant NetworkModificationServer
  NetworkModificationController->>NetworkModificationService: containsSharedModification(uuid)
  NetworkModificationService->>NetworkModificationServer: GET shared-modification status
  NetworkModificationServer-->>NetworkModificationService: Boolean result
  NetworkModificationService-->>NetworkModificationController: HTTP 200 Boolean response
Loading

Suggested reviewers: klesaulnier

Merge Risk: ⚪ Minimal · up to 38e3d

The change supports nested composite sharing and exposes shared-modification status while preserving the correct ownership reference. Current mergeability risk is minimal.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description clearly explains support for sharing nested composite modifications and the new endpoint for detecting shared modifications.
Title check ✅ Passed The title clearly and concisely identifies the main change: sharing a composite modification nested in another composite.
  • Fix all pre-merge checks with AI

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants