Skip to content

fix(server): tighten role backfill anti-join to the role level - #2820

Merged
shikanime merged 1 commit into
mainfrom
wphetsinorath/push-zsqkusvyvmrt
Oct 6, 2026
Merged

shikanime merged 1 commit into
mainfrom
wphetsinorath/push-zsqkusvyvmrt

Conversation

@shikanime

@shikanime shikanime commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Pourquoi

L'anti-jointure de la migration 20260907170000_backfill_project_roles ne porte que sur projectId : tout projet possédant au moins une ligne ProjectRole (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 + permissions dans les deux arbres (apps/server et apps/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

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
@shikanime
shikanime requested a review from a team as a code owner October 5, 2026 15:55
@shikanime shikanime self-assigned this Oct 5, 2026
@shikanime shikanime added the bug Something isn't working label Oct 5, 2026
@shikanime shikanime modified the milestones: 10.0.0, 9.26.1 Oct 5, 2026
@shikanime
shikanime enabled auto-merge October 5, 2026 16:00
@github-actions github-actions Bot added the built label Oct 5, 2026
@cloud-pi-native-sonarqube

Copy link
Copy Markdown

@StephaneTrebel StephaneTrebel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@shikanime
shikanime disabled auto-merge October 6, 2026 07:44
@shikanime
shikanime added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 9eefb75 Oct 6, 2026
35 checks passed
@shikanime
shikanime deleted the wphetsinorath/push-zsqkusvyvmrt branch October 6, 2026 08:16
@StephaneTrebel StephaneTrebel modified the milestones: 9.26.1, 9.26.2 Oct 6, 2026
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] - Le backfill des rôles système ignore les projets partiellement peuplés

3 participants