Skip to content

ci: deterministic autorevert on red main CI (RQ-AUTOREVERT pilot) - #114

Closed
masonwyatt23 wants to merge 1 commit into
mainfrom
ci/autorevert
Closed

masonwyatt23 wants to merge 1 commit into
mainfrom
ci/autorevert

Conversation

@masonwyatt23

@masonwyatt23 masonwyatt23 commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Pilot for RQ-AUTOREVERT. No model, no new secrets, GITHUB_TOKEN only with job-scoped permissions.

  • workflow_run on CI and Release, main pushes only. First failure reruns failed jobs once (flake guard); a second failure with the previous main run green names head_sha as culprit.
  • Skips: reverts, release commits, commits touching release/autorevert workflows, existing autorevert/ PR, open autorevert-paused issue.
  • Kill switch: 2 autorevert PRs in 24h opens an autorevert-paused issue and stops.
  • Opens revert PR, enables --auto --squash, dispatches CI on the branch so required checks report (workflow_dispatch is the documented GITHUB_TOKEN exception).
  • Release failures open an issue only.
  • Self-test: workflow_dispatch with run_id prints the DECISION line and opens nothing. Local dry run: green run gives skip conclusion=success; failed run 39017327540 gives rerun-failed.

Activation needs the repo setting 'Allow GitHub Actions to create and approve pull requests' (currently off on all 7 repos). Until then only the dry-run path is useful. Spec: phantom-work/ci-efficiency/autorevert-spec.md

Summary by CodeRabbit

  • New Features
    • Failed continuous integration runs can now be automatically retried or reverted through a proposed change.
    • Release failures and revert conflicts are reported for follow-up.
    • Automatic reversions pause when safeguards are reached, helping prevent repeated or unsuitable changes from proceeding.
    • The recovery process can also be started manually for a selected run.

@vercel

vercel Bot commented Oct 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ashlr-stack Building Building Preview Oct 26, 2026 6:39am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The change adds a GitHub Actions workflow and script for failed-run handling. The script checks run and commit eligibility, reruns failed jobs on a first attempt, and can create an automatic revert pull request or an issue.

Changes: Autorevert handling

Layer / File(s) Summary
Workflow entry and run classification
.github/workflows/autorevert.yml, .github/scripts/autorevert.sh
The workflow handles qualifying failed runs and manual dispatches. The script processes release failures and filters other runs by event type and branch.
Eligibility and automation limits
.github/scripts/autorevert.sh
The script checks pause status, first-attempt failures, prior run results, commit eligibility, existing autorevert pull requests, and the 24-hour pull-request threshold.
Revert and follow-up
.github/scripts/autorevert.sh
After the checks, the script reports a dry-run decision or reverts the commit, creates and auto-merges a pull request, and dispatches the workflow on the revert branch. A revert conflict creates an issue.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Actions as GitHub Actions
  participant Workflow as Autorevert workflow
  participant Script as autorevert.sh
  participant Repo as Git repository
  participant PR as GitHub pull request
  Actions->>Workflow: Send qualifying failed-run event
  Workflow->>Script: Invoke with run metadata
  Script->>Repo: Create branch and revert commit
  Script->>PR: Create labeled pull request and enable squash auto-merge
  Script->>Actions: Dispatch workflow on revert branch
Loading
Merge Risk: Moderate · up to dd3b5

Keep the dry-run entrypoint from running branch-selected code with write access, and make revert failures recoverable before enabling the pilot.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@masonwyatt23

Copy link
Copy Markdown
Member Author

Superseded by box-side runner per Mason 02:44 decision; no repo settings change

This branch was successfully deployed

1 active deployment
Preview — dd3b5dab Deployed Oct 26, 2026 by vercel[bot]
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.

1 participant