Repository navigation
feat(ci): org-wide rerun-label listener distributor (no empty commit) - #121
Conversation
A body-only fix after a BLOCK needs no empty commit: adding a `rerun` label re-runs the PR head's failed `charly/pr-validator` run — a re-run reuses the SAME GITHUB_SHA and updates THAT run's `validate / validate` check run IN PLACE (no duplicate same-name check run), clearing POISON and re-reading the corrected body. WHY A PER-REPO FILE + DISTRIBUTOR (not the required workflow): MEASURED — a REQUIRED workflow acts ONLY on the default push-driven pull_request types (`opened`/`synchronize`/`reopened`) and IGNORES `on.types` for anything else. A body edit did NOT fire the required workflow even with `edited` listed (dotgithub#119's dead addition), and a draft->ready transition did NOT fire it even with `ready_for_review` listed (already present). A PLAIN per-repo workflow DOES fire on those activity types (verified live), so the listener must be a plain per-repo file. This lands: - `org-wide-rerun-listener.yml` — the listener template (plain per-repo). - `scripts/distribute-rerun-listener.sh` — installs it into every repo (idempotent: identical content skipped; differing updated; absent created; 403 names the missing `workflows: write`; `contents: write` + `workflows: write` App token). Offline mock-gh test: `distribute-rerun-listener_test.sh`. - `.github/workflows/distribute-rerun-listener.yml` — mints the App token and runs the distributor (workflow_dispatch + push on the template/script). - Remove the dead `edited` from the required workflow, with the MEASURED rationale. - Wire the new test into `validator-harness.yml`. Gate: validator-gate-harness.py + org-ruleset_test + retire-per-repo- dispatchers_test + bootstrap-repo-main_test + distribute-rerun-listener_test, all pass. Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: org CI config + distributor script/template ( Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…or (R1)
listener_state read ANY gh api failure as "absent", contradicting its own
header ("a non-2xx other than 404 is FATAL") and attempting a CREATE PUT
against an existing file. Now it uses api_status: 200 reads the sha/content,
404 is absent, any other code is FATAL with the HTTP code named. The offline
test gains an omega case (probe 500 -> abort) covering this path.
Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS (no secrets/egress/obfuscation; no guardrail weakening — the Checklist: All applicable rules PASS or NA. Prior comment 5848057399 (BLOCK on
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary of changes
Install an org-wide
rerun-label listener so a body-only fix after a BLOCKneeds no empty commit, and remove the dead
editedtrigger from the requiredworkflow (dotgithub#119).
The diff:
org-wide-rerun-listener.yml(new) — the listener template: a PLAINper-repo workflow that, on a
rerun-label add, re-runs the PR head's failedcharly/pr-validatorrun.scripts/distribute-rerun-listener.sh(new) — installs that template intoevery repo (idempotent: absent→create, identical→skip, differing→update).
.github/workflows/distribute-rerun-listener.yml(new) — mints thecharly-auto-mergeApp token (contents: write+workflows: write) and runsthe distributor (workflow_dispatch + push on the template/script).
.github/workflows/org-wide-pr-validator-required.yml— removes the deadeditedtrigger, documenting the measured constraint..github/workflows/validator-harness.yml— wires the new distributor testinto the gate.
README.md— documents the rerun-listener mechanism in "What lives here".scripts/distribute-rerun-listener_test.sh(new) — the distributor'soffline mock-
ghtest.RCA (8-step, R1) — MEASURED
Unexpected. A body-only fix after a BLOCK still required an empty "re-freeze"
commit even after #119 added
editedto the required workflow'son.types.Mechanism (four live experiments):
on: pull_request: [edited]on: pull_request: [labeled]edited; edit the PR bodyready_for_review; draft→readyExperiments 3–4 prove a required workflow ignores
on.typesentirely — itacts only on the default push-driven types. So #119's
editednever fired, andno listener can live in the required workflow. A plain per-repo workflow fires
on both. The listener therefore ships as a plain per-repo file + a distributor.
Fix
Adding a
rerunlabel re-runs the PR head's FAILEDcharly/pr-validatorrun. Are-run reuses the SAME
GITHUB_SHAand updates THAT run'svalidate / validatecheck run IN PLACE — no duplicate same-name check run — clearing POISON and
re-reading the corrected body. Capability-free (
actions: writeonly — nochecks: write); loop-safe (it only POSTs a re-run).How tested
The SHIPPED template, live (marketplace#339, a throwaway PR)
The exact file from this diff was committed to a scratch branch and fired:
The repo gate (all offline, all green)
distribute-rerun-listener_test.shasserts: absent → CREATED; identical →SKIPPED (no churn); differing → UPDATED; installed content equals the template
verbatim; a 403 workflow-file write ABORTS naming
workflows: write; and anon-404 probe failure (500) ABORTS naming the HTTP code (never read as
"absent").
Rulebook compliance
editedtrigger was RCA'd (4 live experiments) before thisfix; and the distributor's own 404-vs-non-404 probe divergence was fixed in the
same PR (with a test).
file installed everywhere.
validated by its mock-
ghtest.SHIPPED artifact.
checks: writeNOT added).Change classification
analysed on a live system(the shipped template ran live;the distributor's org-wide run is dispatch-only and operator-run).
Supersedes the dead
editedaddition from dotgithub#119.Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)