Skip to content

fix(gitlab): return existing user on 409 instead of failing sync - #2535

Merged
shikanime merged 1 commit into
mainfrom
fix/gitlab-user-collision
Aug 21, 2026
Merged

fix(gitlab): return existing user on 409 instead of failing sync#2535
shikanime merged 1 commit into
mainfrom
fix/gitlab-user-collision

Conversation

@shikanime

@shikanime shikanime commented Aug 20, 2026

Copy link
Copy Markdown
Member

Issues liées

Closes #2529


Quel est le comportement actuel ?

Lors de la réconciliation GitLab (upsertUsercreateUser), un 409 Username has already been taken interrompt la synchronisation du projet : createUser lève une exception et aucun membre n'est ajouté pour ce projet.

Quel est le nouveau comportement ?

createUser capture le GitbeakerRequestError dont cause.description contient has already been taken, puis renvoie l'utilisateur déjà existant (résolu par getUserByEmail) au lieu de propager l'erreur. La réconciliation se termine normalement.

Cette PR introduit-elle un breaking change ?

Non.

Autres informations

GitLab auto-provisionne les utilisateurs via OIDC : un 409 sur createUser signifie que l'utilisateur existe déjà (course sur l'index e-mail dans getUserByEmail). Indépendant de #2524 / #2526 (erreur 500 //api/v4 due au slash final de GITLAB_URL).

@github-actions github-actions Bot added the built label Aug 20, 2026
@shikanime
shikanime force-pushed the fix/gitlab-user-collision branch from d90d2cb to 090e733 Compare August 20, 2026 16:17
@shikanime
shikanime marked this pull request as draft August 20, 2026 16:32
@shikanime
shikanime force-pushed the fix/gitlab-user-collision branch 2 times, most recently from 4d775e9 to ac8c263 Compare August 20, 2026 16:58
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
Change-Id: I9ef9b105f0f5debdbbbb78fffe2b35846a6a6964
@shikanime
shikanime force-pushed the fix/gitlab-user-collision branch from ac8c263 to e682458 Compare August 20, 2026 16:59
@shikanime
shikanime marked this pull request as ready for review August 20, 2026 17:00
@shikanime shikanime self-assigned this Aug 20, 2026
@shikanime shikanime added this to the 9.24.5 milestone Aug 20, 2026
@shikanime shikanime added the bug Something isn't working label Aug 20, 2026
@shikanime
shikanime requested a review from KepoParis August 20, 2026 17:00
@cloud-pi-native-sonarqube

Copy link
Copy Markdown

@shikanime
shikanime added this pull request to the merge queue Aug 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 21, 2026
@shikanime
shikanime added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit 50c9c79 Aug 21, 2026
63 checks passed
@shikanime
shikanime deleted the fix/gitlab-user-collision branch August 21, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working built

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [BUG] - GitLab : 409 'Username has already been taken' lors de l'upsert d'utilisateurs

2 participants