Skip to content

[#803 split 1/2] _run_json: surface real error + exponential jittered backoff #810

Description

@don-petry

Split 1/2 of #803 (dev-lead timed out at the 2100s action budget doing all of #803 at once). This is the small, high-impact half — a single-function change.

Scope — scripts/canary-rollout.sh, _run_json (~L378-403) ONLY

  1. Surface the real error. Capture gh's stderr and include the HTTP status / message in the ::warning:: and final ::error:: lines. Today the retry wrapper prints only "transient failure … after N attempts", hiding whether it's a 403 secondary-rate-limit vs 5xx vs auth. Distinguish these in the output.
  2. Exponential + jittered backoff. Replace the fixed CANARY_GH_RETRY_SLEEP linear retry with exponential backoff + jitter; honor Retry-After / x-ratelimit-reset response headers when present; raise the default attempt count. Keep the CANARY_GH_RETRIES / CANARY_GH_RETRY_SLEEP env overrides working.
  3. Fail closed. A persistent fetch failure must remain a hard error — never a silent empty-but-green gate.

Out of scope (that's #803b)

  • Collapsing per-workflow enumeration to a per-repo fetch.
  • sync-issues resilience.

Acceptance criteria

  • A forced fetch failure prints the real HTTP status/reason, not just "transient".
  • Backoff is exponential+jittered; Retry-After honored; attempts raised.
  • Fails closed (no empty-data gate reported as promotable).
  • Existing canary-rollout bats stay green; add a case asserting _run_json surfaces the real error on failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickup

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions