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
Fixes #18952: Static group which depends on dynamic subgroup must be forbiden #5286
Fixes #18952: Static group which depends on dynamic subgroup must be forbiden #5286
Conversation
val html: NodeSeq = dependingSubgroups match { | ||
case None => popup.popupContent() | ||
case Some(msg) => | ||
val cssSel: CssSel = "#explanationMessageZone *+" #> |
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.
that cssSel means: "add after the last child in content"
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.
woaaah it's quite inventive
PR updated with a new commit |
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.
Overall this works fine, except for one little edge case :
- I set a static parent group to have a sub-group A which is static, it works fine
- Then I change the sub-groups of the parent to another sub-group B which is also static
- Then I change the sub-group A to be dynamic (which is fine, it has no parent)
- Finally I change the parent group to have A as sub-group... And it's still saving without any error ! But there should be, because the parent is static and A is now dynamic, it breaks the rule !
Maybe there is some state left in memory here, but it seems hard to debug. Ideally we should later move that whole logic to another part (NodeFactRepo
) so it's fine for now !
This PR is not mergeable to upper versions. |
OK, squash merging this PR |
0f729f8
to
5f84c91
Compare
https://issues.rudder.io/issues/18952
Manage the cases where subgroup changes cause chaos on other subgroup, either by being deleted, or becoming static (with dyn dep) or decoming dynamic (used in subgroup of static group).
There is a lot of lines changed, but most are error handling.
The logic is similar for both "look if the node becoming dynamic is a dependency of a static group" or "look if the group becoming static as a dynamic group as a subgroup": each time, unwind the the query of the interesting group, look for the nature of dependencies.
The error is not returned in the IOResult error channel, since it's user-actionnable: it's an option (in that case, the
Some
contains a string for the list of bad groups).The configirmation pop-up on deletion is handle by cssSel magic, I was happy to not have to change its HTML at all.