refactor(server-nestjs): route Keycloak group creation through shared ensure util - #2640
Merged
Conversation
shikanime
marked this pull request as ready for review
September 1, 2026 12:23
shikanime
enabled auto-merge
September 1, 2026 12:23
StephaneTrebel
previously approved these changes
Sep 7, 2026
shikanime
force-pushed
the
refactor/keycloak-ensure-util
branch
from
September 8, 2026 13:32
6c6fd2b to
8a561c6
Compare
shikanime
force-pushed
the
refactor/keycloak-ensure-util
branch
from
September 8, 2026 13:56
8a561c6 to
285ddb5
Compare
… ensure util The ensure util now treats create as a bare write (void) and always reads the entity back through reload: callers receive the representation Keycloak computed, never a locally synthesized one. A race collision (409) still reloads once and rethrows the original error when the entity is not found. When reload finds nothing after a successful write, ensure returns undefined; the service boundary re-establishes the non-undefined guarantee with an explicit guard naming the group. Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I05b26d3c6452b05e7c6243852fd35c116a6a6964
shikanime
force-pushed
the
refactor/keycloak-ensure-util
branch
from
September 8, 2026 14:32
285ddb5 to
c96fa00
Compare
|
StephaneTrebel
approved these changes
Sep 8, 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
#2618 (référence ; le bug est déjà corrigé par #2623)
Quel est le comportement actuel ?
Les deux chemins de création de groupes Keycloak (
ensureGroupetgetOrCreateSubGroupByName) gèrent la course de création concurrente (409) via des try/catch impératifs locaux, dupliquant le motifensuredésormais partagé par les modules gitlab (#2624), nexus (#2627), registry (#2605) et sonarqube (#2639).Quel est le nouveau comportement ?
Même comportement observable, exprimé avec le motif commun :
isKeycloakConflict(409) etensure{create, reload, onCollision}danskeycloak.utils.ts, et les deux sites d'appel réduits à la déclaration decreate/reload. Les tests client existants (409 avec relecture, 409 sans entité trouvée, erreur non-409 sans relecture) passent inchangés et verrouillent la préservation du comportement.Cette PR introduit-elle un breaking change ?
Non.
Autres informations
Clôture la campagne d'uniformisation du motif
ensuresur server-nestjs (#2605 #2624 #2627 #2639).