Skip to content

fix: keep the referenceId when loading a modification reference metadata - #858

Draft
flomillot wants to merge 3 commits into
mainfrom
florent/expose-reference-id-in-modification-metadata
Draft

fix: keep the referenceId when loading a modification reference metadata#858
flomillot wants to merge 3 commits into
mainfrom
florent/expose-reference-id-in-modification-metadata

Conversation

@flomillot

Copy link
Copy Markdown
Contributor

PR Summary

On the metadata path, loadModificationReference returned a bare ModificationInfos: the entity comes from a
projection which strips the subclass, so the reference attributes — referenceId included — were lost, and
clients could not tell which shared element a shared modification points to.

The referenced modification is already fetched on that path to get its message type and values, and its id is
precisely the referenceId. That branch now builds a ModificationReferenceInfos carrying it.

Touches the same method as #852, which changes the other branch of the same if.

Metadata are loaded through a projection which strips the subclass, so the reference attributes were lost and
clients could not tell which shared element a reference points to. The referenced modification is already
fetched to get the label, and its id is precisely that referenceId.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 743d778c-ce43-4b6b-baee-982970e9b3ae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

Modification reference metadata resolution

Layer / File(s) Summary
Resolve and validate reference metadata
src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java, src/test/java/org/gridsuite/modification/server/ModificationControllerTest.java
Metadata-only reference projections now return ModificationReferenceInfos using the referenced modification’s identifier and message metadata, throw when the referenced modification is missing, and verify the deserialized type and resolved fields through an integration test.

Suggested reviewers: meklo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: preserving referenceId in modification reference metadata loading.
Description check ✅ Passed The description is directly related to the code changes and explains the metadata-path fix.
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.

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.

@flomillot
flomillot marked this pull request as draft July 29, 2026 14:04
flomillot and others added 2 commits August 13, 2026 15:14
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
@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.

1 participant