feat: implement issue #1265 — [Fleet Monitor] petry-projects/.github-private — .github/workflows/readme-refresh.yml - #1266
Conversation
…private — .github/workflows/readme-refresh.yml
|
Warning Review limit reached
Next review available in: 50 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 (3)
✨ 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 |
There was a problem hiding this comment.
Code Review
This pull request refactors the rolling-branch push logic in scripts/aw-readme-refresh.sh by extracting it into a reusable push_branch_with_retry function with configurable retry attempts and sleep intervals. It also introduces comprehensive BATS regression tests to verify recovery from stale-lease rejections when a branch is moved or deleted mid-run. Feedback was provided to replace the external seq command in the retry loop with a native Bash C-style for loop to improve efficiency.
There was a problem hiding this comment.
Pull request overview
This PR addresses Fleet Monitor issue #1265 by hardening the readme-refresh automation against a --force-with-lease push race on the rolling branch (chore/readme-refresh) that can occur when the prior refresh PR auto-merges mid-run.
Changes:
- Refactors the rolling-branch push into a reusable
push_branch_with_retryhelper with configurable retry/sleep knobs. - Adds a Bats regression test that simulates both “branch moved” and “branch deleted” stale-lease scenarios (plus a persistent-failure case).
- Registers the new Bats test in the
lint.ymlBats test list.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scripts/aw-readme-refresh.sh |
Introduces push_branch_with_retry and uses it from process_repo to mitigate stale-lease push failures. |
tests/test_readme_refresh_push.bats |
New regression coverage for the rolling-branch push retry behavior under realistic git-race scenarios. |
.github/workflows/lint.yml |
Adds the new Bats test to the workflow’s Bats suite. |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-07-15T10:05:34Z. |
Dev-Lead — fix-reviews (applied)Changes committed and pushed. |
|
Dev-Lead — waiting on PR blockers (intent: fix-reviews)PR: #1266 |
Dev-Lead — fix-reviews (no-changes)Agent reasoning |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 05259c59c3de9d33aac0c6ab1a2c141a2e019e6f
Review mode: triage-approved (single reviewer)
Summary
Hardens the readme-refresh rolling-branch push against the #1265 stale-lease race by extracting the existing inline retry loop into a reusable push_branch_with_retry helper with configurable attempt/sleep knobs, and adds a new Bats regression suite (registered in lint.yml) covering branch-moved, branch-deleted, and persistent-failure scenarios. The triage low-risk assessment is confirmed: no new permissions, secrets, or push semantics — the force-with-lease + fetch --prune retry behavior already existed in main; this PR makes it testable and tested.
Linked issue analysis
Issue #1265 is a Fleet Monitor DEGRADED report for .github/workflows/readme-refresh.yml (25% failure rate, 1/4 runs). The failing mode is a --force-with-lease stale-lease rejection when the prior refresh PR auto-merges mid-run. This PR substantively addresses it by making the retry/recovery path configurable and adding regression tests that reproduce both the branch-moved and branch-deleted races plus the persistent-failure exit path. Coverage now guards against regressions of the recovery behavior.
Findings
- No security-sensitive changes: no auth/secrets/credentials touched; lint.yml change is a one-line Bats test registration only.
- Function extraction is faithful to the removed inline loop, with one minor improvement: no sleep after the final attempt.
- Both prior review threads (gemini-code-assist and Copilot, each suggesting a C-style for loop over external seq) are resolved — the fix was applied in the head commit (05259c5).
- CodeRabbit APPROVED at the head SHA; SonarCloud quality gate passed (0 new issues, 0 security hotspots).
- Test suite is well-constructed: exercises real git remotes (bare repo) rather than mocks, asserts the retry path was actually taken, and verifies final remote content.
- Secret scan: mcp run_secret_scanning tool not available in this run; gitleaks CI check passed (SUCCESS).
CI status
All checks green at head commit 05259c5: Lint, ShellCheck, bats (including the new suite), unit-tests, CodeQL (actions + python), SonarCloud, gitleaks secret scan, AgentShield, Agent Security Scan, holdout-guard, and AW workflow validation all SUCCESS. A few CANCELLED runs (dev-lead/dispatch, review/review, dev-lead/ci-relay) were superseded by later SUCCESS/SKIPPED runs of the same checks. mergeable=MERGEABLE.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.



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