Skip to content

feat: implement issue #1473 — [Fleet Monitor] petry-projects/.github-private — .github/workflows/auto-rebase.yml - #1476

Merged
don-petry merged 4 commits into
mainfrom
dev-lead/issue-1473-20260807-0756
Aug 7, 2026
Merged

don-petry merged 4 commits into
mainfrom
dev-lead/issue-1473-20260807-0756

Conversation

@don-petry

@don-petry don-petry commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

User description

Closes #1473

Implemented by dev-lead agent. Please review.


CodeAnt-AI Description

Keep Auto-rebase retries running during GitHub action-resolution outages

What Changed

  • The retry workflow no longer depends on checking out code through a marketplace action, so it can start when action resolution is unavailable
  • The retry script is fetched directly through GitHub's API and still re-runs failed Auto-rebase jobs
  • Added a regression check confirming the retry job uses no marketplace actions and retains the required permissions

Impact

✅ Auto-rebase self-healing during action-resolution outages
✅ Fewer cancelled retry jobs
✅ Failed Auto-rebase runs can retry without checkout

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

Summary by CodeRabbit

  • Reliability

    • Improved automatic rebase retries to remain operational during action-resolution outages.
    • Retry processing now uses repository-hosted scripts and appropriate repository permissions.
  • Tests

    • Added integration coverage confirming retry workflows avoid external action dependencies.
    • Added automated checks for workflow structure, permissions, script execution, and clear failure reporting.
    • Added resilience testing to help ensure retries continue working when action resolution is unavailable.

…private — .github/workflows/auto-rebase.yml
@don-petry
don-petry requested a review from a team as a code owner August 7, 2026 08:09
@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.

@codeant-ai

codeant-ai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR a81b8ee Aug 07, 2026 · 08:09 08:12

@codeant-ai

codeant-ai Bot commented Aug 7, 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

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 7, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

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

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) August 7, 2026 08:10

@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 an integration test script (test_auto_rebase_retry_no_action_resolution.py) to ensure that the auto-rebase retry workflow remains resilient during GitHub action-resolution outages by verifying it does not depend on marketplace actions, uses the correct script, and has the necessary permissions. The reviewer suggested improving the defensive validation and error handling when parsing the workflow YAML file to raise clearer diagnostic errors.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3ed54047-fe82-4247-bc87-f79295ee4643

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The retry workflow no longer uses checkout or marketplace actions. It downloads the retry script with gh api. A new integration job validates the workflow structure, permissions, action usage, and script invocation.

Changes

Auto-rebase retry resilience

Layer / File(s) Summary
Workflow script retrieval
.github/workflows/auto-rebase-retry.yml
The retry job adds contents: read, removes checkout, and downloads the retry script through gh api before execution.
Resilience validation
.github/workflows/test-dev-lead.yml, tests/dev-lead/integration/test_auto_rebase_retry_no_action_resolution.py
A PyYAML-based guard checks the retry job, permissions, marketplace action usage, and retry-script invocation. The workflow runs this guard in a dedicated job.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RetryJob
  participant GitHubContentsAPI
  participant TemporaryScript
  RetryJob->>GitHubContentsAPI: Request retry script with gh api
  GitHubContentsAPI-->>RetryJob: Return script contents
  RetryJob->>TemporaryScript: Write and execute downloaded script
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the code change but omits the required Summary, Interaction contract, and Checklist sections. Add the template sections and complete the agentic-role interaction contract and checklist for the changed workflow.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies issue #1473 and the affected auto-rebase workflow, but it does not mention the retry-resilience change.
Linked Issues check ✅ Passed The changes address issue #1473 by improving auto-rebase retry resilience and adding regression coverage for action-resolution outages.
Out of Scope Changes check ✅ Passed The workflow changes and integration test are directly related to auto-rebase retry resilience and issue #1473.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-1473-20260807-0756

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.

@don-petry
don-petry disabled auto-merge August 7, 2026 08:12
coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 7, 2026

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

🤖 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 `@tests/dev-lead/integration/test_auto_rebase_retry_no_action_resolution.py`:
- Around line 76-84: Strengthen the validation around RETRY_SCRIPT in the test’s
run-body inspection so it requires an actual gh api contents-endpoint download
with raw output written to a file, followed by execution of that downloaded
file. Reject steps that only mention or echo the script, while preserving the
guard that the retry job uses the tested script for action-resolution
resilience.
🪄 Autofix

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 Plus

Run ID: 6dde0d8e-ca1c-4733-a3d5-7265e822c9e2

📥 Commits

Reviewing files that changed from the base of the PR and between 738f05b and a81b8ee.

📒 Files selected for processing (3)
  • .github/workflows/auto-rebase-retry.yml
  • .github/workflows/test-dev-lead.yml
  • tests/dev-lead/integration/test_auto_rebase_retry_no_action_resolution.py

@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) August 7, 2026 08:16
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@don-petry
don-petry disabled auto-merge August 7, 2026 08:18
@donpetry-bot
donpetry-bot dismissed coderabbitai[bot]’s stale review August 7, 2026 08:18

Auto-dismissed (#617): coderabbitai[bot] CHANGES_REQUESTED on a superseded commit. The bot re-reviews the new head automatically — a valid concern will return as a fresh review.

@don-petry

Copy link
Copy Markdown
Collaborator Author

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

PR: #1476
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-08-07T08:50:38Z

@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-08-07T08:50:38Z

@don-petry
don-petry enabled auto-merge (squash) August 7, 2026 08:20
@don-petry
don-petry disabled auto-merge August 7, 2026 09:15
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 7, 2026 09:20
@don-petry
don-petry disabled auto-merge August 7, 2026 09:21
@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 7, 2026 09:30
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dependency Advisory

Package Change Ecosystem Risk Notes
bats 1.13.0 → removed npm LOW Vendored node_modules/ copy removed; package-lock.json name updated to match PR number

Risk Legend

  • LOW — Patch/minor bump, lockfile regeneration, well-maintained package
  • MEDIUM — Minor bump with new APIs, new direct dependency, deprecation notice
  • HIGH — Major version bump, package with recent CVE, unusual transitive deps
  • CRITICAL — Active CVE, known supply-chain risk, abandoned package

Details

All dependency changes appear low-risk. No action required.

The only changes here are housekeeping: the committed node_modules/ directory (which should not be tracked in version control) is being removed, and the package-lock.json name field is updated from pr-1447 to pr-1476 to match the current PR. No package versions were changed, no new dependencies were introduced, and no CVEs are associated with bats@1.13.0.

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge August 7, 2026 09:32
@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

@don-petry

Copy link
Copy Markdown
Collaborator Author

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

Agent reasoning
Issues addressed: 0
- Quality Gate passed with 0 new issues (no actionable items)
Files changed: None
Skipped (informational): 0
```
The PR's code quality checks are clean. No changes needed based on the bot comment.

@don-petry
don-petry enabled auto-merge (squash) August 7, 2026 09:32

@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: 81c756cb0624b999e0b4c30b3a5d9e3e9807fadb
Review mode: triage-approved (single reviewer)

Summary

Makes the Auto-rebase retry handler resilient to GitHub action-resolution outages by removing its only marketplace-action dependency (actions/checkout) and self-fetching scripts/auto-rebase-retry.sh from the default branch via the gh REST contents API. Adds a regression-guard CI job/test enforcing zero uses: steps and the required permissions, and removes accidentally-committed node_modules/bats (the bulk of the 5,919 deletions).

Linked issue analysis

Closes #1473 (Fleet Monitor DEGRADED alert on auto-rebase.yml, 33.3% failure rate). Root cause was substantively addressed: the failed run stemmed from a transient 503 in the action-resolution service, and the retry handler itself hung resolving actions/checkout during the same outage. The fix removes that dependency entirely, so the self-heal path no longer shares the failure mode it heals. A new CI check (auto-rebase-retry-resilience, green on this PR) guards against regression.

Findings

  • Security: no new concerns. The fetched script comes from this repo's default branch via authenticated API — trust-equivalent to the checkout it replaces (workflow_run handlers already run from the default branch). Job permissions are minimal and explicit (actions: write, contents: read); workflow_run event data is passed via env vars, not interpolated into shell. The new test job pins actions/checkout to the same SHA already used repo-wide.
  • Scope: auto-rebase-retry.yml is a documented repo-specific workflow (AGENTS.md exception), not a frozen thin caller stub; caller-stub-freeze and stub-structure checks passed.
  • Prior bot review threads (3, all on substring-matching heuristics in the new test) are resolved; the test now verifies explicit fetch-and-execute. CodeRabbit approved.
  • Non-blocking nit: package-lock.json "name" churns pr-1447 → pr-1476, indicating the lockfile is regenerated from ephemeral agent workdir names.
  • Secret scan: run_secret_scanning MCP tool unavailable in this environment; gitleaks CI check is green.

CI status

All substantive checks green: actionlint, ShellCheck, CodeQL (actions + python), gitleaks, SonarCloud, unit tests, bats, agent-shield, dependency-audit, and the new auto-rebase-retry-resilience guard. Three CANCELLED entries (dev-lead / dispatch, dev-lead / ci-relay, review / review) are superseded agent-orchestration runs, not code-quality gates; the current dispatcher (pr-auto-review / check-and-dispatch) succeeded.


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 dc378f1 into main Aug 7, 2026
52 of 55 checks passed
@don-petry
don-petry deleted the dev-lead/issue-1473-20260807-0756 branch August 7, 2026 09:36
@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-08-07T10:37:20Z.

don-petry added a commit that referenced this pull request Aug 8, 2026
…p of engine.sh + 3 more (#1485) (#1487)

* fix: restore trunk scripts to single-definition state (#1485)

Surgical deduplication of the corrupted scripts documented in #1485:

- scripts/engine.sh: restored to 79fc05d (last clean, 1583 lines).
  Verified zero content loss: every unique line on corrupted main exists
  in the clean version; the only main-side extras were 6 stale lines
  from the retired LSP pilot era carried in by duplicate blocks.
- scripts/dev-lead-fix-reviews.sh: 2798 -> 1339 lines. Kept the head
  (unique logic), one canonical copy of each of the 9 functions that
  had been duplicated 3-6x, and the executable tail. Canonical variant
  adjudications: post_reviews_rate_limited keeps the copy with the
  dev-lead rate-limit-ack idempotency marker on all three ack sites
  (the shadowed-in variant had dropped one marker line in conflict
  resolution); commit_and_push keeps the newest-feature copy (#1340
  no-op guard, #1311 push_no_clobber, human/human-pr intents).
- scripts/dev-lead-fix-ci.sh: removed byte-identical duplicate
  post_exhaustion definition (present since 2026-06-23).
- scripts/post-pr-review.sh: removed byte-identical duplicate
  mark_prior_agent_items_obsolete definition (back to its clean-era
  303 lines).
- package.json / package-lock.json: removed. Orphaned remnants of the
  #1292 bats vendoring; the node_modules tree itself was already
  removed by #1476, CI installs bats via apt-get, and no workflow
  consumes these manifests.

Verified: duplicate-definition sweep over scripts/*.sh returns empty;
bash -n passes on all touched files; no function name defined on
corrupted main is absent from the restored files (pure-duplication
corruption, no unique symbols lost).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 8, 2026
…private — .github/workflows/auto-rebase.yml (#1476)

* feat: implement issue #1473 — [Fleet Monitor] petry-projects/.github-private — .github/workflows/auto-rebase.yml

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

* chore: dev-lead update (review-changes) [skip ci-relay]

* chore: dev-lead update (review-changes) [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>
don-petry added a commit that referenced this pull request Aug 18, 2026
…private — .github/workflows/auto-rebase.yml (#1476)

* feat: implement issue #1473 — [Fleet Monitor] petry-projects/.github-private — .github/workflows/auto-rebase.yml

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

* chore: dev-lead update (review-changes) [skip ci-relay]

* chore: dev-lead update (review-changes) [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>
don-petry added a commit that referenced this pull request Aug 18, 2026
…p of engine.sh + 3 more (#1485) (#1487)

* fix: restore trunk scripts to single-definition state (#1485)

Surgical deduplication of the corrupted scripts documented in #1485:

- scripts/engine.sh: restored to 79fc05d (last clean, 1583 lines).
  Verified zero content loss: every unique line on corrupted main exists
  in the clean version; the only main-side extras were 6 stale lines
  from the retired LSP pilot era carried in by duplicate blocks.
- scripts/dev-lead-fix-reviews.sh: 2798 -> 1339 lines. Kept the head
  (unique logic), one canonical copy of each of the 9 functions that
  had been duplicated 3-6x, and the executable tail. Canonical variant
  adjudications: post_reviews_rate_limited keeps the copy with the
  dev-lead rate-limit-ack idempotency marker on all three ack sites
  (the shadowed-in variant had dropped one marker line in conflict
  resolution); commit_and_push keeps the newest-feature copy (#1340
  no-op guard, #1311 push_no_clobber, human/human-pr intents).
- scripts/dev-lead-fix-ci.sh: removed byte-identical duplicate
  post_exhaustion definition (present since 2026-06-23).
- scripts/post-pr-review.sh: removed byte-identical duplicate
  mark_prior_agent_items_obsolete definition (back to its clean-era
  303 lines).
- package.json / package-lock.json: removed. Orphaned remnants of the
  #1292 bats vendoring; the node_modules tree itself was already
  removed by #1476, CI installs bats via apt-get, and no workflow
  consumes these manifests.

Verified: duplicate-definition sweep over scripts/*.sh returns empty;
bash -n passes on all touched files; no function name defined on
corrupted main is absent from the restored files (pure-duplication
corruption, no unique symbols lost).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.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

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet Monitor] petry-projects/.github-private — .github/workflows/auto-rebase.yml

2 participants