refactor(admin-roles): migrate from server - #2371
Conversation
e25c2f2 to
3218292
Compare
|
🤖 Hey ! The security scan report for the current pull request is available here. |
3218292 to
3044f04
Compare
|
🤖 Hey ! The security scan report for the current pull request is available here. |
3044f04 to
b2642e0
Compare
|
🤖 Hey ! The security scan report for the current pull request is available here. |
shikanime
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Migration of admin-roles from the legacy Fastify server into server-nestjs is well-structured (typecheck clean, admin-role.service.spec.ts passes, eslint clean). One blocker must be resolved before the legacy router is cut over.
Blocker — emitted adminRole.* events are never consumed (silent Keycloak/GitLab sync regression).
The service emits adminRole.upsert / adminRole.delete (service.ts:45, :124, :169) via EventEmitter2, but no @OnEvent('adminRole.upsert'|'adminRole.delete') handler exists in server-nestjs and @cpn-console/hooks is not imported by the module. In the legacy server, those same flows call hook.adminRole.upsert / hook.adminRole.delete (business.ts:42,66,94), which drive the Keycloak OIDC-group sync and GitLab admin/auditor group sync. Every other migrated entity bridges its event into the plugin hook system via an @OnEvent handler (e.g. keycloak.service.ts:28, gitlab.service.ts:63). Without that bridge, once the legacy route is removed, admin-role CRUD will silently stop syncing member groups. Add the @OnEvent bridge handlers (mirroring the project bridge) or explicitly defer with a tracked follow-up before cutover.
Warnings (parity-preserving, confirm): dead patch position-integrity guard (service.ts:92) — only reachable in the legacy-incompatible all-roles path; adminRole.delete emitted before the row delete inside the transaction (service.ts:169 vs :185) — legacy does the same.
Minor: unused testing-utils exports (AdminRoleContract, AdminRoleResponse, makeAdminRoleMember in admin-role-testing.utils.ts:5,6,27).
Full detail in the inline comments.
b2642e0 to
b5725e4
Compare
|
🤖 Hey ! The security scan report for the current pull request is available here. |
b5725e4 to
de5e877
Compare
|
🤖 Hey ! The security scan report for the current pull request is available here. |
StephaneTrebel
left a comment
There was a problem hiding this comment.
Rien qui me choque, mais les questions évoquées me semblent pertinentes
de5e877 to
046ee74
Compare
Review: PR #2371 — verdict REQUEST CHANGESI reviewed the actual diff (34 commits / 206 files). CI is green (unit-tests, lint, build, SonarQube, Trivy, CodeQL all pass) and the branch is mergeable with no conflicts. The quality of the code is high: the deployment Blockers
Warnings (follow-up)
Nits
|
ca7cef4 to
273f574
Compare
Review: #2371 — refactor(admin-roles): migrate from serverVerdict: REQUEST CHANGES (reviewer agent) — blocker still open since [blocker] Emitted Warnings (parity-preserving): dead Cannot approve until the blocker is resolved. |
46e09e4 to
5859c44
Compare
df94492 to
3892f83
Compare
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I00a18a853330301a735cdfcf3fb6955a6a6a6964
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I6e2bf93ddac464c88a82683dc6e6b0846a6a6964
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: Ic2c440162f9294ef651ae913e64d887d6a6a6964
Drop AdminRoleContract, AdminRoleResponse, and makeAdminRoleMember from admin-role-testing.utils.ts — zero importers (review thread UE6NU). Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I4235338539a661d66fc5174f4f2457936a6a6964
f9946f2 to
0bc5040
Compare
|

3 New Issues
0 Fixed Issues
0 Accepted Issues
Issues liées
Issues numéro:
Quel est le comportement actuel ?
Le module
admin-role(rôles d'administration, permissions, positions) est servi par l'ancienne application Fastifyapps/server.Quel est le nouveau comportement ?
Migration du module
admin-roleversapps/server-nestjs:AdminRoleController: routesGET /,POST /,PUT /,DELETE /:roleId.AdminRoleService:create,list,patch,delete+ émission des hooksadminRole.upsert/adminRole.deleteviaAppEventsService.AdminRoleQueriesUtils/AdminRoleTestingUtils: sélections Prisma typées et fabriquesfaker.main.module.ts.Parité vérifiée contre
apps/server/src/resources/admin-role/business.ts:adminRole.deleteémis dans la transaction (business.ts:94) — parité préservée.ListRolesvolontairement non gardé (comportement legacy-client) — conforme au router legacy.Cette PR introduit-elle un breaking change ?
Non.