Skip to content

fix(examples): sha-keyed review concurrency + manual force-review dispatch - #76

Draft
Mearman wants to merge 2 commits into
mainfrom
feat/robust-review-example
Draft

Mearman wants to merge 2 commits into
mainfrom
feat/robust-review-example

Conversation

@Mearman

@Mearman Mearman commented Sep 17, 2026

Copy link
Copy Markdown
Member

Summary

Two robustness fixes to the shipped claude-review.yml examples, both confirmed as real problems in production use of this action:

  1. Concurrency keyed by head sha, not PR number. Keying by PR number cancels an in-flight review outright whenever a second push lands on the same PR before the first review finishes -- the earlier commit's review is lost, not just delayed, and nothing re-runs it. Sha-keying means two pushes' reviews never share a concurrency group, so a newer commit can't cancel an older one's still-running review; at worst that's one redundant run, not a lost review. Applied to both the reusable-workflow and direct-form examples.

  2. A workflow_dispatch escape hatch on the direct form, accepting a pr_number, to force a fresh review of a commit claude[bot] already reviewed. There was previously no way to ask for a redo short of pushing an empty commit -- dismissing a stale/wrong review doesn't retrigger anything on its own. The gate step resolves head_sha/base_ref/draft state via the API for this trigger (workflow_dispatch carries no pull_request payload), deliberately skips the "already reviewed this sha" check for this path only, and keeps the draft check exactly as strict as the ordinary pull_request path.

The reusable-workflow example only gets fix 1 -- fix 2 needs an explicit checkout ref and pr_number passed straight to the composite action, which only the direct form (calling ExaDev/claude-code-action@v1 directly) can do without changing review.yml's own inputs. Left a comment there pointing at the direct form.

Test plan

  • actionlint clean on both changed workflow files
  • prettier --check clean
  • A maintainer confirms the workflow_dispatch flow end-to-end against a real PR (resolving pr_number → checking out the right sha → posting a review that bypasses the dedup)

…nual force-review dispatch

Keying the concurrency group by pull request number let a later push's
review cancel an earlier push's still-in-flight review outright, with
nothing left to finish it. Sha-keying means two pushes' reviews never
share a group, so one can no longer cancel the other.

The direct form also gains a workflow_dispatch trigger accepting a
pr_number, so a fresh review of an already-reviewed commit can be
forced by hand -- useful after fixing a bug in the review prompt
itself, where the code hasn't changed but the review it would produce
now has. Dismissing a stale review doesn't retrigger anything on its
own, so without this there was no way to ask for a redo short of
pushing an empty commit.
…d sha

Same race as the direct form: keying by pull request number let a
later push's review cancel an earlier push's still-in-flight review,
losing it outright rather than just wasting a run. This form has no
equivalent force-review dispatch, since that needs an explicit
checkout ref and pr_number passed straight to the composite action,
which only the direct form can do without changing review.yml itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant