ci: retry SonarCloud scan once on transient failure#21604
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the SonarCloud GitHub Actions workflow to reduce merge-queue false positives caused by transient external download/service failures during the Sonar scan.
Changes:
- Runs the first SonarCloud scan attempt with
continue-on-error: trueand captures its outcome via a stepid. - If the first attempt fails, waits 90 seconds and retries the SonarCloud scan once.
- Keeps existing behavior for persistent failures (the job still fails if the retry fails) and leaves cache-warming-only runs unaffected.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
taratorio
approved these changes
Jun 3, 2026
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.
Problem
Two merge-queue evictions in the last 3 weeks were caused by the SonarCloud scan failing to download the scanner CLI from
binaries.sonarsource.com— not by anything in the queued code:Unexpected HTTP response: 403(the action does not retry 4xx) — evicted p2p/sentry: don't duplicate SendMessageById across shared-store sentries #21597 from the queue with all sibling jobs green or still runningIn the merge queue the sonar job fast-cancels the whole CI Gate run on failure, so a CDN blip cancels ~40 min of green sibling jobs and
github-merge-queueremoves the PR withfailed_checks. Per CI-GUIDELINES.md, merge-queue checks must have no false positives; CDN weather is one.Fix
Give the scan one spaced retry:
continue-on-error: truecache-warming-onlyruns are unaffected (scan skipped → outcome isskipped, so the retry steps skip too). Acontinue-on-errorstep reportsconclusion: successto the jobs API, so ci-gate's root-cause detection won't flag a run recovered by the retry; a double failure is attributed toSonarCloud scan (retry).Alternatives considered
tc.find()lookup can never match SonarSource's 4-segment version string (semver.clean("8.1.0.6389")isnull), so the action's internal tool-cache path is dead code on any runner.scannerBinariesUrl: removes the CDN dependency entirely but adds hosting and per-upgrade maintenance, and the GPG keyserver dependency remains. Can revisit if 403s persist despite the retry.No tests: CI workflow YAML change (TDD not applicable); validated with
actionlintandmake lint.