Skip to content

Commit 8328085

Browse files
docs: review on every push, now that a push costs a delta (#87)
* docs: review on every push, now that a push costs a delta The recommended workflow analyzed a pull request once, when it became reviewable, because every run re-derived the whole thing and a run per push was not worth it. A run now continues from the pull request's previous analysis and covers only the commits pushed since, so the reason for leaving synchronize out is gone. It also matters for a second reason: a pushed commit is the only thing that builds that reusable analysis. GitHub gives comment-triggered runs a read-only cache, so a repository reviewed only through /codeboarding starts from the base every time. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs: serialize reviews per pull request alongside per-push runs Recommending a run on every push without a concurrency group invites two races. Two pushes in quick succession analyze concurrently, so both restore the same older analysis and neither continues from the other, which is the saving the per-push recommendation is made for. Worse, every pull_request run writes the same sticky comment header, so whichever run finishes last wins, and that can be the one for the older commit: the review then describes a head that has already been superseded. The example now queues one review per pull request, as this repository's own workflow has done, and says what the alternative costs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 6bd6951 commit 8328085

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name: CodeBoarding review
1818

1919
on:
2020
pull_request:
21-
types: [opened, reopened, ready_for_review]
21+
types: [opened, reopened, ready_for_review, synchronize]
2222
issue_comment:
2323
types: [created]
2424

@@ -28,6 +28,16 @@ permissions:
2828
issues: write
2929
id-token: write
3030

31+
# One review at a time per pull request. Two pushes in quick succession would
32+
# otherwise analyze concurrently, and both would start from the same older
33+
# analysis instead of the newer one continuing from its predecessor. They also
34+
# share one sticky comment, so whichever finishes last wins — which can be the
35+
# run for the older commit. Queue rather than cancel, so a /codeboarding command
36+
# waits for a running review instead of killing it.
37+
concurrency:
38+
group: codeboarding-${{ github.event.pull_request.number || github.event.issue.number }}
39+
cancel-in-progress: false
40+
3141
jobs:
3242
review:
3343
if: >
@@ -44,6 +54,10 @@ jobs:
4454
4555
Automatic runs update one sticky **CodeBoarding review** comment. A trusted repository owner, member, or collaborator can comment `/codeboarding` to analyze the current PR head again, including on fork PRs; every command creates a new result comment.
4656

57+
`synchronize` re-runs the review on every push to the branch. Each of those runs covers only the commits pushed since the previous one, so a push costs a fraction of a first analysis — and a pushed commit is the only thing that builds the reusable analysis, since GitHub gives comment-triggered runs a read-only cache. Drop `synchronize` from the list if you would rather spend one analysis per pull request than one per push.
58+
59+
Keep the `concurrency` block if you keep `synchronize`: it is what makes a push continue from the push before it, and what stops a slower run for an older commit from overwriting the review comment for a newer one. Set `cancel-in-progress: true` instead to abandon a superseded run rather than queue it, which costs less when branches are pushed to rapidly, at the price of no analysis for the commits in between.
60+
4761
| Command | What it does |
4862
|---|---|
4963
| `/codeboarding` | Analyzes the current head, reusing this PR's previous analysis when one is available. |

0 commit comments

Comments
 (0)