Commit 84115e1
feat(github-code-review): parallel workers, prompt override, feedback footer
Add concurrent review processing and two smaller review-worker features to
scripts/github-code-review.php:
- --parallel N / -p N: fork N workers that drain the shared queue at once.
Each worker gets its OWN checkout root ({CHECKOUT_ROOT}/wN) and Redis
checkout-cache namespace (wN:) so two workers reviewing the same repo:branch
can never share a working tree or clobber each other's cache. Every log and
stream line is tagged with the worker + queue entry it belongs to
(e.g. "[w0 owner/repo#42 a1b2c3d4]"). Workers run in their own process
groups; the parent forwards SIGINT/SIGTERM and reaps them. Single-worker
output is byte-identical (empty prefix).
- --prompt STR / --prompt-file FILE: replace the built-in review prompt with an
inline string or a file's contents; audit-type scope still layers on top.
--prompt wins if both are given.
- Every posted comment (per-issue, --combine, --split-changes) now ends with a
thumbs up/down feedback blurb via reviewFeedbackFooter().
Also harden the commit-hash baseline: setupCommitRangeBaseline() now verifies
`git rev-parse HEAD` actually equals the requested SHA before the review runs,
so a job can never silently review the wrong tree.
Note: GitHub does not deliver reaction (thumbs) events via webhook, so
web/github.php is unchanged; tracking reactions requires polling the reactions
API on posted comment IDs.
Adds tests/phpunit/unit/CodeReviewWorker/ParallelAndPromptTest.php.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 7aa8355 commit 84115e1
3 files changed
Lines changed: 476 additions & 23 deletions
File tree
- scripts
- tests/phpunit/unit/CodeReviewWorker
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| 66 | + | |
64 | 67 | | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
68 | | - | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
157 | | - | |
| 161 | + | |
0 commit comments