Skip to content

chore: migrate Kotlin shared Sonar workflows to self-hosted SonarQube [NOJIRA]#292

Draft
tobias0106 wants to merge 2 commits into
mainfrom
chore/migrate-to-self-hosted-sonarqube
Draft

chore: migrate Kotlin shared Sonar workflows to self-hosted SonarQube [NOJIRA]#292
tobias0106 wants to merge 2 commits into
mainfrom
chore/migrate-to-self-hosted-sonarqube

Conversation

@tobias0106
Copy link
Copy Markdown

@tobias0106 tobias0106 commented May 29, 2026

Why

Migrate the two reusable Kotlin Sonar workflows to the self-hosted SonarQube at https://sonarqube.vpn.internal.monta.app (full migration — #project-migrate-to-sonarqube).

Changes

  • sonar-cloud.yml + pull-request-kotlin.yml: add a Tailscale step before the gradle sonar step so self-hosted ARC runners can reach the VPN-internal SonarQube (same pattern as server#23360).
  • TAILSCALE_AUTHKEY is an optional secret, and the Tailscale step is guarded (if: env.TAILSCALE_AUTHKEY != '').
  • Rename display strings SonarCloudSonarQube.

Backward compatible — no flag day

Because the workflows are pinned @main, a required secret would break every caller the instant this merges. Instead this is opt-in per repo:

  • Not yet migrated (no TAILSCALE_AUTHKEY, build.gradle.kts still on sonarcloud.io) → Tailscale step skips, scan keeps hitting SonarCloud. ✅ unchanged
  • Migrated (caller passes TAILSCALE_AUTHKEY + maps SONAR_TOKEN: secrets.SONARQUBE_TOKEN, build.gradle.kts → self-hosted) → runner joins the tailnet, scans self-hosted.

So this PR is safe to merge first, and each Kotlin service then migrates independently in its own PR (build.gradle.kts host + caller secret mapping). No coordinated big-bang merge required.

Reference

Pattern: monta-app/server#23360.

🤖 Generated with Claude Code

tobias0106 and others added 2 commits May 29, 2026 10:39
… [NOJIRA]

Repoint the reusable Kotlin Sonar workflows at the self-hosted SonarQube
(https://sonarqube.vpn.internal.monta.app, behind the Monta VPN):

- sonar-cloud.yml + pull-request-kotlin.yml: add a Tailscale step before the
  gradle `sonar` step so the self-hosted runner can reach the VPN-internal
  instance, and declare TAILSCALE_AUTHKEY as a required secret (matching the
  existing code-coverage-kotlin.yml convention).
- Rename display strings SonarCloud -> SonarQube. The `sonar.host.url` and the
  SONARQUBE_TOKEN value are supplied per-service (build.gradle.kts + caller
  secrets mapping), so no host URL is hardcoded here.

Part of the full SonarCloud -> self-hosted SonarQube migration
(#project-migrate-to-sonarqube). Pattern follows monta-app/server#23360.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Make TAILSCALE_AUTHKEY an optional secret and guard the Tailscale step on
its presence (env.TAILSCALE_AUTHKEY != ''). This lets Kotlin repos migrate
to the self-hosted SonarQube independently:
- repo not yet migrated (no TAILSCALE_AUTHKEY, build.gradle.kts still on
  sonarcloud.io) -> Tailscale step skipped, scan keeps hitting SonarCloud.
- repo migrated (passes TAILSCALE_AUTHKEY + SONARQUBE_TOKEN, build.gradle.kts
  -> self-hosted) -> runner joins the tailnet and scans the self-hosted server.

Avoids a flag day where merging this PR would break every caller pinned @main
until each caller PR lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant