-
Notifications
You must be signed in to change notification settings - Fork 1
ci(v1.x): sync the #91 cancellation migration #220
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: v1.x
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 |
|---|---|---|
|
|
@@ -20,20 +20,21 @@ on: | |
| # bot-authored PRs (renovate, dependabot). See ai-review-prompts#38. | ||
| types: [opened, synchronize, reopened, ready_for_review, labeled] | ||
|
|
||
| concurrency: | ||
| group: claude-review-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
| # No concurrency block: cancellation is owned by the reusable's review | ||
| # job (job-level group, engaged only after authorization), so an | ||
| # unauthorized or skipped event can never cancel a legitimate review. | ||
|
|
||
| jobs: | ||
| review: | ||
| # Always-on toggle β see ai-review-prompts USAGE.md "Reviewers & the | ||
| # always-on toggle". CLAUDE_ALWAYS_ON=true (repo/org variable) β auto- | ||
| # review trusted-author PRs; unset β opt-in via the claude-review | ||
| # label. The reusable's authorize job still owns WHO is admitted. | ||
| # Note: the `claude-review` label name is matched there too β | ||
| # `_claude-review.yml`'s authorize `if:`, not in this caller. | ||
| if: ${{ vars.CLAUDE_ALWAYS_ON == 'true' || github.event.action == 'labeled' }} | ||
| uses: HarperFast/ai-review-prompts/.github/workflows/_claude-review.yml@be549ad08aa6d34b909ea8b542a7ffebdaae1e81 # main 2026-08-25 (#90 cost gates: draft skip, mechanical-diff skip, effort-by-size, debounce; #89 defaults; #88 lenses) | ||
| # Note: the `claude-review` label name is deliberately duplicated β | ||
| # the caller gate names it (below) AND the reusable's authorize | ||
| # matches it; renaming the label means changing both. | ||
| if: ${{ (github.event.action == 'labeled' && github.event.label.name == 'claude-review') || (github.event.action != 'labeled' && vars.CLAUDE_ALWAYS_ON == 'true') || (github.event.action == 'ready_for_review' && contains(github.event.pull_request.labels.*.name, 'claude-review')) }} | ||
|
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. π‘ Suggestion (non-blocking) β Simplify if-gate logic Use the proposed simplified logic to improve readability and ensure all relevant PR events are covered for both always-on and opt-in modes. |
||
| uses: HarperFast/ai-review-prompts/.github/workflows/_claude-review.yml@765a51b545f1b2b6c1ffe3b3731baa1512e44dac # main 2026-08-28 (#91 job-level post-authorization cancellation; #90 cost gates; #89 defaults; #88 lenses) | ||
| # Caller-side permissions, scoped at the calling-job level (NOT | ||
| # workflow-level β that placement caps the reusable's per-job | ||
| # grants below what they need and breaks the workflow at startup; | ||
|
|
@@ -58,7 +59,7 @@ jobs: | |
| # introspect their own ref (`github.workflow_ref` resolves to the | ||
| # CALLER's ref in `workflow_call` context), and `uses: β¦@<ref>` | ||
| # is parsed literally so we can't interpolate a variable. | ||
| ai-review-prompts-ref: be549ad08aa6d34b909ea8b542a7ffebdaae1e81 | ||
| ai-review-prompts-ref: 765a51b545f1b2b6c1ffe3b3731baa1512e44dac | ||
| review-layers: | | ||
| universal | ||
| harper/common | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,13 +27,9 @@ on: | |
| # lists the union and the `review` job gates on GEMINI_ALWAYS_ON. | ||
| types: [opened, synchronize, reopened, ready_for_review, labeled] | ||
|
|
||
| concurrency: | ||
| # Different group key from claude-review so the two providers can | ||
| # run in parallel on the same PR. cancel-in-progress is per-group, | ||
| # so a synchronize push cancels the in-flight Gemini run without | ||
| # touching the Claude run (and vice versa). | ||
| group: gemini-review-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
| # No concurrency block: cancellation is owned by the reusable's review | ||
| # job (job-level group, engaged only after authorization), so an | ||
| # unauthorized or skipped event can never cancel a legitimate review. | ||
|
|
||
| jobs: | ||
| review: | ||
|
|
@@ -42,10 +38,11 @@ jobs: | |
| # Gemini calibration baseline running on every PR; unset β opt-in via | ||
| # the gemini-review label. The reusable's authorize job still owns | ||
| # WHO is admitted (CODEOWNERS trust set; the labeler on `labeled`). | ||
| # Note: the `gemini-review` label name is matched there too β | ||
| # `_gemini-review.yml`'s authorize `if:`, not in this caller. | ||
| if: ${{ vars.GEMINI_ALWAYS_ON == 'true' || github.event.action == 'labeled' }} | ||
| uses: HarperFast/ai-review-prompts/.github/workflows/_gemini-review.yml@be549ad08aa6d34b909ea8b542a7ffebdaae1e81 # main 2026-08-25 (#90 cost gates: draft skip, mechanical-diff skip, effort-by-size, debounce; #89 defaults; #88 lenses) | ||
| # Note: the `gemini-review` label name is deliberately duplicated β | ||
| # the caller gate names it (below) AND the reusable's authorize | ||
| # matches it; renaming the label means changing both. | ||
| if: ${{ (github.event.action == 'labeled' && github.event.label.name == 'gemini-review') || (github.event.action != 'labeled' && vars.GEMINI_ALWAYS_ON == 'true') || (github.event.action == 'ready_for_review' && contains(github.event.pull_request.labels.*.name, 'gemini-review')) }} | ||
|
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. π΄ Blocker β Missing events in opt-in gate (Gemini) The if-gate still misses synchronize, opened, and reopened for labeled PRs when ALWAYS_ON is false. Use (github.event.action != 'labeled' && (vars.GEMINI_ALWAYS_ON == 'true' || contains(github.event.pull_request.labels.*.name, 'gemini-review'))) to cover all actions.
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. π‘ Suggestion (non-blocking) β Simplify if-gate logic Use the proposed simplified logic to improve readability and ensure all relevant PR events are covered for both always-on and opt-in modes. |
||
| uses: HarperFast/ai-review-prompts/.github/workflows/_gemini-review.yml@765a51b545f1b2b6c1ffe3b3731baa1512e44dac # main 2026-08-28 (#91 job-level post-authorization cancellation; #90 cost gates; #89 defaults; #88 lenses) | ||
| # Caller-side permissions, scoped at the calling-job level (NOT | ||
| # workflow-level β that placement caps the reusable's per-job | ||
| # grants below what they need and breaks the workflow at startup; | ||
|
|
@@ -67,7 +64,7 @@ jobs: | |
| # in this repo for why the duplication is unavoidable | ||
| # (reusable workflows can't introspect their own ref in | ||
| # workflow_call context). | ||
| ai-review-prompts-ref: be549ad08aa6d34b909ea8b542a7ffebdaae1e81 | ||
| ai-review-prompts-ref: 765a51b545f1b2b6c1ffe3b3731baa1512e44dac | ||
| review-layers: | | ||
| universal | ||
| harper/common | ||
|
|
||
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.
π΄ Blocker β Missing events in opt-in gate (Claude)
The if-gate still misses synchronize, opened, and reopened for labeled PRs when ALWAYS_ON is false. Use (github.event.action != 'labeled' && (vars.CLAUDE_ALWAYS_ON == 'true' || contains(github.event.pull_request.labels.*.name, 'claude-review'))) to cover all actions.