Skip to content

ci: file an issue the moment main goes red - #272

Merged
github-actions[bot] merged 1 commit into
mainfrom
ci/main-red-alert
Aug 6, 2026
Merged

ci: file an issue the moment main goes red#272
github-actions[bot] merged 1 commit into
mainfrom
ci/main-red-alert

Conversation

@catomean

@catomean catomean commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Why

A red main silently stops the whole repo, and the symptom points away from the cause.

On 2026-08-05 a regression reddened CI on main. The fix was pushed to a PR branch, that branch went green — but nothing re-runs a base-branch run, so main's own run stayed red. Auto-merge's green-base guard then refused every merge for ~16 hours, holding back 17 PRs, logging refusing to merge onto a broken base into a workflow nobody opens. It presented as "the agent can't merge" rather than "the base is broken".

What

Ported from OrangeCat (main-red-alert.yml), adapted to this repo's CI workflow name (CI Pipeline):

  • Files one issue when CI fails on main; comments on it for subsequent failures instead of spamming new ones.
  • Closes it automatically when a CI run on main succeeds.
  • Ignores cancelled — the CI concurrency group cancels superseded runs, and reading that as a failure is how "cancelled" gets misread as "broken".
  • The issue body states the actual fix: re-run main's run (gh run rerun <id> --failed). Re-running your own branch does not clear it.

Verification

  • YAML parses; workflows: ['CI Pipeline'] matches ci.yml's name exactly (checked, not assumed).
  • Read-only apart from issue writes: permissions are issues: write, actions: read.
  • workflow_run workflows only run from the default branch, so this takes effect once merged.

🤖 Generated with Claude Code

A red main silently stops the whole repo. On 2026-08-05 a regression
reddened CI on main; the fix was pushed to a PR branch and that branch went
green, but nothing re-runs a base-branch run, so main's own run stayed red.
Auto-merge's green-base guard then refused every merge for ~16h, holding
back 17 PRs while logging its refusal into a workflow nobody opens.

The cost was not the breakage, it was the misattribution: the symptom
("the agent can't merge") points away from the cause ("the base is broken").

Ported from OrangeCat, adapted to this repo's CI workflow name. Files or
updates ONE issue on a failed CI run on main, closes it when main is green
again, and says in the body that clearing it means re-running MAIN's run,
not the branch's.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions
github-actions Bot merged commit 963bdaf into main Aug 6, 2026
7 checks passed
@github-actions
github-actions Bot deleted the ci/main-red-alert branch August 6, 2026 11:52
catomean added a commit that referenced this pull request Aug 6, 2026
…very run

#272 added the alarm on `workflow_run`. That covers pushes to main — but
every merge in this repo is an auto-merge made with GITHUB_TOKEN, which
fires no push event. The sweep therefore re-arms ci.yml by dispatch, and
GitHub emits no `workflow_run` for a dispatched run. The alarm was blind on
the path producing almost every main CI run.

Proven within the hour: main went red on a66baa5 (a transient puppeteer
403 fetching chrome-headless-shell), the sweep started refusing merges
again, and no issue was filed.

Now dual-path, one policy:

- scripts/ci/main-red-alert.sh holds the verdict logic, so the two callers
  cannot drift.
- main-red-alert.yml keeps the push path and calls the script.
- ci.yml gains a post-main job, gated to dispatched runs on main, which
  resolves its own verdict from the job results and calls the same script.
  `skipped` counts as success (jobs here are conditional on event type);
  failure outranks cancelled.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
github-actions Bot pushed a commit that referenced this pull request Aug 6, 2026
…very run (#277)

#272 added the alarm on `workflow_run`. That covers pushes to main — but
every merge in this repo is an auto-merge made with GITHUB_TOKEN, which
fires no push event. The sweep therefore re-arms ci.yml by dispatch, and
GitHub emits no `workflow_run` for a dispatched run. The alarm was blind on
the path producing almost every main CI run.

Proven within the hour: main went red on a66baa5 (a transient puppeteer
403 fetching chrome-headless-shell), the sweep started refusing merges
again, and no issue was filed.

Now dual-path, one policy:

- scripts/ci/main-red-alert.sh holds the verdict logic, so the two callers
  cannot drift.
- main-red-alert.yml keeps the push path and calls the script.
- ci.yml gains a post-main job, gated to dispatched runs on main, which
  resolves its own verdict from the job results and calls the same script.
  `skipped` counts as success (jobs here are conditional on event type);
  failure outranks cancelled.

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