Skip to content

[Fleet Monitor] petry-projects/TalkTerm β€” .github/workflows/sonarcloud.ymlΒ #447

Closed

Description

@don-petry

🟑 WARNING: petry-projects/TalkTerm / .github/workflows/sonarcloud.yml

Metric Value
Failure Rate 20% (1 / 5 runs)
Status WARNING
p50 Duration 44s
p95 Duration 44s
Successful Runs 4
Cancelled Runs 0

Workflow: .github/workflows/sonarcloud.yml

Last updated by Fleet Monitor run on 2026-08-21.
Threshold: failure rate > 10% over the monitored window.

Activity

  1. added
    dev-leadFor dev-lead agent pickup
    fleet-trackerTracked by the Actions Fleet Monitor
    health-checkAutomated health check result
    on Aug 21, 2026
  2. don-petry commented on Aug 21, 2026

    @don-petry
    ContributorAuthor

    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: 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)

  3. don-petry commented on Aug 21, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    • 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.
  4. added a commit that references this issue on Aug 21, 2026
  5. added 3 commits that reference this issue on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickupfleet-trackerTracked by the Actions Fleet Monitorhealth-checkAutomated health check result

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions