ReviewOS

also looking at this

stacks/buddy

fix(ci): give the repair loop the guard it already had

#1407
Merged glennmichael123 wants to merge fix/wire-ci-repair-attempt-guard into main
10 files +229 -34
docs/features/ci-repair.mdmodified+13-7
Changes to docs/features/ci-repair.md
@@ -80,21 +80,27 @@ features:
8080 details: "Every run posts an outcome: what it classified, what it did, and — when it declined — why the fix was not the bot's to make."
8181---
8282
83## From the thread
83## From a failing run
8484
85```text
86@buddy fix-ci
87```
85Repair is driven by the run that failed, because the diagnosis is a function of
86that job's log. The workflow generated by `buddy setup` wires this up: when a
87run on a Buddy branch fails, the `fix-ci` job reads its log and reports back on
88the pull request.
8889
89The most common way to reach it. The command is permission-checked, so a commenter without write access cannot make Buddy push to your branch.
90A comment cannot say *which* run failed, so `@buddy fix-ci` in a thread replies
91pointing at that job rather than guessing.
9092
9193## From the CLI
9294
9395```bash
94buddy fix-ci --pr 128
95buddy fix-ci --pr 128 --dry-run # classify and report, change nothing
96buddy fix-ci --run-id 12345 --pr 128
97buddy fix-ci --run-id 12345 --pr 128 --dry-run # classify and report, change nothing
9698```
9799
100`--run-id` supplies the log to diagnose. `--pr` is where the report goes, and
101also where the attempt counter lives — without it Buddy cannot tell a first
102attempt from a fourth.
103
98104## From a workflow
99105
100106```yaml