Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<sonar.organization>gridsuite</sonar.organization>
<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>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ protected ModificationEntity(ModificationInfos modificationInfos) {
this.date = Instant.now().truncatedTo(ChronoUnit.MICROS);
// Do not put this stashed status in assignAttributes, it's not part of a network modification as such.
this.stashed = modificationInfos.getStashed();
this.activated = modificationInfos.getActivated();
// On creation, default a missing activation flag to true (a null value otherwise means "leave status unchanged" on update)
this.activated = modificationInfos.getActivated() != null ? modificationInfos.getActivated() : true;

assignAttributes(modificationInfos);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,26 @@ void updateModificationDescription() throws Exception {
assertEquals("new description", modificationRepository.getModifications(TEST_GROUP_ID, true, true).getFirst().getDescription());
}

@Test
void updateModificationMetadataDoesNotModifyFieldsNotProvided() {
// create a composite modification and set all its metadata fields
UUID compositeUuid = modificationRepository.createNetworkCompositeModification(List.of());
modificationRepository.updateNetworkModificationMetadata(List.of(compositeUuid), CompositeModificationInfos.builder()
.name("composite name")
.description("composite description")
.activated(false)
.build());

// update the metadata again without providing any field
modificationRepository.updateNetworkModificationMetadata(List.of(compositeUuid), CompositeModificationInfos.builder().build());

// every field not provided must keep its previous value
CompositeModificationInfos result = (CompositeModificationInfos) modificationRepository.getModificationInfo(compositeUuid);
assertEquals("composite name", result.getName());
assertEquals("composite description", result.getDescription());
assertEquals(false, result.getActivated());
}

@Test
void testDeleteModification() throws Exception {
MvcResult mvcResult;
Expand Down
Loading