fix(server-nestjs): resolve Keycloak root group by path, not name - #2604
Merged
Merged
Conversation
Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I54908a3c7c0c03cd7798968b14816c946a6a6964
|
StephaneTrebel
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

0 New Issues
1 Fixed Issue
0 Accepted Issues
Issues liées
Closes #2518
Comportement actuel
Lors de l'ajout d'un repo d'infrastructure, l'événement
project.upsertdéclencheKeycloakService.syncProject->getOrCreateGroupByPath('/<slug>'). Deux défauts dansKeycloakClientService:getRootGroupByName: le fallback?? candidates.find(g => g.name === name)surgroups.find({ search })(recherche par sous-chaîne à toutes les profondeurs) peut retourner un sous-groupe à un autre chemin (ex./console/other/myproject) au lieu du groupe racine/<slug>.getOrCreateGroupByPath: le segment racine appelaitgetGroupByName(recherche large par nom) au lieu degetRootGroupByName(recherche par path).L'ID de groupe erroné alimente ensuite
getGroupMembers->listMembers-> Keycloak répond « Could not find group by id ».Nouveau comportement
getRootGroupByNamene match plus que par path exact/<name>(groupes racine uniquement) — suppression du fallback par nom.getOrCreateGroupByPathutilisegetRootGroupByNamepour le segment racine avant création.2 tests unitaires couvrent : réutilisation du groupe racine existant (match par path malgré un sous-groupe au mauvais chemin de même nom), et création du groupe racine quand seule une sous-groupe au mauvais chemin correspond.
Breaking change
Non.