fix(server-nestjs): backfill default system roles on roleless projects - #2685
Merged
Conversation
shikanime
force-pushed
the
pr/2684-backfill-roles
branch
2 times, most recently
from
September 7, 2026 15:01
9184499 to
2a33d0c
Compare
shikanime
force-pushed
the
pr/2684-backfill-roles
branch
from
September 7, 2026 15:21
2a33d0c to
1d5b4cf
Compare
Projects created before generateProjectCreateInput seeded the four default project roles have no ProjectRole rows: members hold no permissions and the Keycloak OIDC groups are absent. Insert Administrateur (2), DevOps (984), Développeur (784) and Lecture seule (768) with system:managed type and slug-derived oidcGroup, mirroring generateProjectCreateInput, only into projects owning zero roles. Projects with any existing role are left untouched and the insert is idempotent. Refs #2684 Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I520cf59e2d3fc2d59b64df4441a571b26a6a6964
shikanime
force-pushed
the
pr/2684-backfill-roles
branch
from
September 7, 2026 15:23
1d5b4cf to
55d4ae4
Compare
shikanime
marked this pull request as ready for review
September 7, 2026 15:23
Contributor
|
🤖 Hey ! A preview of the application is available at : https://console-pr-2685.dso.cpin-hp.numerique-interieur.fr Please be patient, deployment may take a few minutes. |
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 7, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 7, 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
0 Fixed Issues
0 Accepted Issues
No data about coverage (24.80% Estimated after merge)
Issues liées
Refs #2684
Quel est le comportement actuel ?
Les projets créés avant l'introduction de
generateProjectCreateInput(apps/server-nestjs/src/modules/project/project.utils.ts) n'ont aucune ligne dansProjectRole: leurs membres n'ont aucune permission et les groupes OIDC Keycloak correspondants sont absents.Quel est le nouveau comportement ?
Les projets disposant déjà d'au moins un rôle ne sont pas touchés ; la migration est idempotente (
WHERE NOT EXISTS).Cette PR introduit-elle un breaking change ?
Non.
Autres informations
Validée sur PostgreSQL 16 jetable : un projet sans rôle reçoit exactement 4 rôles (permissions, positions et oidcGroup conformes), un projet avec rôles reste inchangé, une seconde exécution insère 0 ligne (
INSERT 0 0).Refs #2684