Skip to content

ci(review): review a PR retargeted onto master or marked ready - #7085

Merged
otavio merged 1 commit into
masterfrom
ci/review-trigger-base-change
Sep 12, 2026
Merged

ci(review): review a PR retargeted onto master or marked ready#7085
otavio merged 1 commit into
masterfrom
ci/review-trigger-base-change

Conversation

@otavio

@otavio otavio commented Sep 12, 2026

Copy link
Copy Markdown
Member

What

Adds ready_for_review and edited to the review workflow's pull_request_target trigger, so
a PR retargeted onto master or marked ready gets the automatic review it currently misses.

Why

#7084 never got an automatic review. It was opened at 22:01:33 against the branch of #7079,
#7079 merged two seconds later, and GitHub retargeted it onto master at 22:01:37
(automatic_base_change_succeeded). Three filters in sequence let it through:

  1. the opened event carried the old base, so branches: [master] excluded it — no run was
    queued, not skipped;
  2. the retarget arrives as edited, which the workflow did not listen for;
  3. the force-push that followed is synchronize, deliberately excluded so the author drives
    re-review.

It only got reviewed because its author commented /review. Any PR stacked on another sees the
same thing the moment the parent merges.

Changes

  • edited gated on changes.base: a retarget re-triggers the review, while editing a title
    or a description does not spend one. The branches: [master] filter is evaluated against the
    new base, so only PRs that land on master qualify.
  • ready_for_review: closes the sibling hole. A PR opened as a draft is filtered by the
    !draft check at opened, and nothing re-triggers it once it is ready.
  • cancel-in-progress carries the same guard: concurrency is workflow-level and evaluated
    when a run is created, before any job if:. Gating only the job would let a title or body edit
    create a run that cancels an in-flight review and then skip its own — no review at all, and the
    retarget case this PR exists for would die to the author's next title edit. The other triggers
    cannot produce an edited action, so their runs keep cancelling as they do today.
  • synchronize stays out, unchanged.

Paired with shellhub-io/cloud#2555, which makes the identical change to the same workflow there.

Testing

actionlint is clean. The trigger cannot be exercised before merge — the workflow that runs is
the one on the base branch, so pull_request_target changes only take effect once they are on
master. The check after merging is a PR stacked on another: merge the parent and confirm a
review starts without anyone commenting /review.

@otavio
otavio requested a review from a team as a code owner September 12, 2026 23:28
@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown

Claude finished @otavio's task in 2m 29s —— View job


Code Review Complete

Reviewed 1 file. 2 inline issues posted — Standards: 0 violations, 1 judgement call. Spec: 0. Correctness: 1.

Standards

The repo rules are clean — the deleted comment had gone stale and the reason it carried (why synchronize stays out, why edited is gated on changes.base) lands in the commit message in full, which is exactly what code-style.md asks for. The one judgement call is at line 6: cloud/.github/workflows/claude-code-review.yml is the same workflow and still carries the pre-PR trigger policy, so the fix lands on one side of a deliberately paired file.

Correctness

Line 25 — the gate is a job-level if:, but concurrency is evaluated before it, so a title or body edit now creates a run that cancels an in-flight review and then skips its own job, leaving no review and no finalize. It also defeats this PR's own case: a retarget starts a review, and the author's next title edit kills it.

Verified clean: the changes.base != null idiom (true for a retarget, false for a title/body edit, harmless on opened/ready_for_review, and unable to affect the /review clauses); branches: [master] evaluated against the new base, including the retarget-away-from-master inverse; pull_request.draft being false in the ready_for_review payload; and the widened trigger adding no exposure beyond what opened already grants a fork author.

Spec

The Spec axis did not run — the PR references PRs #7084 and #7079 but no issue, so there is no spec to review against.


To request another review round, comment /review.
· branch ci/review-trigger-base-change

Comment thread .github/workflows/claude-code-review.yml
Comment thread .github/workflows/claude-code-review.yml
A stacked PR never got an automatic review. #7084 was opened against the branch of #7079 at
22:01:33, #7079 merged two seconds later, and GitHub retargeted #7084 onto master at 22:01:37.
The opened event carried the old base, so branches: [master] filtered it out and no run was ever
queued; the retarget arrives as edited, which nothing listened for; and the force-push that
followed is synchronize, which stays excluded so the author drives re-review. The PR fell through
every trigger and only got a review when its author asked for one by hand.

edited covers the retarget, gated on changes.base so editing a title or a description does not
spend a review. ready_for_review closes the sibling hole, where a PR opened as a draft is filtered
by the draft check at open and has nothing to re-trigger it once it is ready.

The same guard has to sit on cancel-in-progress, not only on the job. A run joins the concurrency
group and cancels the one in flight before any job-level if: is evaluated, so gating the job alone
would let a title edit cancel a running review and then skip its own, leaving no review at all —
and it would defeat this change's own case, where a retarget starts a review that the author's
next title edit kills. The other triggers cannot produce an edited action, so their runs keep
cancelling as they do today.

The comment saying the review runs only on open went with the change that made it false.
@otavio
otavio force-pushed the ci/review-trigger-base-change branch from 5708f78 to 4e4f911 Compare September 12, 2026 23:38
@otavio

otavio commented Sep 12, 2026

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown

Code Review Complete

The automated review ran but did not post an updated summary — this usually means no new issues were found since the previous review. If you've pushed changes and want a fresh pass, comment /review.

View job

@otavio
otavio merged commit f54a2de into master Sep 12, 2026
73 of 102 checks passed
@otavio
otavio deleted the ci/review-trigger-base-change branch September 12, 2026 23:49
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