Skip to content

fix(sonar): tolerate a failed scan without breaking the job [NOJIRA] - #330

Open
Casperhr wants to merge 1 commit into
mainfrom
fix/sonar-continue-on-error
Open

fix(sonar): tolerate a failed scan without breaking the job [NOJIRA]#330
Casperhr wants to merge 1 commit into
mainfrom
fix/sonar-continue-on-error

Conversation

@Casperhr

Copy link
Copy Markdown

What?

Sets continue-on-error: true unconditionally on the two Sonar steps in pull-request-kotlin.yml, and adds a following step that re-raises the failure when sonar-non-blocking is false — preserving the input's meaning without putting an expression in continue-on-error.

Why?

continue-on-error: ${{ inputs.sonar-non-blocking }} is re-evaluated when the step fails, in a context where inputs is not available. It renders '' and the job dies with The template is not valid ... (Line: 256, Col: 28): Unexpected value '' — so sonar-non-blocking did the exact opposite of its name at the only moment it mattered. This was latent until now, since the expression is only re-evaluated on failure; it surfaced because the scanner started failing with okhttp3.internal.http2.StreamResetException while downloading its plugins over the tailnet, which is currently blocking otherwise-green PRs (e.g. monta-app/service-search#260, where tests and coverage pass in full).

Context

Both the tailnet wait step and the upload step carried the same defect, so both are fixed; there are now no expression-valued continue-on-error keys left in the workflow. The underlying SonarQube plugin-download failure is a separate infra issue and still worth chasing — this change only stops it from taking whole jobs down with an unrelated template error.

🤖 Generated with Claude Code

continue-on-error is re-evaluated when its step fails, in a context where
`inputs` is not available. The expression rendered '' and the job died with
"The template is not valid ... Unexpected value ''" instead of tolerating the
failure, so sonar-non-blocking did the opposite of its name the moment Sonar
actually failed. Latent until then, which is why it only surfaced now that the
scanner is hitting StreamResetException pulling its plugins over the tailnet.

Tolerate both Sonar steps unconditionally and re-raise in a following step,
whose `if` does evaluate `inputs`, so sonar-non-blocking: false still blocks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Casperhr
Casperhr requested a review from a team as a code owner August 20, 2026 16:34
@Casperhr
Casperhr requested review from tobias0106 and removed request for a team August 20, 2026 16:34
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