Skip to content

fix: provision GitLab CI variables for SonarQube - #2539

Merged
shikanime merged 1 commit into
mainfrom
fix/sonarqube-gitlab-ci-vars
Aug 21, 2026
Merged

fix: provision GitLab CI variables for SonarQube#2539
shikanime merged 1 commit into
mainfrom
fix/sonarqube-gitlab-ci-vars

Conversation

@shikanime

Copy link
Copy Markdown
Member

Issues liées

Closes #2538


Quel est le comportement actuel ?

Le module sonarqube de apps/server-nestjs créait le projet SonarQube, posait les permissions et écrivait le secret Vault (SONAR_USERNAME/SONAR_PASSWORD/SONAR_TOKEN), mais n'approvisionnait aucune variable CI GitLab — contrairement au plugin legacy plugins/sonarqube qui exécutait setVariables (PROJET_KEY=…, PROJECT_NAME=…, SONAR_TOKEN, SONAR_PROJECT_PROPERTIES). Les pipelines GitLab ne disposaient donc pas des variables nécessaires à l'analyse SonarQube.

Quel est le nouveau comportement ?

  • GitlabClientService expose deux méthodes idempotentes (setGitlabGroupVariable, setGitlabRepoVariable) qui créent/mettent à jour/laissent intacte une variable CI selon son état courant.
  • SonarqubeService.ensureProjectRepositories provisionne désormais, pour chaque dépôt : PROJECT_KEY, PROJECT_NAME, SONAR_PROJECT_PROPERTIES (type fichier), et SONAR_TOKEN (masqué) ; SONAR_TOKEN est également posé au niveau du groupe projet (partagé entre dépôts). Valeurs calquées sur le sonar-project.properties du plugin legacy.

Cette PR introduit-elle un breaking change ?

Non.

Autres informations

Tests unitaires ajoutés sur les deux nouvelles méthodes (création / mise à jour / already up-to-date).

Comment thread apps/server-nestjs/src/modules/sonarqube/sonarqube.module.ts Fixed
@shikanime shikanime self-assigned this Aug 20, 2026
@shikanime shikanime added this to the 9.24.5 milestone Aug 20, 2026
@github-actions github-actions Bot added the built label Aug 20, 2026
@shikanime
shikanime force-pushed the fix/sonarqube-gitlab-ci-vars branch 5 times, most recently from 1d1d874 to 2e03dbb Compare August 20, 2026 17:15
@shikanime
shikanime marked this pull request as ready for review August 20, 2026 17:19
@shikanime shikanime added the bug Something isn't working label Aug 20, 2026
@shikanime
shikanime requested a review from KepoParis August 20, 2026 17:19
@shikanime shikanime added the preview Deploy preview app with Argo-cd label Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Hey !

A preview of the application is available at : https://console-pr-2539.dso.cpin-hp.numerique-interieur.fr

Please be patient, deployment may take a few minutes.

@shikanime
shikanime force-pushed the fix/sonarqube-gitlab-ci-vars branch 3 times, most recently from cb19b5e to 7a1f2c1 Compare August 21, 2026 09:28
Expose the SonarQube robot SONAR_TOKEN once per project at the GitLab
group level so CI pipelines can reach quality gate data. Adds the
isGitbeakerNotFound/setGitlabGroupVariable helpers the wiring needs and
drops a dangling optional-chain in the variable upsert guard.

Co-authored-by: Automata <automata@shikanime.studio>
Signed-off-by: William Phetsinorath <william.phetsinorath-open@interieur.gouv.fr>
Change-Id: I9a7c9e98093c89db7fccd61e63f4ee9c6a6a6964
@shikanime
shikanime force-pushed the fix/sonarqube-gitlab-ci-vars branch from 7a1f2c1 to d25b4d0 Compare August 21, 2026 12:30
@cloud-pi-native-sonarqube

Copy link
Copy Markdown

@shikanime
shikanime added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit 71632fe Aug 21, 2026
34 checks passed
@shikanime
shikanime deleted the fix/sonarqube-gitlab-ci-vars branch August 21, 2026 15:58
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 preview Deploy preview app with Argo-cd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [BUG] - SonarQube : les variables CI GitLab ne sont pas provisionnées

2 participants