ci: replace SonarCloud quality-gate single-shot poll with bounded retry#30992
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
Pull request overview
Updates the SonarCloud quality gate status check in the CI workflow to avoid flaky failures caused by SonarCloud ingestion lag (especially on cherry-pick branches), by polling for a bounded amount of time instead of using a fixed sleep plus single request.
Changes:
- Removes the fixed
sleep 30and replaces the single SonarCloud API call with a bounded retry loop (up to 12 attempts with 15s intervals). - Exits immediately on
OK(pass) orERROR(fail), and fails the job if no settled status is observed by the retry limit.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
18ae440 to
00e6d66
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No E2E tests need to run to validate this change. The change is self-contained within CI infrastructure and its correctness is validated by the CI pipeline itself running successfully. Performance Test Selection: |
Description
The
sonar-cloud-quality-gate-statusjob inci.ymlpolled SonarCloud with a fixedsleep 30then a singlecurltoqualitygates/project_status. On cherry-pick branches SonarCloud frequently has not finished ingesting the analysis by the 30 s mark, so the API returnsNONE/empty status and the job exits 1 — turning the requiredCheck all jobs passgate red for a timing reason entirely unrelated to code quality.Root cause verified from INFRA-3671 analysis: PR 30969 (SHA
e86a4f4) shows run26844267240quality-gate = failure with analysis green, and same-SHA run26844272597= success on re-run. This pattern appeared across ~20 of 48 gate-fail PRs in a 100-PR Runway cherry-pick sample (2026-03-04 → 2026-06-03), making SonarCloud the single largest driver of blocked auto-merges.Fix: replace the single shot with a bounded retry loop — up to 12 attempts × 15 s = ≤3 min total.
OK/ERRORexit immediately; any other status (ingestion still in progress) retries. After all attempts exhausted, the job fails (we do not pass-with-warning on Sonar unavailability).Changelog
CHANGELOG entry: null
Related issues
Fixes: INFRA-3671 (WI-1 — SonarCloud quality-gate poll race)
Manual testing steps
CI verification: observe the next Runway cherry-pick PR — the
sonar-cloud-quality-gate-statusjob log should showattempt 1/12(or similar) and succeed without a second run.Screenshots/Recordings
Before
sonar-cloud-quality-gate-statusexits 1 on first run ("Could not determine Quality Gate status"), requires manual re-run to turn green.After
Job polls up to 12 × 15 s, succeeds as soon as SonarCloud ingestion completes.
Pre-merge author checklist
actionlintand a YAML parse + structure assertion test)Pre-merge reviewer checklist