Commit e135b8e
fix(ci): post PR reviews from the workflow instead of hoping the model does (#2719)
The Claude reviewer has posted **nothing since 2026-07-27 08:34 UTC**
while every `pr-review` job reported success — 84 PRs opened in that
window, **50 already merged unreviewed**, each having burned ~\$1.80 of
Opus writing a review no one ever saw. The cause is that posting was
never part of the harness: the prompt asked the model to finish by
running `gh pr comment` itself, and when that last call stops happening
the job still exits clean, because the only health check asks "did
Claude error?" and never "did a comment appear?". After this change
Claude writes the review to a file and the workflow posts it, and a
review that fails to materialise turns the job red instead of green.
The trigger was #2506 bumping `claude-code-action` v1.0.178 → v1.0.183
(the last review landed 4m25s before it merged; nothing else touched
review CI in that window). That bump carries no comment-posting changes
of its own — only a bundled runtime bump — which is exactly why a
harness that depends on the model remembering a shell command should not
be restored as-is.
Scoped deliberately: posting is gated on the new `comment_file` input,
so `issue-handler`, `pr-comment` and `auto-fix` keep their existing
in-prompt posting and cannot double-post. `pr-rereview` opts out of
`require_comment` because `REVIEW.md` makes silence correct there.
> [!IMPORTANT]
> `pull_request_target` reads workflows from the **base** branch, so
this PR is still reviewed by the old, broken `main` copy — its own
silence proves nothing. The fix only takes effect once merged.
## Test plan
- [x] `pytest tests/unit/test_claude_review_posting.py` — 6 passed.
Locks the invariant: neither review prompt may hand the model a `gh …
comment … --body-file` line, and both jobs must set `comment_file`.
- [x] Posting step exercised locally across all six branches: review
written → posts; missing file + `require_comment` → **exit 1**; empty
file + `require_comment` → **exit 1**; missing file without it → clean
no-op; issue event → `gh issue comment`.
- [x] Both workflows parse (`yaml.safe_load`).
- [ ] After merge: close/reopen one PR and confirm a review comment
appears, and that the run is red if it doesn't.
- [ ] After merge: backfill reviews on the ~32 still-open unreviewed
PRs.
---------
Co-authored-by: Ovtcharov <kovtchar@amd.com>1 parent efd3812 commit e135b8e
3 files changed
Lines changed: 142 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
61 | 75 | | |
62 | 76 | | |
63 | 77 | | |
| |||
345 | 359 | | |
346 | 360 | | |
347 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
348 | 391 | | |
349 | 392 | | |
350 | 393 | | |
| |||
366 | 409 | | |
367 | 410 | | |
368 | 411 | | |
369 | | - | |
| 412 | + | |
370 | 413 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
143 | | - | |
144 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
145 | 155 | | |
146 | 156 | | |
147 | 157 | | |
| |||
399 | 409 | | |
400 | 410 | | |
401 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
402 | 416 | | |
403 | 417 | | |
404 | 418 | | |
| |||
433 | 447 | | |
434 | 448 | | |
435 | 449 | | |
436 | | - | |
437 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
438 | 454 | | |
439 | 455 | | |
440 | 456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
0 commit comments