Skip to content

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

Merged
flomillot merged 5 commits into
mainfrom
florent/expose-reference-id-in-modification-metadata
Sep 4, 2026
Merged

fix: keep the referenceId when loading a modification reference metadata#858
flomillot merged 5 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

  • 🔍 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: Team

Run ID: 69d08039-895a-41f7-ad7b-8a50bd796a56

📝 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 3 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>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
@flomillot
flomillot marked this pull request as ready for review August 17, 2026 09:17
…nce-id-in-modification-metadata

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

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@flomillot
flomillot merged commit 5fd8f7e into main Sep 4, 2026
5 checks passed
@flomillot
flomillot deleted the florent/expose-reference-id-in-modification-metadata branch September 4, 2026 10:50
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