-
Notifications
You must be signed in to change notification settings - Fork 2
Security node auto rebuild for mutiple operations #908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…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) { |
There was a problem hiding this comment.
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
EstherDarkish
left a comment
There was a problem hiding this 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.
| public boolean isRootOrConstructionNode(UUID nodeUuid) { | ||
| return self.getNode(nodeUuid, null).getType().equals(NodeType.ROOT) || isConstructionNode(nodeUuid); | ||
| } |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| // 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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>
|



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