Repository navigation
refactor(stage): migrate module from server - #2496
Conversation
1d3e821 to
491efae
Compare
|
Réouverte : couverture des familles restantes pour #1889 — le fermeture précédente était un tri, pas un rejet du travail. |
|
Réouverte : famille requise pour #1889. Branche recréée depuis le SHA d'origine (l'ancienne ref avait été supprimée). |
491efae to
f143a17
Compare
|
apps/nginx-strangler/conf.d/routing.conf: 🟡 risk: Aucun |
f143a17 to
1fcd77e
Compare
|
Traité dans 1fcd77e : bloc |
29373d5 to
84483c9
Compare
shikanime
left a comment
There was a problem hiding this comment.
Verdict : Commentaire
Constat de la revue du 01/10 levé : le commit de tête n'est plus placeholder — 5151b0a3 refactor(stage): migrate module from server respecte Conventional Commits. Les 11 fils sont résolus, la lecture publique de GET /api/v1/stages est couverte par le test HTTP anonyme (75f79678, garde qui throw si UserGuard revient), CI verte à la tête (runs 37003853092 / 37003856845). Scan de sécurité du diff : néant.
✨ La garde « environnement attaché » et la suppression regroupées dans une seule $transaction éliminent la TOCTOU du deleteStage legacy — le fix est dans le service, tous les appelants en profitent.
StephaneTrebel
left a comment
There was a problem hiding this comment.
La migration stage restaure bien la route publique et ajoute les conversions au contrat, mais les paramètres UUID ne sont plus validés avant Prisma. Le ledger #2493 ne fournit pas de checklist ; les anciens fils sont résolus, la CI est verte et ce nouveau fil important reste à traiter.
StephaneTrebel
left a comment
There was a problem hiding this comment.
Le paramètre stageId est maintenant validé sur les deux mutations avant Prisma. Les fils sont résolus et la CI est verte.
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I0f12f505675c289e395ded0acf6974946a6a6964 Co-authored-by: Automata <automata@shikanime.studio>
Type les fonctions de `stage-queries.utils.ts` sur `Prisma.TransactionClient` (`tx`), réutilise les fabriques du module environment et expose `CreateStageBodySchema`/`UpdateStageBodySchema` depuis le contrat partagé avec alias `z.infer`. Refs #2493 Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I20758c24ffff649d2e2e38a61d1185bf6a6a6964
…action `createStage`, `updateStage`, `deleteStage` et `linkClusterToStages` exécutent désormais leurs séquences dans `prisma.$transaction`. Refs #2493 Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I56bd2f18c7b7e247b11fc62f6b2d4a896a6a6964
Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
UserGuard on the stage routes resolves AuthService through the importing module; without AuthModule the backend crashed at boot. Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
UserGuard resolves UserPermissionService through the importing module as well; the guard crashed at boot with only AuthModule imported. Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
Les fabriques `makeCluster` et `makeEnvironment` de stage-testing.utils dupliquaient celles de environment-testing.utils ; réutilisation des fabriques existantes pour éviter la dérive. Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Co-authored-by: Automata <automata@shikanime.studio>
The class-level guard required authentication for `GET /api/v1/stages`, while the legacy router serves `listStages` without auth and the shared contract announces no 401. Move `@UseGuards(UserGuard)` to the four protected routes and lock the public list in the controller spec. Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: Iff3ffe4528e1e5a00acc14772c039c2a6a6a6964
The guard-metadata assertions read `__guards__` runtime metadata that never matches at HEAD and re-assert permission strings already covered by the service; the `as never` casts erased the contract shapes at the controller boundary. Type the fixtures against `StageAssociatedEnvironments` and `UpdateStageBody` instead. Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I896bf4241b9ed6f601fa37caf3cb67d46a6a6964
Reflect-based guard metadata assertions pass whether or not the guard is enforced and add no behavioural coverage; the guard spec and the controller delegation tests are untouched. Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I2531092df02ab78c1dbb29c4176a19526a6a6964
…ecords toStage and toStageAssociatedEnvironments apply the contract shape in StageController; StageService returns raw query records. Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: Iabaa9863ac20ef96fa635f1d87305b246a6a6964
Co-authored-by: Automata <automata@shikanime.studio>
…roller Co-authored-by: Automata <automata@shikanime.studio>
Co-authored-by: Automata <automata@shikanime.studio> Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr> Change-Id: I30ec3521f38f8f20c55081a5eb3c981f6a6a6964
Co-authored-by: Automata <automata@shikanime.studio>
Co-authored-by: Automata <automata@shikanime.studio>
Co-authored-by: Automata <automata@shikanime.studio>
7d673a5 to
0ff1bf8
Compare
|

0 New Issues
0 Fixed Issues
0 Accepted Issues
Issues liées
Refs #2493
Quel est le comportement actuel ?
Le module
stage(stages, environnements par stage) est servi par l'ancienne application Fastifyapps/server.Quel est le nouveau comportement ?
Migration du module
stageversapps/server-nestjs:StageController,StageService,StageModule.stage-queries.utils.ts: sélections Prisma typées.stage-testing.utils.ts: fabriquesfakerpour les tests.main.module.ts.apps/server/src/resources/stage/.Cette PR introduit-elle un breaking change ?
Non.
Autres informations