-
Notifications
You must be signed in to change notification settings - Fork 73
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 #24295: API export of groups doesn't export the categories as dependencies #5521
Conversation
8277e16
to
aaea1fc
Compare
@@ -435,12 +464,18 @@ class ZipArchiveBuilderService( | |||
val name = fileArchiveNameService.toFileName(origName) + extension | |||
|
|||
// find a free name, avoiding overwriting a previous similar one | |||
usedNames.modify(m => { | |||
val realName = if (m(category).contains(name)) { |
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.
never do that, it breaks when the thing doesn't exist
usedNames: Ref[Map[String, Set[String]]] | ||
): IOResult[Chunk[Zippable]] = { | ||
for { | ||
ref <- Ref.make(Chunk.empty[Zippable]) |
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.
we use a ref to avoid building list of list and then flatmapping in the end
This PR is not mergeable to upper versions. |
OK, merging this PR |
https://issues.rudder.io/issues/24295
The chosen new mapping is one that match the LDAP/UI representation of group categories and groups:
This mapping is so-so, since the group serialisation also contains the group category id, so we duplicate the information, and if we move a group, it doesn't actually change its category, which is surprising. But I wanted to have the same json serialisation than the one from API.
I hesitated with a mappring like:
But it was strang to have a mixe of "one item for each groups" and "one big json with lots of categories".
Still, maybe it would be easier to manipulate.