Skip to content

reference modif actions - #869

Open
souissimai wants to merge 10 commits into
mainfrom
reference-modification-actions
Open

reference modif actions#869
souissimai wants to merge 10 commits into
mainfrom
reference-modification-actions

Conversation

@souissimai

Copy link
Copy Markdown
Contributor

PR Summary

Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a9ff6967-1745-4e14-92d0-e41269ea20a8

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b721e864-8bf4-410b-8a56-3131a88ad51e

📥 Commits

Reviewing files that changed from the base of the PR and between f7c34a0 and b31d36b.

📒 Files selected for processing (1)
  • src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java

📝 Walkthrough

Walkthrough

getContainer now resolves referenced composite container IDs before repository lookup and group creation. Group IDs and non-reference composite IDs remain unchanged.

Changes

Container resolution

Layer / File(s) Summary
Resolve container IDs
src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java
Added resolveContainerId to map composite reference IDs to referenced composite IDs. Updated getContainer to use the resolved ID for lookup and group creation.

Suggested reviewers: meklo

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description contains only a generic template and does not explain the changes. Add a concise summary of the container ID resolution changes and their effect on modification reference actions.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies changes related to referencing modification actions, which matches the pull request objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

Warning

Your free Security trial is over. An organization admin can activate billing to continue.


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.

Mathieu-Deharbe

This comment was marked as resolved.

Mathieu-Deharbe

This comment was marked as resolved.

SOUISSI Maissa (Externe) and others added 7 commits August 20, 2026 01:45
Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Warning

Your free Security trial is over. An organization admin can activate billing to continue.

Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
@Mathieu-Deharbe

This comment was marked as resolved.

* @param modificationUuid uuid of the modification-reference itself
* @param referenceId uuid of the referenced shared composite in directory-server
* @param containerId uuid of the composite containing the reference, null if the modification-reference is at the root level
* @author RTE

@Mathieu-Deharbe Mathieu-Deharbe Aug 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Name yourself !

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

Comment on lines +1084 to +1096
/**
* A COMPOSITE container may be designated through a modification reference: in that case the actual
* container is the shared composite the reference points to.
*/
private UUID resolveContainerId(ModificationContainerInfos containerInfos) {
if (ModificationContainerType.COMPOSITE.equals(containerInfos.type())) {
return modificationRepository.findById(containerInfos.id())
.filter(ModificationReferenceEntity.class::isInstance)
.map(entity -> ((ModificationReferenceEntity) entity).getReferenceId())
.orElse(containerInfos.id());
}
return containerInfos.id();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think that this function is useful.

containerInfos.id() should never be a reference modification uuid, it should be the uuid of the real container, that is the uuid of the composite toward which the reference is pointing.

Therefore .filter(ModificationReferenceEntity.class::isInstance) should always return false. Or Something strange is in the container table.

@Mathieu-Deharbe Mathieu-Deharbe Aug 25, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok I misunderstood : resolveContainerId allows to get the composite uuid container from the reference modification uuid before geting it from the container repository :

AbstractModificationContainerEntity containerEntity = modificationContainerRepository.findById(containerId)

So the reference is never a container in the modificationContainerRepository but it can be one in the dto.

This is a bit hard to follow. Maybe we could use different terms, but given that this is going to be refactored, we may improve this later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to make it even clearer :

Suggested change
/**
* A COMPOSITE container may be designated through a modification reference: in that case the actual
* container is the shared composite the reference points to.
*/
private UUID resolveContainerId(ModificationContainerInfos containerInfos) {
if (ModificationContainerType.COMPOSITE.equals(containerInfos.type())) {
return modificationRepository.findById(containerInfos.id())
.filter(ModificationReferenceEntity.class::isInstance)
.map(entity -> ((ModificationReferenceEntity) entity).getReferenceId())
.orElse(containerInfos.id());
}
return containerInfos.id();
}
/**
* A COMPOSITE container may be designated through a modification reference, in the ModificationContainerInfos dto:
* in that case the actual container is the shared composite the reference points to.
*/
private UUID resolveContainerId(ModificationContainerInfos containerInfos) {
if (ModificationContainerType.COMPOSITE.equals(containerInfos.type())) {
return modificationRepository.findById(containerInfos.id())
.filter(ModificationReferenceEntity.class::isInstance)
.map(entity -> ((ModificationReferenceEntity) entity).getReferenceId())
.orElse(containerInfos.id());
}
return containerInfos.id();
}

But I really think that we should add a "TODO" about this because we are forcing one more request for all the composites when it is not really needed : the container may be typed as REFERENCE in the dto, or the actual shared composite container may be determined in the front if we add the data in the front...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

right, this should be simplified later

Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
@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