feat: implement issue #738 — [Fleet Monitor] petry-projects/.github — .github/workflows/canary-rollout.yml#741
Conversation
… .github/workflows/canary-rollout.yml
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
There was a problem hiding this comment.
Code Review
This pull request introduces retry logic with exponential backoff to the _run_json function in scripts/canary-rollout.sh to handle transient failures when fetching GitHub run lists, while ensuring sustained failures still fail closed. It also adds corresponding BATS tests to verify this behavior. The review feedback suggests validating the integer inputs for retries and delay to prevent syntax errors, and capping the maximum backoff delay to avoid excessive wait times during sustained outages.
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #738 by making the canary rollout engine more resilient to transient gh run list failures during the scheduled fleet sweep, while preserving the “fail closed” behavior on sustained outages so promotions can’t be incorrectly green-lit.
Changes:
- Added bounded retry with exponential backoff around
gh run listcalls in_run_jsonto reduce fleet-sweep failures from transient GitHub/network hiccups. - Added Bats coverage to verify
_run_jsonretries transient failures and still fails closed when all attempts fail.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
scripts/canary-rollout.sh |
Adds bounded retry/backoff for gh run list while preserving fail-closed semantics on sustained failures. |
tests/canary_rollout.bats |
Adds regression tests covering transient retry success and sustained failure behavior for _run_json. |
Dev-Lead — fix-reviews (applied)Changes committed and pushed. |
Superseded by automated re-review at
|
Dev-Lead — review-changes (applied)Changes committed and pushed. |
|
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 71f6a142c5fc86257c1f1f36f3dc67d09bd70bca
Review mode: triage-approved (single reviewer)
Summary
Adds bounded retry with exponential backoff (capped at 30s) around gh run list in _run_json so a single transient failure no longer aborts the whole 4h fleet sweep, while sustained failures still exhaust retries and fail closed. The prior review's sole blocking finding — a dev-lead reply falsely claiming the explicit-if guard and empty/wildcard-repo tests had been applied — is now genuinely resolved at head 71f6a14: the guard is an explicit if-statement and both tests exist in tests/canary_rollout.bats. All 4 review threads are resolved, all CI checks are green, and no new issues were introduced by the delta since the prior review (a merge of main plus the review-changes commit).
Linked issue analysis
Linked issue #738 (Fleet Monitor WARNING: canary-rollout.yml failure rate 16.7%, 1/6 runs). Root cause was transient gh run list errors failing the entire scheduled sweep under set -euo pipefail. The retry-with-backoff in _run_json directly and substantively addresses this; the fail-closed guarantee (empty [] never masks a real outage) is explicitly preserved and regression-tested with 9 new bats tests.
Findings
- Resolved (prior blocking finding) — the unresolved Copilot thread with a false "fix applied" claim: head commit 71f6a14 actually applied the explicit
if [ -z "$repo" ] || [ "$repo" = '*' ]; then echo '[]'; return 0; figuard and added the two promised bats tests (empty-repo and wildcard-repo paths, both asserting gh is never called). The thread is now marked resolved and the reply matches the code. - Verified resolved — gemini's integer-validation comment: case-based sanitization of CANARY_GH_RETRIES / CANARY_GH_RETRY_SLEEP present with 4 covering tests. Thread resolved.
- Verified resolved — gemini's backoff-cap comment:
[ "$delay" -gt 30 ] && delay=30present with a covering test stubbing sleep. Thread resolved. - Delta since prior review (f5bf7f3...71f6a14) contains only a merge of main (PR #744, _gh_move_tag fix — unrelated, already reviewed on main) and the review-changes commit; no new issues introduced.
- Secret scan: run_secret_scanning MCP tool not available in this run; gitleaks CI check passed. No secrets, credentials, or injection patterns in the diff; retry-loop variables are quoted and validated.
CI status
All substantive checks green at head 71f6a14: Lint, ShellCheck, Secret scan (gitleaks), Agent Security Scan, Canary-rollout Tests (lint+bats), CodeQL, SonarCloud (Quality Gate passed, 0 new issues, 0 hotspots), npm audit, AgentShield, CodeRabbit. CANCELLED entries are the dev-lead agent's own superseded dispatch/ci-relay jobs; SKIPPED entries are non-applicable ecosystem audits.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.



Closes #738
Implemented by dev-lead agent. Please review.