Repository navigation
fix(server): tighten role backfill anti-join to the role level - #2820
Merged
Merged
Conversation
The 20260907170000_backfill_project_roles anti-join matches on projectId only: any project owning at least one ProjectRole row (a single custom role suffices) never receives its missing system roles. Rework the migration as a per-role anti-join on name + position + oidcGroup + permissions so each absent system role is inserted individually while existing rows of any kind stay untouched. Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I079f57414d86c055d257834492eaadc46a6a6964
KepoParis
approved these changes
Oct 5, 2026
|
StephaneTrebel
approved these changes
Oct 6, 2026
StephaneTrebel
left a comment
Collaborator
There was a problem hiding this comment.
La migration ajoute un anti-jointure par rôle dans les deux arbres Prisma et préserve les lignes déjà présentes ; elle couvre ainsi les projets sans rôle comme ceux partiellement peuplés. Aucun écart bloquant identifié sur la tête 85eda20 ; CI verte et aucun fil ouvert.
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
0 Fixed Issues
0 Accepted Issues
No data about coverage (55.60% Estimated after merge)
Pourquoi
L'anti-jointure de la migration
20260907170000_backfill_project_rolesne porte que surprojectId: tout projet possédant au moins une ligneProjectRole(un seul rôle personnalisé suffit) ne reçoit jamais ses rôles système manquants.Quoi
Rework de la migration en anti-jointure par rôle sur
name+position+oidcGroup+permissionsdans les deux arbres (apps/serveretapps/server-nestjs) : chaque rôle système absent est inséré individuellement, les lignes existantes de toute nature restent inchangées, et une ré-exécution est un no-op. Validé sur une base vierge (chaîne complète de migrations puis insertion ciblée) : projet sans rôle → 4 rôles, projet partiel → seuls les rôles manquants, projet avec rôle personnalisé → 4 rôles système ajoutés sans toucher l'existant, ré-exécution sans effet.Références
Issues liées: #2819