Skip to content

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

Open
don-petry wants to merge 3 commits into
mainfrom
dev-lead/issue-747-20260716-0846
Open

feat: implement issue #747 — [Fleet Monitor] petry-projects/.github — .github/workflows/canary-rollout.yml#748
don-petry wants to merge 3 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

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.

@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: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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

Run ID: 6a940992-5a53-4d86-82aa-c0c8bfc14f92

📥 Commits

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

📒 Files selected for processing (1)
  • scripts/canary-rollout.sh
📝 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific and matches the canary rollout workflow fix, though it is longer than ideal.
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.
✨ 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
$errf is function-local; the EXIT trap must capture its value at
trap-set time (double-quote expansion) because the variable is out of
scope when EXIT fires after the function returns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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