-
Notifications
You must be signed in to change notification settings - Fork 86
Fixes #25061: Archive API for import/export doesn't know about rule categories #6720
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
Conversation
686e68d to
5a5748b
Compare
|
Commit modified |
5a5748b to
b6353f0
Compare
|
Commit modified |
b6353f0 to
5a2f406
Compare
|
Commit modified |
5a2f406 to
b945333
Compare
|
Commit modified |
| test("move nested rule category2")( | ||
| withCtx(_.save(policyArchiveRuleCategory(rootRuleCategoryWithSubcat2), MergePolicy.KeepRuleTargets))(root => { | ||
| // the expected value is wrong : the test Repo does something unexpected, it leads to multiple categories with same ID, and the root is moved. | ||
| // for now, check that the "rootRuleCategory" effectively contains the expected format | ||
| assertTrue( | ||
| root | ||
| .find(rootRuleCategory.id) | ||
| .map(_._1) | ||
| .getOrElse(rootRuleCategory) | ||
| .transformInto[JRuleCategories] == rootRuleCategoryWithSubcat2.transformInto[JRuleCategories] | ||
| ) | ||
| }) | ||
| ) |
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.
this is problematic in tests : the test ruleCategoryRepo is not behaving the same as the LDAP one, we will need to correct this and add tests in another PR
(#6743)
fanf
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.
Work great ! I was able to create a new category and move a rule in it just with an import :)
|
OK, merging this PR |
39d589b
into
Normation:branches/rudder/8.3
https://issues.rudder.io/issues/25061
Adding the implementation that was marked as a TODO comment : save the tree of
RuleCategoryin the exported archive underrule-categories.json, and be able to import the same JSON file, and create/move categories accordingly.In tests :
By adding the latter, I identified some inconsistency in the test implementation, that will need a following PR