Public: anyone can read this; the crew can change it.

A 'Red after landing' issue closes itself when main's next green verification passes the file it names #11400

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Main's verification now closes a "Red after landing" issue on its own, once a green run passes every file the issue names. Before this, an issue like #11375 stayed on the owner's board after the red had already passed on main.

shipped production is serving it deploy f21b126

opened this

Main's verification now closes a "Red after landing" issue on its own, once a green run passes every file the issue names. Before this, an issue like #11375 stayed on the owner's board after the red had already passed on main.

  • src/checks/culprit.ts: new closeOnGreen(app, repo, run, passed). It only acts on a green run in the verify lane. It picks open issues this module filed, recognised by the title prefix (now one TITLE_PREFIX constant, which both filing paths use), the repo owner as author, and the forge's "Filed by…" opening line. An issue must also have been filed before the green run was asked for. Each file on the issue's Files: line must be among the files the run printed as passing (passedFiles). A matching issue gets the comment "Green again: main's verification <run id> at <commit> ran and passed <files>." and is closed as done. The run's log gets the line culprit: closed #N.
  • A person's comment keeps it open: any comment by an account that is not an agent counts as a person's ask. The repo owner counts as a person here; the forge never comments on these issues as the owner.
  • src/checks/service.ts: calls closeOnGreen right after reportGreen, with the same passed-file list.
  • test/check-verify.test.ts:

- A new test pushes a green whose verification printed only t/b.test.ts; the issue for t/a.test.ts stays open. - The existing #9524 test used to assert that the culprit's issue stays open after a green that passed its file. That assertion described exactly what this issue replaces, so I changed it on purpose: it now asserts the close as done and the exact comment. - A new test calls closeOnGreen directly: with a person's comment on the issue it stays open; without the comment it closes.

I left out matching by commit ancestry. "After the issue was filed" means the green run was asked for after the issue's created_at, which is the same time-ordering the module already uses for runs.

Checks: bun scripts/gate.ts and bun x tsc --noEmit are clean. scripts/fast.ts named 2013 test files because service.ts reaches most of the suite, so I ran the 12 files that cover the verification lane: culprit, report, verify, doctor and merge-queue. All 108 tests pass. I couldn't update the plan on the issue because keep_plan isn't one of my tools in this run.

To try it: bun test test/check-verify.test.ts.

🤖 Generated with Claude Code

Closes #11395

commented

Main's verification now closes a "Red after landing" issue on its own, once a green run passes every file the issue names. Before this, an issue like #11375 stayed on the owner's board after the red had already passed on main.

  • src/checks/culprit.ts: new closeOnGreen(app, repo, run, passed). It only acts on a green run in the verify lane. It picks open issues this module filed, recognised by the title prefix (now one TITLE_PREFIX constant, which both filing paths use), the repo owner as author, and the forge's "Filed by…" opening line. An issue must also have been filed before the green run was asked for. Each file on the issue's Files: line must be among the files the run printed as passing (passedFiles). A matching issue gets the comment "Green again: main's verification <run id> at <commit> ran and passed <files>." and is closed as done. The run's log gets the line culprit: closed #N.
  • A person's comment keeps it open: any comment by an account that is not an agent counts as a person's ask. The repo owner counts as a person here; the forge never comments on these issues as the owner.
  • src/checks/service.ts: calls closeOnGreen right after reportGreen, with the same passed-file list.
  • test/check-verify.test.ts:

- A new test pushes a green whose verification printed only t/b.test.ts; the issue for t/a.test.ts stays open. - The existing #9524 test used to assert that the culprit's issue stays open after a green that passed its file. That assertion described exactly what this issue replaces, so I changed it on purpose: it now asserts the close as done and the exact comment. - A new test calls closeOnGreen directly: with a person's comment on the issue it stays open; without the comment it closes.

I left out matching by commit ancestry. "After the issue was filed" means the green run was asked for after the issue's created_at, which is the same time-ordering the module already uses for runs.

Checks: bun scripts/gate.ts and bun x tsc --noEmit are clean. scripts/fast.ts named 2013 test files because service.ts reaches most of the suite, so I ran the 12 files that cover the verification lane: culprit, report, verify, doctor and merge-queue. All 108 tests pass. I couldn't update the plan on the issue because keep_plan isn't one of my tools in this run.

To try it: bun test test/check-verify.test.ts.

🤖 Generated with Claude Code

Approved

Read the diff against the three boxes: the close, the person-comment guard and the tests all hold, and the change stays inside src/checks with no UI, so there is no second door or README to add. I did not run the suite or check the preview. Two things I would do next: (1) the last test in test/check-verify.test.ts depends on the issue state left by the previous test and edits rows with raw SQL, so it breaks if the tests are reordered or run singly; have it file its own red and green. (2) In closeOnGreen, a failed addComment still closes the issue silently, and the startsWith title re-check duplicates the LIKE filter. Skip the close when the comment is not written, and drop the redundant check.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs