Skip to content

chore: skip SonarQube scan when Tailscale bring-up fails [CPONETOPS-1078] - #321

Merged
mtib merged 2 commits into
mainfrom
chore/CPONETOPS-1078/skip-sonar-when-tailscale-fails
Jul 16, 2026
Merged

chore: skip SonarQube scan when Tailscale bring-up fails [CPONETOPS-1078]#321
mtib merged 2 commits into
mainfrom
chore/CPONETOPS-1078/skip-sonar-when-tailscale-fails

Conversation

@mtib

@mtib mtib commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What

Follow-up to #320. Gate the SonarQube step on the Tailscale step's outcome so a failed VPN bring-up skips the scan instead of running it against a dead VPN.

Why

#320 made the Tailscale step continue-on-error, which stops it from failing the job. But the Sonar step then still ran, failed ~30s later against the unreachable VPN, and logged a confusing error. The job passed, but noisily. Cleaner to skip the scan when the VPN never came up.

Example that motivated this — the Tailscale step failed (Tailscale package CDN 504) and the whole job went red: https://github.com/monta-app/service-alerts/actions/runs/29481319142/job/87588587751?pr=60

Change

  • Give the Tailscale step id: tailscale.
  • Gate the Sonar step with if: steps.tailscale.outcome != 'failure'.

!= 'failure' (rather than == 'success') is deliberate: when no TAILSCALE_AUTHKEY is passed the Tailscale step is skipped (outcome skipped), and those repos are still on SonarCloud — they must keep scanning. Only a genuine failed bring-up (failure) skips the scan.

Applied to both pull-request-kotlin.yml and sonar-cloud.yml.

Behaviour matrix (test job)

authkey VPN sonar-non-blocking Tailscale Sonar Job
unset true (default) skipped runs (SonarCloud) pass
set up true success runs pass
set down true failed→continued skipped pass
set down false failed→job fails skipped fail (hard gate)

Note on re-runs

Re-running an old run (e.g. attempt 5 of a run created before #320 merged) executes the pre-fix workflow — that's why the example above still went red. A fresh run / new commit picks up @main.

Validation

  • actionlint passes clean on both workflows

CPONETOPS-1078

mtib and others added 2 commits July 16, 2026 11:54
…078]

Follow-up to #320. Making the Tailscale step continue-on-error stops it from
failing the job, but the SonarQube step then still ran against a dead VPN,
failing ~30s later and logging a confusing error (job passed, but noisily).

Gate the Sonar step on the Tailscale step's outcome so a failed VPN bring-up
skips the scan entirely instead of running it doomed. Using
`outcome != 'failure'` (rather than `== 'success'`) keeps the SonarCloud path
working when Tailscale is skipped because no TAILSCALE_AUTHKEY is passed.

Applied to both pull-request-kotlin.yml and sonar-cloud.yml. With
sonar-non-blocking: false the Tailscale failure still hard-fails the job (the
scan is a required gate, so an unreachable SonarQube should block).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0134BvmGHE9QM5zwSAzfJJUv
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0134BvmGHE9QM5zwSAzfJJUv
@mtib
mtib requested a review from a team as a code owner July 16, 2026 09:56
@mtib
mtib requested review from prasad-manu and removed request for a team July 16, 2026 09:56
@mtib
mtib merged commit 706cd4b into main Jul 16, 2026
1 check passed
@mtib
mtib deleted the chore/CPONETOPS-1078/skip-sonar-when-tailscale-fails branch July 16, 2026 10:56
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.

2 participants