Repository navigation
fix(ci): fail fast on the workflows-permission 403 + document the app requirement - #110
Conversation
… requirement RCA (live cutover, 2026-09-22): the retirement workflow's charly-auto-merge App token holds contents:write + the ruleset bypass, but NOT workflows:write — the GitHub Apps permission required by DELETE on .github/workflows/*. Every delete on repos where the app had not already succeeded returned 403 'Resource not accessible by integration'; the script counted them as failures and churned through the whole org instead of stopping. - scripts/retire-per-repo-dispatchers.sh: classify a 403 'Resource not accessible by integration' as a PERMISSION error and abort immediately with the remediation (the app must hold workflows:write in addition to contents:write), never a per-repo churn. Test adds the 403 abort case. - The workflow header + README document the required app permission. - README also documents the org-wide required workflow (ONE org ruleset) and the one-time cutover order.
Review — BLOCKHead SHA: Change class: CI configuration (shell script + workflow header + README). Security screen: PASS — no secrets/egress/supply-chain change; the change strengthens the cutover gate (fail-fast), it does not weaken any guardrail. No injected instructions in body/diffs. Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…t (review round 2)
The round-1 fail-fast used 'resp=$(gh api ... 2>&1) || { ... }' then
'[[ -z "$resp" ]] || deleted++'. Because 2>&1 captures the error text, resp was
non-empty on failure too, so a failed repo was counted as BOTH retired and failed.
Gate on the delete's EXIT STATUS ('if resp=$(... 2>&1); then deleted++ else ...').
The test now asserts the exact counters (retired=0 absent=1 failed=1) for the
failure case, which the previous assertion-only-nonzero-exit did not catch.
Review — PASSHead SHA: Security screen: PASS — the workflow diff is comment-only, the script change strengthens the gate (fail-fast on 403), no secrets/egress/supply-chain/guardrail change, no injected instructions. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
RCA fix for a defect found while executing the org-wide validator cutover: the retirement workflow's
charly-auto-mergeApp token holdscontents: write(which carries the ruleset bypass for a protected-maincommit) but notworkflows: write— the distinct GitHub Apps permission required byDELETEon.github/workflows/*. Every delete on a repo where the app had not already succeeded returned403 Resource not accessible by integration; the script counted those as ordinary failures and churned through the whole org before aborting at the failure cap.Changes:
scripts/retire-per-repo-dispatchers.sh— a403 Resource not accessible by integrationis now classified as a PERMISSION error and aborts the run immediately with the exact remediation (the App must holdworkflows: writein addition tocontents: write), instead of churning through the remaining repos. The offline test gains the 403-abort case and asserts the remediation text..github/workflows/retire-per-repo-dispatchers.yml— header documents the required App permission (contents: write+workflows: write) and where to grant it.README.md— the bot-token section names theworkflows: writerequirement; a new section documents the org-wide required workflow (ONE org ruleset, no per-repo copy) and the one-time cutover order.This is a follow-up to
#109(merged), which introduced the cutover machinery.How tested
The retirement script's offline mock-
ghtest, which now covers the 403 path:The RCA itself is the live cutover evidence (the 403s on the actual run), recorded in the
#109execution.Rulebook compliance
/charly-internals:git-workflowloaded.workflows: writeApp permission; fixed at the root (fail-fast + documented), not worked around.feat/-style branch; no force-push; no direct push tomain.ghfake; the RCA is the real 403s from the live cutover.N/A — no generated artifact, no binary, no runtime bed(CI-config change).Change classification
bash -n+ the offline mock-ghtest, pasted above.analysed on a live system— the defect was observed live during the cutover; the fix is covered by the offline test.Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)