You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a short backoff delay before the single SonarCloud scan retry so a transient analysis-endpoint blip has time to clear, reducing the residual hard-failure rate (20%, 1/5 runs; 0 cancelled β the #445 concurrency fix already eliminated cancellations).
Root Cause
The primary scan is continue-on-error: true with a retry guarded on steps.sonar.outcome == 'failure', but the retry runs immediately. A transient endpoint blip lasting more than a second or two fails both the primary and the back-to-back retry, so the job fails outright. There is no backoff between the two attempts.
Implementation Checklist
.github/workflows/sonarcloud.yml β add a "Back off before retry" run: sleep step between the primary scan and the retry, guarded on steps.sonar.outcome == 'failure'; update the header conventions comment to mention the backoff.
scripts/test-sonarcloud-workflow.sh β add a check asserting a backoff step (run: sleep) guarded on the primary scan's failure exists and precedes the retry step.
Tests to Write
scripts/test-sonarcloud-workflow.test.sh β new fixtures/cases: the real workflow (with backoff) is accepted; a scan pair with a retry but no backoff step is rejected; update the shared "good" fixture to include the backoff.
Test Command
bash scripts/test-sonarcloud-workflow.test.sh and bash scripts/test-sonarcloud-workflow.sh (plus .dev-lead/scripts/dev-lead-lint.sh and npm test for the full suite)
Root-caused the residual 20% (1/5) hard-failure rate: with the [Fleet Monitor] petry-projects/TalkTerm β .github/workflows/sonarcloud.ymlΒ #445 concurrency fix in place (0 cancelled runs), the remaining failures come from the retry firing immediately after the primary scan β a transient SonarCloud endpoint blip lasting more than a moment fails both attempts back-to-back.
.github/workflows/sonarcloud.yml β added a Back off before retry step (run: sleep 30) between the primary scan and the retry, guarded on steps.sonar.outcome == 'failure' so it only costs wall-clock on the rare retry path; updated the header conventions comment.
scripts/test-sonarcloud-workflow.sh β added Check 6 asserting a backoff step (run: sleep) guarded on the primary scan's failure exists and precedes the retry.
scripts/test-sonarcloud-workflow.test.sh β added the backoff to the shared "good" fixture and two new rejection cases (no backoff; backoff-after-retry); added a backoff to the unpinned / no-retry / wrong-retry-id fixtures so each still isolates its own target invariant.
TDD
Test-first: added Check 6 + fixtures, confirmed the real workflow was rejected (red), then added the backoff step to turn it green.
Test Results
=== guard on real workflow ===
All checks passed.
=== test file ===
ok - the checked-in .github/workflows/sonarcloud.yml is accepted
ok - continue-on-error primary scan + failure-guarded retry is accepted
ok - scan step without continue-on-error is rejected
ok - workflow without a failure-guarded retry step is rejected
ok - workflow with a tag-pinned action is rejected
ok - a missing workflow file is rejected
ok - retry condition referencing an unrelated step ID is rejected
ok - a per-ref-only concurrency group (no github.sha) is rejected
ok - a concurrency group with github.sha_suffix (not github.sha) is rejected
ok - a concurrency group with sonar-github.sha (not github.sha expression) is rejected
ok - a failure-guarded retry with no preceding backoff step is rejected
ok - a backoff step placed after the retry is rejected
All tests passed.
=== dev-lead-lint.sh === all checks passed (shellcheck + CODEOWNERS)
=== all ci.yml workflow regression guards === ok (5 guards + the test harness)
Files Changed
.github/workflows/sonarcloud.yml: new Back off before retry step (sleep 30) between the primary scan and retry, both guarded on steps.sonar.outcome == 'failure'; header comment documents the backoff.
scripts/test-sonarcloud-workflow.sh: Check 6 locks the backoff-before-retry invariant (exists, failure-guarded, and ordered before the retry).
scripts/test-sonarcloud-workflow.test.sh: updated fixtures + two new rejection cases for the backoff invariant.
Notes
The single-retry convention is preserved (still one retry) β only a backoff delay was added ahead of it, consistent with the workflow's header conventions and the --retry-delay pattern already used in ci.yml.
Check 6 works around a mikefarah-yq quirk (((x)|test) and ((y)|test) collapses to false) by chaining select filters via map(...)|length > 0; ordering is compared in bash.
This repo checkout contains the CI/fleet infrastructure (no package.json/src/), so the applicable "full test suite" is the shell-based workflow regression guards β all green.
Activity
don-petry commentedon Aug 21, 2026
Dev-Lead Implementation Plan
Issue: #447 β [Fleet Monitor] petry-projects/TalkTerm β .github/workflows/sonarcloud.yml
Scope
Add a short backoff delay before the single SonarCloud scan retry so a transient analysis-endpoint blip has time to clear, reducing the residual hard-failure rate (20%, 1/5 runs; 0 cancelled β the #445 concurrency fix already eliminated cancellations).
Root Cause
The primary scan is
continue-on-error: truewith a retry guarded onsteps.sonar.outcome == 'failure', but the retry runs immediately. A transient endpoint blip lasting more than a second or two fails both the primary and the back-to-back retry, so the job fails outright. There is no backoff between the two attempts.Implementation Checklist
.github/workflows/sonarcloud.ymlβ add a "Back off before retry"run: sleepstep between the primary scan and the retry, guarded onsteps.sonar.outcome == 'failure'; update the header conventions comment to mention the backoff.scripts/test-sonarcloud-workflow.shβ add a check asserting a backoff step (run: sleep) guarded on the primary scan's failure exists and precedes the retry step.Tests to Write
scripts/test-sonarcloud-workflow.test.shβ new fixtures/cases: the real workflow (with backoff) is accepted; a scan pair with a retry but no backoff step is rejected; update the shared "good" fixture to include the backoff.Test Command
bash scripts/test-sonarcloud-workflow.test.shandbash scripts/test-sonarcloud-workflow.sh(plus.dev-lead/scripts/dev-lead-lint.shandnpm testfor the full suite)don-petry commentedon Aug 21, 2026
Dev-Lead: Implementation Complete
Plan Execution
.github/workflows/sonarcloud.ymlβ added aBack off before retrystep (run: sleep 30) between the primary scan and the retry, guarded onsteps.sonar.outcome == 'failure'so it only costs wall-clock on the rare retry path; updated the header conventions comment.scripts/test-sonarcloud-workflow.shβ added Check 6 asserting a backoff step (run: sleep) guarded on the primary scan's failure exists and precedes the retry.scripts/test-sonarcloud-workflow.test.shβ added the backoff to the shared "good" fixture and two new rejection cases (no backoff; backoff-after-retry); added a backoff to the unpinned / no-retry / wrong-retry-id fixtures so each still isolates its own target invariant.TDD
Test-first: added Check 6 + fixtures, confirmed the real workflow was rejected (red), then added the backoff step to turn it green.
Test Results
Files Changed
.github/workflows/sonarcloud.yml: newBack off before retrystep (sleep 30) between the primary scan and retry, both guarded onsteps.sonar.outcome == 'failure'; header comment documents the backoff.scripts/test-sonarcloud-workflow.sh: Check 6 locks the backoff-before-retry invariant (exists, failure-guarded, and ordered before the retry).scripts/test-sonarcloud-workflow.test.sh: updated fixtures + two new rejection cases for the backoff invariant.Notes
--retry-delaypattern already used inci.yml.((x)|test) and ((y)|test)collapses to false) by chainingselectfilters viamap(...)|length > 0; ordering is compared in bash.package.json/src/), so the applicable "full test suite" is the shell-based workflow regression guards β all green.feat: implement issue #447 β [Fleet Monitor] petry-projects/TalkTerm β¦
feat: implement issue #447 β [Fleet Monitor] petry-projects/TalkTerm β¦
feat: implement issue #447 β [Fleet Monitor] petry-projects/TalkTerm β¦
feat: implement issue #447 β [Fleet Monitor] petry-projects/TalkTerm β¦