Skip to content

feat: implement issue #747 — [Fleet Monitor] petry-projects/.github — .github/workflows/canary-rollout.yml - #748

Merged
don-petry merged 7 commits into
mainfrom
dev-lead/issue-747-20260716-0846
Aug 7, 2026
Merged

feat: implement issue #747 — [Fleet Monitor] petry-projects/.github — .github/workflows/canary-rollout.yml#748
don-petry merged 7 commits into
mainfrom
dev-lead/issue-747-20260716-0846

Conversation

@don-petry

@don-petry don-petry commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

User description

Closes #747

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • Bug Fixes

    • Canary rollouts now handle tiers without the requested workflow gracefully.
    • Missing workflows return an empty result instead of triggering retries or failures.
    • Improved cleanup during successful, early-exit, and failed rollout checks.
  • Tests

    • Added coverage confirming missing workflows complete successfully without retries or error messages.

CodeAnt-AI Description

Treat missing workflows as empty results during canary rollouts

What Changed

  • Tier repositories that have never run the requested workflow now complete successfully with an empty result
  • Missing workflows are handled immediately without retries or failure messages
  • Genuine workflow fetch failures continue to fail the rollout check
  • Added tests covering empty results, skipped retries, and preserved failure handling

Impact

✅ Fewer failed canary fleet sweeps
✅ No unnecessary retries for missing workflows
✅ Clearer handling of genuine fetch failures

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@don-petry
don-petry requested a review from a team as a code owner July 16, 2026 08:56
Copilot AI review requested due to automatic review settings July 16, 2026 08:56
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cbf06b01-e750-43ac-abad-28c8c4379fe0

📥 Commits

Reviewing files that changed from the base of the PR and between 89f6ebf and 1c257fb.

📒 Files selected for processing (2)
  • standards/canary-rings.json
  • tests/canary_rollout.bats
📝 Walkthrough

Walkthrough

The canary rollout helper now captures gh run list errors, treats missing workflows as successful empty results, and cleans up temporary files across exit paths. Bats coverage verifies the empty result, success status, and absence of retries.

Changes

Canary workflow handling

Layer / File(s) Summary
Handle missing workflows and validate behavior
scripts/canary-rollout.sh, tests/canary_rollout.bats
_run_json captures stderr, returns [] without retrying when the workflow is absent, removes temporary files on exit paths, and includes tests for the resulting status and invocation count.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The script and tests address the workflow-list failure case tied to issue #747 and its canary rollout instability.
Out of Scope Changes check ✅ Passed The changes stay focused on the canary rollout helper and tests, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the implementation of issue #747 for the canary rollout workflow, which matches the main changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-747-20260716-0846

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the _run_json function in scripts/canary-rollout.sh to prevent fail-closed errors when a workflow has never been run on a repository. It captures gh command errors in a temporary file and returns an empty array if the workflow is not found, with corresponding tests added in tests/canary_rollout.bats. The review feedback recommends using an EXIT trap to ensure the temporary file is reliably cleaned up, rather than relying on manual deletion at multiple exit points.

Comment thread scripts/canary-rollout.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #747 by updating the canary rollout orchestration script’s _run_json behavior so tier repositories that don’t have a given workflow are treated as a legitimate “no data” case ([]) rather than a transient outage that triggers retries and ultimately fails the fleet sweep.

Changes:

  • Update _run_json to capture gh run list stderr and treat “could not find any workflows named …” as an immediate [] return (no retries, no fail-closed).
  • Add Bats coverage for the “workflow not present” case, including ensuring it returns immediately without retrying.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/canary_rollout.bats Adds regression tests for _run_json when a workflow is not present in a tier repo (#747).
scripts/canary-rollout.sh Adjusts _run_json to detect “workflow not present” via captured stderr and return [] instead of retry/fail-closed.

Comment thread scripts/canary-rollout.sh Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/canary-rollout.sh (1)

339-344: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Preserve and log the underlying error message.

By redirecting gh's stderr to the temporary file $errf, the actual error messages (e.g., "API rate limit exceeded", "HTTP 502", "repository not found") are now swallowed and never shown in the workflow logs for genuine failures. This will make it very difficult to debug why a rollout failed.

Please output the contents of $errf before removing it, both on the final failure and during retries, so the root cause remains observable.

🛠️ Proposed fix to log the original error
     if [ "$attempt" -ge "$attempts" ]; then
+      cat "$errf" >&2
       rm -f "$errf"
       echo "::error::_run_json: failed to fetch run list for $repo (workflow=$wf) after $attempts attempt(s)" >&2
       return 1
     fi
+    cat "$errf" >&2
     echo "::warning::_run_json: transient failure fetching run list for $repo (workflow=$wf), attempt $attempt/$attempts — retrying in ${delay}s" >&2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/canary-rollout.sh` around lines 339 - 344, Update the _run_json
failure handling to output the contents of $errf before removing it on both the
final failure path and each retry path. Preserve the existing error and warning
messages while ensuring the captured gh stderr, including the underlying API or
repository error, remains visible in workflow logs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@scripts/canary-rollout.sh`:
- Around line 339-344: Update the _run_json failure handling to output the
contents of $errf before removing it on both the final failure path and each
retry path. Preserve the existing error and warning messages while ensuring the
captured gh stderr, including the underlying API or repository error, remains
visible in workflow logs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: deb88725-646a-4f63-acde-0db2a1add666

📥 Commits

Reviewing files that changed from the base of the PR and between 9002c28 and 0687e5e.

📒 Files selected for processing (2)
  • scripts/canary-rollout.sh
  • tests/canary_rollout.bats

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 16, 2026
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #748
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-07-16T09:34:20Z

@don-petry

Copy link
Copy Markdown
Contributor Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-07-16T09:34:20Z

@don-petry
don-petry enabled auto-merge (squash) July 16, 2026 09:04
@don-petry
don-petry disabled auto-merge July 16, 2026 10:21
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 16, 2026
@don-petry
don-petry disabled auto-merge July 16, 2026 10:31
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) August 3, 2026 03:07
donpetry-bot
donpetry-bot previously approved these changes Aug 3, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: 50935ea21a3149cd5a9b9547e6df0c266d3d7f15
Review mode: triage-approved (single reviewer)

Summary

Test-only PR (+37 lines in tests/canary_rollout.bats) adding two regression tests for the #747 fix: _run_json must treat a tier repo that has never run the requested workflow ('could not find any workflows named …') as a legitimate empty result ([]) — immediately, without retries, and without failing the fleet sweep closed. The production fix already exists on main in scripts/canary-rollout.sh (_repo_wf_runs_cached classifies that error as permanent, caches [], and never retries); these tests lock in that behavior. Triage's low-risk assessment is confirmed.

Linked issue analysis

Issue #747 (Fleet Monitor, CRITICAL): canary-rollout.yml at 69.2% failure rate, driven by retry storms when tier repos lacked the requested workflow — each miss exhausted 6 retries with backoff, blowing sweeps out to ~20 min and getting jobs cancelled. The root fix (classify missing-workflow as empty result, no retry) is on main; this PR adds the regression coverage that pins it. Substantively addresses the issue; the tests assert both the [] result (status 0) and the single-call/no-retry behavior, while genuine fetch errors still fail closed per the adjacent existing test.

Findings

No blocking findings. Verified test correctness against the implementation on main: the stub gh emits the exact stderr string the classifier matches (case-insensitive 'could not find any workflow'), _run_json passes the empty result through jq to output [] with exit 0, and the call-log test correctly proves exactly one gh invocation with no retry warnings. Tests follow the established stub/source pattern used by neighboring tests in the same file. Secret-scanning MCP tool unavailable in this environment — relied on the green gitleaks check; diff contains only test stub content, nothing secret-like.

CI status

All quality and security checks green for 50935ea: Lint, Lint and bats, ShellCheck, CodeQL, Analyze (actions), Secret scan (gitleaks), Agent Security Scan, AgentShield, SonarCloud (quality gate passed), npm audit. The CANCELLED 'dev-lead / dispatch' and 'dev-lead / ci-relay' entries are the automation bot's own superseded runs — each has a later SUCCESS/SKIPPED rerun of the same check. mergeStateStatus BLOCKED only pending this automated review.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@donpetry-bot
donpetry-bot dismissed their stale review August 3, 2026 03:11

Superseded by automated re-review at 50935ea.

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: 50935ea21a3149cd5a9b9547e6df0c266d3d7f15
Review mode: triage-approved (single reviewer)

Summary

Test-only PR (+37/-0 in tests/canary_rollout.bats) adding two regression tests for _run_json's workflow-not-present handling (#747): (1) a tier repo whose 'gh run list --workflow' fails with 'could not find any workflows named …' returns [] with exit 0 instead of failing closed, and (2) that path returns immediately without consuming retries. The behavior fix itself already landed on main in scripts/canary-rollout.sh (the missing-workflow message is classified as a permanent condition returning [], with only genuine transport errors retried/fail-closed), so after rebase this PR correctly carries only the regression coverage — confirmed by the green 'Lint and bats' check running these tests against main's script.

Linked issue analysis

Closes #747 — a Fleet Monitor CRITICAL alert for canary-rollout.yml (69.2% failure rate, 9/13 runs). Root cause was a retry storm: repos that never ran a given workflow caused non-zero 'gh run list' exits that were retried with backoff and then failed the whole fleet sweep. The fix on main plus these regression tests substantively address the alert; the issue is closed.

Findings

No blocking findings. The triage assessment (low-risk) is confirmed.

  • Diff is test-only; stubs follow the file's existing pattern (mktemp -d stub dir prepended to PATH, CANARY_GH_RETRY_SLEEP=0). No production code touched.
  • Both inline review threads (gemini-code-assist, Copilot) are resolved and outdated — they referenced earlier revisions that modified scripts/canary-rollout.sh.
  • No unanswered human-reviewer questions; latest cascade review at this same SHA already approved.
  • Secret scanning MCP tool not available in this environment; gitleaks CI check passed and the diff contains only test stub content — no secrets.

CI status

All validation checks green: Lint, Lint and bats, ShellCheck, CodeQL (actions), Secret scan (gitleaks), SonarCloud (quality gate passed), Agent Security Scan, agent-shield, npm audit, pr-auto-review dispatches. CANCELLED entries ('dev-lead / dispatch', 'dev-lead / ci-relay') are superseded agent-orchestration runs with later SUCCESS/SKIPPED entries, not code-quality gates. Mergeable: MERGEABLE.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@donpetry-bot
donpetry-bot dismissed their stale review August 3, 2026 03:15

Superseded by automated re-review at 50935ea.

@don-petry
don-petry disabled auto-merge August 3, 2026 03:54
@don-petry
don-petry enabled auto-merge (squash) August 3, 2026 03:54
@don-petry
don-petry disabled auto-merge August 3, 2026 07:47
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) August 3, 2026 07:48
@codeant-ai

codeant-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:M This PR changes 30-99 lines, ignoring generated files and removed size:M This PR changes 30-99 lines, ignoring generated files labels Aug 6, 2026
@don-petry
don-petry disabled auto-merge August 6, 2026 23:45
@don-petry
don-petry enabled auto-merge (squash) August 6, 2026 23:53
@don-petry
don-petry disabled auto-merge August 6, 2026 23:54
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 6, 2026 23:57
@don-petry
don-petry disabled auto-merge August 6, 2026 23:58
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) August 6, 2026 23:58
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge August 7, 2026 00:00
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
- ✅ 0 Accepted issues
- ✅ 0 Security Hotspots
- ✅ 0.0% Duplication on New Code
**Review thread status:**
- Two historical threads (gemini-code-assist, copilot-pull-request-reviewer) are already marked **resolved** and **outdated** — they addressed earlier revisions and are no longer actionable
- Latest approval from donpetry-bot (2026-08-03): **APPROVED** with LOW risk assessment
**CI status:**
- All quality checks passing (Lint, ShellCheck, SonarCloud, Secret Scan, CodeQL, Agent Security Scan, etc.)
- No Tier 1 blockers
**Conclusion:** No actionable issues identified. The PR is clean and ready for merge per all bot analyses.

@don-petry
don-petry merged commit 4ec5d9b into main Aug 7, 2026
23 checks passed
@don-petry
don-petry deleted the dev-lead/issue-747-20260716-0846 branch August 7, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet Monitor] petry-projects/.github — .github/workflows/canary-rollout.yml

3 participants