Skip to content

Conversation

@klesaulnier
Copy link
Contributor

PR Summary

Many operations (delete modification, disable modification, ...) will invalidate current node
For security node only, this will rebuild the current node after the operation is over

klesaulnier and others added 18 commits December 29, 2025 09:25
…ilt automatically

Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
…ild first one automatically

Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
);
}

private Set<UUID> getRootNetworkWhereNotHasToBeRebuilt(UUID studyUuid, UUID nodeUuid) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Change this function's name

Copy link
Contributor

@EstherDarkish EstherDarkish left a comment

Choose a reason for hiding this comment

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

Tests OK, some remarks.

Comment on lines 606 to 608
public boolean isRootOrConstructionNode(UUID nodeUuid) {
return self.getNode(nodeUuid, null).getType().equals(NodeType.ROOT) || isConstructionNode(nodeUuid);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use
getNodeEntity(parentNodeId).getType() == NodeType.ROOT
like below ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 1276 to 1299
// 1️⃣ Ancêtres de node1
Set<UUID> ancestorsOfNode1 = new HashSet<>();
NodeEntity current = getNodeEntity(node1Uuid).getParentNode();

while (current != null) {
ancestorsOfNode1.add(current.getIdNode());
current = current.getParentNode();
}

// 2️⃣ Remontée depuis node2
current = getNodeEntity(node2Uuid).getParentNode();
while (current != null) {
UUID currentId = current.getIdNode();

// node1 est ancêtre de node2
if (currentId.equals(node1Uuid)) {
return List.of(node1Uuid);
}

// ancêtre commun ≠ relation hiérarchique directe → on ignore
current = current.getParentNode();
}

// 3️⃣ Vérifier l’inverse SANS rebalayer tout
Copy link
Contributor

Choose a reason for hiding this comment

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

Clean those ChatGPT slop comments : remove the emoticons, special chars (≠, →, etc), and translate them in english.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@Transactional
public void buildFirstLevelChildren(@NonNull UUID studyUuid, @NonNull UUID parentNodeUuid, @NonNull UUID rootNetworkUuid, @NonNull String userId) {
List<NodeEntity> firstLevelChildren = networkModificationTreeService.getChildren(parentNodeUuid);
long builtNodesUpToQuota = getBuiltNodesUpToQuota(studyUuid, rootNetworkUuid, userId);
Copy link
Contributor

Choose a reason for hiding this comment

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

When we reach the quota, some of the childrens are built but not all, and we do not have a warning message. Maybe see with the PO what we should do about that ?

Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier.pro@gmail.com>
@sonarqubecloud
Copy link

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.

3 participants