Skip to content

fix: vault secret path - #2412

Merged
shikanime merged 2 commits into
mainfrom
wphetsinorath/push-okqpuuxxnznn
Aug 5, 2026
Merged

fix: vault secret path#2412
shikanime merged 2 commits into
mainfrom
wphetsinorath/push-okqpuuxxnznn

Conversation

@shikanime

@shikanime shikanime commented Aug 4, 2026

Copy link
Copy Markdown
Member

Issues liées

Issues numéro: #2400 #2401


Quel est le comportement actuel ?

Quel est le nouveau comportement ?

Cette PR introduit-elle un breaking change ?

Autres informations

@shikanime shikanime self-assigned this Aug 4, 2026
@shikanime shikanime changed the title test(server-nestjs): align E2E specs with DSO orchestration fix: vault secret path Aug 4, 2026
@shikanime
shikanime force-pushed the wphetsinorath/push-okqpuuxxnznn branch 3 times, most recently from 16472bd to a561157 Compare August 4, 2026 13:09
@github-actions github-actions Bot added the built label Aug 4, 2026
@shikanime shikanime added the bug Something isn't working label Aug 4, 2026
@shikanime shikanime added this to the 9.24.0 milestone Aug 4, 2026
@shikanime shikanime moved this to Backlog in Cloud Pi Native Aug 4, 2026
@shikanime shikanime moved this from Backlog to Experimental in Cloud Pi Native Aug 4, 2026

@shikanime shikanime left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Review — PR #2412 (reviewer)

Verdict: REQUEST CHANGES ⛔ (cannot formally block my own PR, but these must be resolved before merge)

Blocker 1 — Vault secret-path restructure with no migration / dual-read

This PR moves Vault paths with no backward-compatibility read and no data migration:

  • tech/NEXUSforge/{slug}/NEXUS (nexus.service.ts getProjectVaultPath(..., 'NEXUS'))
  • global GITLABforge/{slug}/GITLAB (new generateGitlabTriggerTokenPath, writeMirrorTriggerToken(projectSlug, ...))

On an environment with existing secrets, the new code reads a path that has no secret yet, and the old secret at the previous path is never read or cleaned up. Needs either a one-off migration (write new path from old, or reconcile in a cron) or documented manual steps before merge.

Worse: the Fastify plugins/gitlab still reads/writes the global GITLAB path (plugins/gitlab/src/class.ts:486, functions.ts:53,134). The two backends already disagree on Vault path conventions, so any cutover reasoning is more urgent, not less — please confirm the migration plan covers the legacy plugin path too.

Blocker 2 — Dead dependency

PR body / tracking says it depends on #2403/#2405/#2406. #2406 is CLOSED without merging. Either re-open/merge it or drop the reference. #2403 and #2405 are still open.

Warnings

  • validateProjectToken relies on error.cause?.response.status === 401. The unit tests cover 401/502/active/revoked and pass; a one-line comment citing the expected GitbeakerRequestError.cause shape would help the next reader.
  • mirrorTokenRotationThresholdDays removed; rotation is now driven by live token validity (1-year expiry). Confirm ops expects no age-based early rotation.

Nits

  • e2e renames ControllerService and the new handleDelete e2e improve coverage — good.

Build/lint/59 gitlab+nexus+vault specs: green. The Build application (client) job is green here (no client code touched).

@shikanime
shikanime marked this pull request as ready for review August 5, 2026 07:42
@shikanime
shikanime force-pushed the wphetsinorath/push-okqpuuxxnznn branch 2 times, most recently from 424d68a to 032f455 Compare August 5, 2026 08:06
@shikanime
shikanime enabled auto-merge August 5, 2026 08:16
@shikanime
shikanime requested review from KepoParis and StephaneTrebel and removed request for KepoParis August 5, 2026 08:16
@shikanime

Copy link
Copy Markdown
Member Author

Review: PR #2412 vs #2400 / #2401

Three-axis review (Security → Correctness → Standards) on PR head 032f45538.

Verdict: APPROVE — 1 non-blocking warning

Blockers

None.

Warning

W1 — apps/server-nestjs/test/nexus.e2e-spec.ts:145 is now stale (not in this PR's changed files).
The e2e asserts the secret at getProjectVaultPath(projectsRootDir, slug, 'tech/NEXUS')forge/<slug>/tech/NEXUS, but production now writes forge/<slug>/NEXUS via generateNexusCredPath. The e2e then reads that path expecting NEXUS_USERNAME, so it will fail when run with E2E=true. It is gated behind the E2E env var, so CI does not catch it.
Fix: change line 145 to generateNexusCredPath(config.projectsRootDir, testProjectSlug) (import from ../src/modules/nexus/nexus.utils).

Nit

  • After W1 is fixed, getProjectVaultPath in nexus.utils.ts becomes dead (only the e2e used it post-PR; registry has its own copy with a different signature). Safe to remove then. Not blocking.

What is correct

Tests run: 16 passed on PR head.

@shikanime
shikanime force-pushed the wphetsinorath/push-okqpuuxxnznn branch from 032f455 to e95d42c Compare August 5, 2026 09:10

@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.

Donc on est d'accord que ni le titre de la MR, ni le message de commit ne sont exacts ? Car là on corrige vault et nexus.

Non pas que ça me dérange, mais je préfère qu'on soit explicites 😉

Comment thread apps/server-nestjs/src/modules/nexus/nexus.service.ts Outdated
Comment thread apps/server-nestjs/src/modules/vault/vault-client.service.spec.ts
Comment thread apps/server-nestjs/src/modules/vault/vault.utils.spec.ts
@StephaneTrebel
StephaneTrebel requested a review from a team August 5, 2026 12:34

@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.

Me suis mélangé les crayons avec les reviewers 😅

@StephaneTrebel
StephaneTrebel requested review from StephaneTrebel and removed request for KepoParis and StephaneTrebel August 5, 2026 12:56
@StephaneTrebel
StephaneTrebel dismissed their stale review August 5, 2026 12:57

je nettoie mon bazar

@StephaneTrebel
StephaneTrebel requested a review from a team August 5, 2026 12:57
@StephaneTrebel
StephaneTrebel requested review from StephaneTrebel and removed request for StephaneTrebel August 5, 2026 12:58

@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.

je remets mon Request Changes

@StephaneTrebel
StephaneTrebel requested a review from a team August 5, 2026 12:58

@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.

je pense que GH est bien buggé là 😅

@shikanime
shikanime force-pushed the wphetsinorath/push-okqpuuxxnznn branch 2 times, most recently from 5adeeca to dbed1ce Compare August 5, 2026 14:09
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
Change-Id: Ibf9a5522c0ccedcb1a49c087008db9a56a6a6964
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
Change-Id: Ibf9a5522c0ccedcb1a49c087008db9a56a6a6964
@shikanime
shikanime force-pushed the wphetsinorath/push-okqpuuxxnznn branch from dbed1ce to 7970476 Compare August 5, 2026 14:12
@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.

Toujours un commit qui mélange Vault et Nexus, je dis ça… 😛

@shikanime
shikanime added this pull request to the merge queue Aug 5, 2026
@github-project-automation github-project-automation Bot moved this from In Research to Ready in Cloud Pi Native Aug 5, 2026
Merged via the queue into main with commit 6ea6379 Aug 5, 2026
34 checks passed
@shikanime
shikanime deleted the wphetsinorath/push-okqpuuxxnznn branch August 5, 2026 14:48
@github-project-automation github-project-automation Bot moved this from Ready to Done in Cloud Pi Native Aug 5, 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.

2 participants