Skip to content

ci(town-crier): resolve on unlabel — de-announce when the review label is removed#37

Merged
jasperboerhof merged 1 commit into
mainfrom
ci/town-crier-resolve-on-unlabel
Jun 20, 2026
Merged

ci(town-crier): resolve on unlabel — de-announce when the review label is removed#37
jasperboerhof merged 1 commit into
mainfrom
ci/town-crier-resolve-on-unlabel

Conversation

@jasperboerhof

Copy link
Copy Markdown
Contributor

What

Makes the town-crier producer workflow de-announce a PR when its Agent Review Requested label is removed, not only when the PR closes/merges.

Four edits to .github/workflows/announce-pr.yml:

  1. Trigger types — add unlabeled ([labeled, closed][labeled, unlabeled, closed]).
  2. resolve: job if: — fire on closed-with-label OR unlabeled-of-Agent Review Requested.
  3. resolve step — add ACTION env, and branch the resolve NOTE (review label removed / merged / closed without merge).
  4. Header comment — amended to mention label removal alongside close/merge.

Announce side is unchanged.

Why

The producer only de-announced on close, and that close-resolve required the label to still be present — so unlabel-then-merge left the request stranded "open" on the town-crier bus forever (there is no GitHub→bus merge sync). Removing the label now immediately POSTs /resolve. The bus no-ops an unknown pr_url, so the call is always safe.

Verification

  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/announce-pr.yml'))"YAML OK
  • CI here is the PHP gate suite (composer audit / format:check / phpstan / test:coverage / coverage:check / mutation:ci); none analyze .github/workflows/, so no workflow linter to run locally.

Deviations from kendo

None — this is a town-crier producer workflow, not a kendo-pattern port.

…l is removed

The producer only de-announced on close, and that close-resolve required the
label to still be present — so unlabel-then-merge left the request stranded
"open" on the town-crier bus forever. Add `unlabeled` to the trigger types and
fire /resolve when the "Agent Review Requested" label is removed (the bus
no-ops an unknown pr_url, so it's always safe). Announce side unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NzAm5CqhSQTzD3PBuZHyfY
@jasperboerhof jasperboerhof added the Agent Review Requested Requesting review of specialized AI review agents. label Jun 20, 2026
@jasperboerhof jasperboerhof requested a review from a team as a code owner June 20, 2026 12:59

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

The unlabel guard lands correctly: resolve's if: keys the new branch on github.event.action == 'unlabeled' && github.event.label.name == 'Agent Review Requested' (.github/workflows/announce-pr.yml:60). On the unlabeled action github.event.label is the label just removed, so a wip/priority removal can't false-resolve a still-open thread — the failure mode this whole change had to avoid.

on: adds unlabeled without dropping labeled/closed (:25), so announce and close-resolve are intact. The new ACTION env is github.event.action (a fixed GitHub enum, not attacker-controlled) consumed quoted as "$ACTION"; NOTE branches to string literals — no label name reaches a run: shell, so no injection vector despite unlabeled being a label-driven event. permissions: {}, pull_request (not _target), and the loud-config-error / tolerant-curl fail-open all survive the addition. CI green (8.4/8.5/announce pass, resolve correctly skips).

Description matches the diff. Approve.

Automated war-room agent review — posted because this PR carries the Agent Review Requested label.

@jasperboerhof jasperboerhof merged commit 4b639be into main Jun 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Agent Review Requested Requesting review of specialized AI review agents.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants