Skip to content

feat: implement issue #645 — no fix when auto rebase workflow fails - #646

Merged
don-petry merged 2 commits into
mainfrom
dev-lead/issue-645-20260613-1724
Jun 13, 2026
Merged

feat: implement issue #645 — no fix when auto rebase workflow fails#646
don-petry merged 2 commits into
mainfrom
dev-lead/issue-645-20260613-1724

Conversation

@don-petry

@don-petry don-petry commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #645

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • New Features

    • Added automatic retry mechanism for failed auto-rebase jobs, bounded to 3 attempts, to improve workflow resilience and reduce manual intervention.
  • Tests

    • Added comprehensive test coverage for auto-rebase retry behavior across various scenarios.

@don-petry
don-petry requested a review from a team as a code owner June 13, 2026 17:34
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

More reviews will be available in 50 minutes and 30 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 76a7fb4f-bab5-4b8a-8d31-66fee554f3db

📥 Commits

Reviewing files that changed from the base of the PR and between 329a624 and c366c62.

📒 Files selected for processing (2)
  • scripts/auto-rebase-retry.sh
  • tests/dev-lead/unit/test_auto_rebase_retry.bats
📝 Walkthrough

Walkthrough

This PR introduces an automated self-healing system for failed auto-rebase workflow runs. A new GitHub Actions workflow (auto-rebase-retry.yml) monitors failures from the primary auto-rebase workflow and triggers a Bash script to re-run only the failed jobs, bounded by a configurable attempt limit of 3. The script validates inputs, enforces attempt caps, and reports outcomes via GitHub annotations. Comprehensive unit tests cover edge cases including conclusion types, attempt boundaries, missing inputs, dry-run mode, and API failures. Documentation and CI trigger paths are updated accordingly.

Changes

Auto-rebase retry workflow and implementation

Layer / File(s) Summary
Workflow trigger and script invocation
.github/workflows/auto-rebase-retry.yml
The auto-rebase-retry workflow is triggered by workflow_run events from the primary auto-rebase workflow when runs fail, with job concurrency scoped per run id and a maximum of 3 retry attempts. The workflow invokes scripts/auto-rebase-retry.sh with metadata (repo, conclusion, run id, attempt number, workflow name, URL) and rerun-capable permissions.
Auto-rebase retry script implementation
scripts/auto-rebase-retry.sh
Bash handler that re-runs only the failed jobs of a workflow run using gh run rerun --failed. The script reads environment variables, validates inputs (requires CONCLUSION=failure and valid RUN_ID), enforces attempt capping (RUN_ATTEMPT >= MAX_ATTEMPTS blocks retries), supports optional DRY_RUN mode, and reports outcomes via GitHub annotations and step summary. The script consistently exits 0 to avoid failing the Action.
Unit tests for retry behavior
tests/dev-lead/unit/test_auto_rebase_retry.bats
Comprehensive Bats test suite covering script invocation across conclusion types (failure, success, cancelled), attempt boundaries (first attempt, at cap, past cap, last allowed attempt), missing/invalid RUN_ID, non-numeric RUN_ATTEMPT, DRY_RUN mode verification, and gh CLI API failures. Test harness stubs the gh CLI to capture rerun invocations and validates success/no-op behavior.
Documentation and CI integration
AGENTS.md, .github/workflows/test-dev-lead.yml
Template sync exception documented in AGENTS.md for the retry workflow (handler type, self-healing scope, and preservation rules). The test-dev-lead.yml workflow paths are expanded to watch scripts/auto-rebase-retry.sh and .github/workflows/auto-rebase-retry.yml so changes to the new files trigger the dev-lead test suite on pull requests and pushes to main.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

needs-human-review, documentation

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: implementing automated retry logic for failed auto-rebase workflow runs, directly addressing issue #645.
Linked Issues check ✅ Passed The pull request fully addresses issue #645 by implementing automated retry mechanism for failed auto-rebase workflows through new workflow, script, and comprehensive test coverage.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the auto-rebase retry functionality: new workflow, retry script, test coverage, and updated test-dev-lead workflow paths.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-645-20260613-1724

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 and usage tips.

@don-petry

Copy link
Copy Markdown
Collaborator Author

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

PR: #646
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-06-13T18:05:34Z

@don-petry

Copy link
Copy Markdown
Collaborator 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-06-13T18:05:34Z

@don-petry
don-petry enabled auto-merge (squash) June 13, 2026 17:35

@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 introduces a self-healing mechanism for failed Auto-rebase workflow runs by adding the auto-rebase-retry.sh script and its corresponding BATS unit tests, along with updating AGENTS.md to document this exception. The review feedback suggests several improvements to the script's robustness, including safely handling empty REPO variables in the gh command, ensuring the summary function does not trigger set -e failures if the step summary file is unwritable, and consistently using double brackets [[ for conditional checks.

Comment thread scripts/auto-rebase-retry.sh Outdated
Comment thread scripts/auto-rebase-retry.sh Outdated
Comment thread scripts/auto-rebase-retry.sh Outdated
@don-petry
don-petry disabled auto-merge June 13, 2026 17:41

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

Actionable comments posted: 3

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

Inline comments:
In @.github/workflows/auto-rebase-retry.yml:
- Around line 28-37: Add an explicit human-readable job name to the GitHub
Actions job currently defined with the key "retry": insert a name: field (for
example "Retry failed auto-rebase run") under the job declaration so the job
displays that label in the Actions UI; keep the existing job key "retry" as the
internal identifier and do not change any other job properties.
- Around line 38-41: The workflow pins actions/checkout to the SHA
"df4cb1c069e1874edd31b4311f1884172cec0e10" while the comment claims "v6.0.3";
update the pin so the checked-out SHA matches the v6.0.3 tag (replace the SHA
with "9f698171ed81b15d1823a05fc7211befd50c8ae0") or alternatively change the
trailing comment to reflect the actual version/commit you intend to pin,
ensuring the actions/checkout@... value and the inline comment are consistent.

In `@tests/dev-lead/unit/test_auto_rebase_retry.bats`:
- Around line 52-96: Add assertions that verify the --failed flag is passed when
a rerun is expected: in the test cases named "auto-rebase-retry: failure on
first attempt → reruns", "auto-rebase-retry: last allowed attempt (cap-1) →
reruns", and any other test that asserts a rerun via the RERUN_MARKER, add a
check that RERUN_MARKER contains "--failed" (e.g., use grep -q "--failed"
"$RERUN_MARKER") so the tests fail if the script omits the --failed flag when
invoking gh run rerun.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 554855a4-3f65-4fea-8186-b28756ddd2fc

📥 Commits

Reviewing files that changed from the base of the PR and between 7390577 and 329a624.

📒 Files selected for processing (5)
  • .github/workflows/auto-rebase-retry.yml
  • .github/workflows/test-dev-lead.yml
  • AGENTS.md
  • scripts/auto-rebase-retry.sh
  • tests/dev-lead/unit/test_auto_rebase_retry.bats

Comment thread .github/workflows/auto-rebase-retry.yml
Comment thread .github/workflows/auto-rebase-retry.yml
Comment thread tests/dev-lead/unit/test_auto_rebase_retry.bats
@don-petry

Copy link
Copy Markdown
Collaborator Author

@coderabbitai resolve

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) June 13, 2026 17:44
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@don-petry
don-petry disabled auto-merge June 13, 2026 17:45
@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Collaborator Author

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

PR: #646
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-06-13T18:20:28Z

@don-petry

Copy link
Copy Markdown
Collaborator 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-06-13T18:20:28Z

@don-petry
don-petry enabled auto-merge (squash) June 13, 2026 17:50
@donpetry-bot donpetry-bot added the needs-human-review Flagged by automated PR review agent label Jun 13, 2026
@don-petry
don-petry merged commit 426c440 into main Jun 13, 2026
37 of 39 checks passed
@don-petry
don-petry deleted the dev-lead/issue-645-20260613-1724 branch June 13, 2026 19:40
don-petry added a commit that referenced this pull request Jun 14, 2026
…646)

* feat: implement issue #645 — no fix when auto rebase workflow fails

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human-review Flagged by automated PR review agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no fix when auto rebase workflow fails

2 participants