-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[improvement](workflow) Keep only latest code review per PR #67119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,19 +55,27 @@ permissions: | |
| jobs: | ||
| code-review: | ||
| runs-on: ubuntu-latest | ||
| concurrency: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Preserve status ownership across manual supersession This shared group includes issue-comment runs, which always manage the |
||
| group: code-review-${{ inputs.pr_number || github.event.issue.number || github.run_id }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Canonicalize the PR number before admission
|
||
| cancel-in-progress: true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Make expected supersession cancellation-safe Once a running review has resolved its inputs, a newer request cancels the review step, but the existing |
||
| # Pre-finalization steps can use 183 minutes and auth sync can use 8 more, | ||
| # leaving 12 minutes for runner setup and post-job cleanup. | ||
| timeout-minutes: 203 | ||
| # Retry with a new /review request so an older workflow rerun cannot replace | ||
| # the latest review for the same PR. | ||
| if: >- | ||
| inputs.pr_number != '' || | ||
| github.run_attempt == 1 && | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Fence by logical request order, not concurrency admission order
|
||
| ( | ||
| github.event_name == 'issue_comment' && | ||
| github.event.issue.pull_request && | ||
| startsWith(github.event.comment.body, '/review') && | ||
| inputs.pr_number != '' || | ||
| ( | ||
| github.event.comment.author_association == 'MEMBER' || | ||
| github.event.comment.author_association == 'OWNER' || | ||
| github.event.comment.author_association == 'COLLABORATOR' | ||
| github.event_name == 'issue_comment' && | ||
| github.event.issue.pull_request && | ||
| startsWith(github.event.comment.body, '/review') && | ||
| ( | ||
| github.event.comment.author_association == 'MEMBER' || | ||
| github.event.comment.author_association == 'OWNER' || | ||
| github.event.comment.author_association == 'COLLABORATOR' | ||
| ) | ||
| ) | ||
| ) | ||
| steps: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Keep historical reruns out of the current-PR group
These groups are keyed only by PR number, so rerunning an older workflow attempt after head B's check starts lets the old attempt join the same group and cancel (or replace while pending) B's validation. GitHub reruns retain the original
GITHUB_SHA/GITHUB_REF, so the replacement still checks head A and cannot restore validation for B. The same issue is present in the new Clang Formatter, Gitleaks, and License Check blocks. Please isolategithub.run_attempt > 1with a run-unique group such asgithub.run_id; changing onlycancel-in-progressdoes not protect a pending current-head job because the default queue replaces an existing pending member.