fix: keep modification activation status unchanged on metadata update#819
fix: keep modification activation status unchanged on metadata update#819flomillot wants to merge 1 commit into
Conversation
The activated flag was defaulted in the ModificationInfos DTO, so it was never null after deserialization. A metadata update that omitted the flag therefore always reactivated the modification (visible when renaming a deactivated composite modification). The flag is now defaulted to true at creation only. When it is not provided on a metadata update, the activation status is left unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
📝 WalkthroughWalkthroughThis PR introduces null-safety handling for the ChangesActivation field null-safety and dependency update
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pom.xml`:
- Line 56: Update the Maven property network-modification.version in the pom.xml
to the released version instead of the snapshot; replace the value
"0.84.0-SNAPSHOT" with the final released version string (e.g., "0.84.0") after
the dependency PR is merged and published so builds use the released artifact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5923cda7-1301-45ed-b558-c64abf1234df
📒 Files selected for processing (3)
pom.xmlsrc/main/java/org/gridsuite/modification/server/entities/ModificationEntity.javasrc/test/java/org/gridsuite/modification/server/ModificationControllerTest.java
| <sonar.projectKey>org.gridsuite:network-modification-server</sonar.projectKey> | ||
| <!-- TODO network-modification.version remove when included in gridsuite-dependencies --> | ||
| <network-modification.version>0.83.0</network-modification.version> | ||
| <network-modification.version>0.84.0-SNAPSHOT</network-modification.version> |
There was a problem hiding this comment.
Update to released version before merging.
The dependency currently points to 0.84.0-SNAPSHOT. As noted in the PR description, this should be updated to the released version after the dependency PR is merged and published.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pom.xml` at line 56, Update the Maven property network-modification.version
in the pom.xml to the released version instead of the snapshot; replace the
value "0.84.0-SNAPSHOT" with the final released version string (e.g., "0.84.0")
after the dependency PR is merged and published so builds use the released
artifact.
The
activatedflag was defaulted totruein theModificationInfosDTO, so after deserialization it was nevernullwhen omitted from a request. As a result, the null guard inupdateNetworkModificationMetadatawas always satisfied, and a metadata update that did not provide the flag silently reactivated the modification.This was visible when renaming a deactivated composite modification in Grid Explorer: the rename reactivated the composite and its content.
Changes
truedefault is now applied at creation only, in theModificationEntity(ModificationInfos)constructor. When the flag is not provided on a metadata update, the activation status is left unchanged.name,description,activated) not provided on an update keep their previous value.This change depends on the matching DTO change: gridsuite/network-modification#190
Important
Penser à mettre à jour la version de
network-modification: lepom.xmlpointe actuellement sur0.84.0-SNAPSHOT. Une fois la PR network-modification#190 fusionnée et publiée, il faudra remplacer cette version par la version released avant de fusionner cette PR.