Skip to content

feat: implement issue #1265 — [Fleet Monitor] petry-projects/.github-private — .github/workflows/readme-refresh.yml - #1266

Merged
don-petry merged 2 commits into
mainfrom
dev-lead/issue-1265-20260715-0854
Jul 15, 2026
Merged

feat: implement issue #1265 — [Fleet Monitor] petry-projects/.github-private — .github/workflows/readme-refresh.yml#1266
don-petry merged 2 commits into
mainfrom
dev-lead/issue-1265-20260715-0854

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Closes #1265

Implemented by dev-lead agent. Please review.

…private — .github/workflows/readme-refresh.yml
Copilot AI review requested due to automatic review settings July 15, 2026 09:03
@don-petry
don-petry requested a review from a team as a code owner July 15, 2026 09:03
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 50 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: 68bc102f-595d-4121-9efc-c691fe873efc

📥 Commits

Reviewing files that changed from the base of the PR and between 1c35d04 and 05259c5.

📒 Files selected for processing (3)
  • .github/workflows/lint.yml
  • scripts/aw-readme-refresh.sh
  • tests/test_readme_refresh_push.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-1265-20260715-0854

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

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 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.

Comment thread scripts/aw-readme-refresh.sh Outdated
@don-petry
don-petry enabled auto-merge (squash) July 15, 2026 09:04
@don-petry
don-petry disabled auto-merge July 15, 2026 09:05

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 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_retry helper 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.yml Bats 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.

Comment thread scripts/aw-readme-refresh.sh Outdated
@donpetry-bot

Copy link
Copy Markdown
Contributor

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.

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

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry
don-petry disabled auto-merge July 15, 2026 09:09
@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: fix-reviews)

PR: #1266
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-15T09:40:40Z

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

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (no-changes)

Agent reasoning
Addressed 0 threads:
  (none — open thread list is empty)
CI blockers: none (all checks success or skipped)
CHANGES_REQUESTED: none
Test verification: pass — no code changes made; full CI suite already green
Files changed: none
```

@don-petry
don-petry enabled auto-merge (squash) July 15, 2026 10:16

@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: 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.

@don-petry
don-petry merged commit 70e17b7 into main Jul 15, 2026
37 of 40 checks passed
@don-petry
don-petry deleted the dev-lead/issue-1265-20260715-0854 branch July 15, 2026 10:29
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-private — .github/workflows/readme-refresh.yml

3 participants