fix(sonarqube): reset to aligned 26.5.0 + CBP 26.5.0 on fresh data; DB→PG16 - #18
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The PostgreSQL image declaration may be ignored, preventing the intended PostgreSQL 16 reset.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR realigns SonarQube and its Community Branch Plugin to 26.5.0 and prepares a fresh PostgreSQL 16 reset.
Changes:
- Pins SonarQube and plugin components to 26.5.0.
- Attempts to configure PostgreSQL 16.15.
- Bumps the ArgoCD values cache-buster.
File summaries
| File | Summary |
|---|---|
kubernetes/postgresql/sonarqube-db.yaml |
The CNPG image field should use imageName; the current image field may be ignored (critical, 3 votes). Documentation also contradicts the PostgreSQL 16 exception (nit, 1 vote). |
helm/releases/sonarqube/values.yaml |
Aligns the SonarQube server, webapp, plugin, and Java agents to 26.5.0. |
bootstrap/appset-helm.yaml |
Updates the values cache-buster from v=6 to v=7. |
Review details
Suppressed comments (2)
kubernetes/postgresql/sonarqube-db.yaml:8
- After correcting the field to
imageName, this image-only change still will not be reconciled automatically:bootstrap/app-postgresql.yaml:41-53ignores.spec.imageName, and that Application usesApplyOutOfSyncOnly. The Cluster will therefore remain considered in sync and keep the current/default PostgreSQL major version; remove this ignore for the migration or otherwise force this field to be applied as part of the reset.
image: ghcr.io/cloudnative-pg/postgresql:16.15-system-trixie
kubernetes/postgresql/sonarqube-db.yaml:8
- This introduces a repository-wide documentation contradiction:
AGENTS.md:92anddocs/cluster.md:233state that every CNPG cluster pins18.4-system-trixie. Update those operational references or document the SonarQube PostgreSQL 16 exception so future recovery and upgrade work does not follow stale guidance.
image: ghcr.io/cloudnative-pg/postgresql:16.15-system-trixie
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| namespace: sonarqube | ||
| spec: | ||
| instances: 1 | ||
| image: ghcr.io/cloudnative-pg/postgresql:16.15-system-trixie |
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.
Summary
One-off incident reset for the SonarQube "empty project list" regression. Restores a fully aligned 26.5.0 stack and pins the database to Postgres 16.
Root cause (established in the prior investigation): the server ran at the chart-default 26.7.0 while the Community Branch Plugin webapp + jar + javaagents were 26.5.0. SonarQube 26.7 changed component/project search to resolve documents by UUID with
auth_shadow docs; the 26.5.0 branch-plugin web layer resolves via the old path and returns an empty list (search_projects->total: 15butcomponents: []). There is no 26.7.0 release of the plugin (latest is 26.5.0). The fix is to align the server down to 26.5.0 so server + plugin + webapp all match.Changes (3 files)
1.
helm/releases/sonarqube/values.yamlReconstructed from the pre-incident state (commit
0a68e71, the parent of PR #11) which carries the full 26.5.0 stack, then added an explicit server image pin:image: { repository: sonarqube, tag: 26.5.0.122743-community }— pins the SERVER to 26.5.0 (the chart default was26.7.0.124771-communityviacommunity.buildNumber).download-webapp-> 26.5.0sonarqube-webapp.zipmounted over/opt/sonarqube/web),plugins.install(26.5.0 jar), both=ce/=webjavaagents,jdbcOverwrite, SSOsonarProperties,persistence,mcp,account.adminPasswordSecretName.cleanup-branch-plugininit container (itrm -f'd the plugin jar we are reinstalling) and the TEMP comment.Net: server 26.5.0 + patched 26.5.0 webapp + 26.5.0 plugin jar + both 26.5.0 javaagents, fully aligned, no cleanup-init.
2.
kubernetes/postgresql/sonarqube-db.yamlspec.image: ghcr.io/cloudnative-pg/postgresql:16.15-system-trixie(was: operator default PG 18.4). All other cluster spec unchanged (instances=1, db/ownerapp, backup to S3).3.
bootstrap/appset-helm.yamlvalueURLcache-buster?v=6->?v=7(ArgoCD caches remote valueFiles aggressively; without the bump it keeps rendering the old values). No other appset line changed.Image tags (both verified pullable)
sonarqube:26.5.0.122743-community— VERIFIED. Only 26.5.0 tag on Docker Hublibrary/sonarqube; digestsha256:223d0090…1fa, updated 2026-06-02. Same repo / no-registry-prefix convention as the livesonarqube:26.7.0.124771-community.ghcr.io/cloudnative-pg/postgresql:16.15-system-trixie— VERIFIED pullable (manifest digestsha256:ac3bcd14…91b3); latest plain16.x-system-trixiein the registry (16.16 absent). Matches the existing18.4-system-trixieconvention.Validation (read-only)
yqparse: all 3 files valid YAML.helm template(chartsonarqube2026.4.1 + new values): renders 784 lines. Everysonarqubeimage =26.5.0.122743-community(no 26.7.0 anywhere).download-webappinit present +/opt/sonarqube/webmount +webappemptyDir(50Mi) volume.=ce/=webjavaagents present in thesonar.propertiesConfigMap (mounted to/opt/sonarqube/conf/) andinstall-pluginspulls the 26.5.0 jar. Nocleanup-branch-plugin.spec.image=16.15-system-trixie(yq-confirmed).This is a major Postgres downgrade. PostgreSQL cannot start an older major version on a data directory initialized by a newer one — PG 16 will refuse to start against the existing PG 18 data dir (control-file version too new).
Therefore, in the merge window the operator MUST delete the data PVCs so CNPG re-initializes fresh on PG 16:
sonarqube-dbCNPG cluster data PVC (podsonarqube-db-1), andsonarqube-sonarqubeSonarQube data PVC (ES + work data) — for a clean "fresh data" reset.This is an operational action performed by the operator, NOT by this PR (this PR is GitOps config only; no live-cluster mutation). Deleting the PVCs wipes the SonarQube data (projects, issues, ES index) — a destructive reset, consistent with the "on fresh data" intent.
Suggested sequence to coordinate:
?v=7forces re-render).sonarqube-dbdata PVC (CNPG re-creates the instance on PG 16) — or delete + re-create the Cluster if needed.sonarqube-sonarqubedata PVC so the server starts fresh (ES re-indexes from the new DB).search_projectsreturns the 15 projects (now resolvable, since server == plugin == webapp == 26.5.0).Risks / notes
s3://backups/sonarqube-dbexist (14d retention) but a PG 18 dump is not directly restorable into a PG 16 instance; treat this as a true reset.