Skip to content

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

Open
flomillot wants to merge 1 commit into
mainfrom
florent/expose-reference-id-in-modification-metadata
Open

fix: keep the referenceId when loading a modification reference metadata#858
flomillot wants to merge 1 commit 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

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: a37b7000-3aba-403b-8b31-b3e9fa7ea669

📥 Commits

Reviewing files that changed from the base of the PR and between 5ac1a8c and 0001c51.

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

📝 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.

@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