Fix CI checks to run in merge queue - #1654
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds Changes
Sequence Diagram(s)sequenceDiagram
participant MergeQueue as Merge Queue (merge_group)
participant GHRunner as GitHub Actions Runner
participant Fetch as fetch-main / set-shas
participant Diff as changed-files / git-diff
participant Nx as Nx affected/base/head
participant Jobs as CI Jobs (build/test/lint)
participant Codecov as Codecov
MergeQueue->>GHRunner: Trigger workflows (event: merge_group)
GHRunner->>Fetch: run fetch-main & set-shas (determine base/head)
Fetch->>GHRunner: outputs.base_sha, outputs.head_sha
GHRunner->>Diff: compute BASE_REF and git diff (markdown filters)
GHRunner->>Nx: run affected commands using set-shas outputs
GHRunner->>Jobs: execute jobs with merge_group-specific gating
Jobs->>Codecov: conditionally upload (skip when merge_group)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/docs-style-check.yml (1)
45-52:⚠️ Potential issue | 🟡 Minor
github-pr-checkreporter may have limited functionality inmerge_groupcontext.The
reporter: github-pr-checkoption creates inline annotations on pull requests. Duringmerge_groupevents, this reporter may not function as expected since the PR context differs. Consider whether this is acceptable or if you need conditional reporter selection.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/docs-style-check.yml around lines 45 - 52, The Vale action step ("🔍 Run Vale" using errata-ai/[email protected]) currently hard-codes reporter: github-pr-check which can fail for merge_group/other event contexts; update the workflow to choose the reporter conditionally (e.g., use github-pr-check only when github.event_name == 'pull_request' or when running in a PR context, and fall back to a different reporter like 'github' or 'console' otherwise) so the step behaves correctly across merge_group runs; locate the step by its name/uses and change how the reporter input is set (conditional input or separate steps) to ensure annotations are produced only when PR context supports them.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/docs-style-check.yml:
- Line 11: The workflow currently uses github.base_ref when building the git
diff for the merge_group run, but github.base_ref is undefined for merge_group
events; update the git diff logic (the step that constructs origin/${{
github.base_ref }}...HEAD) to conditionally use
github.event.merge_group.base_ref when the event is merge_group (i.e., detect
github.event_name == 'merge_group' or check existence of
github.event.merge_group.base_ref) and fall back to github.base_ref otherwise,
ensuring the git diff command uses either github.event.merge_group.base_ref or
github.base_ref appropriately.
---
Outside diff comments:
In @.github/workflows/docs-style-check.yml:
- Around line 45-52: The Vale action step ("🔍 Run Vale" using
errata-ai/[email protected]) currently hard-codes reporter: github-pr-check
which can fail for merge_group/other event contexts; update the workflow to
choose the reporter conditionally (e.g., use github-pr-check only when
github.event_name == 'pull_request' or when running in a PR context, and fall
back to a different reporter like 'github' or 'console' otherwise) so the step
behaves correctly across merge_group runs; locate the step by its name/uses and
change how the reporter input is set (conditional input or separate steps) to
ensure annotations are produced only when PR context supports them.
ℹ️ Review info
Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ca7950bc-21d4-48dd-92aa-7307e94be8ee
📒 Files selected for processing (3)
.github/workflows/docs-style-check.yml.github/workflows/pr-builder.yml.github/workflows/pr-label-check.yml
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1654 +/- ##
==========================================
+ Coverage 91.18% 91.20% +0.01%
==========================================
Files 715 715
Lines 48419 48419
==========================================
+ Hits 44152 44159 +7
+ Misses 2841 2835 -6
+ Partials 1426 1425 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
686bd6c to
d5d7634
Compare
d5d7634 to
8b53003
Compare
8b53003 to
94f5002
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/pr-builder.yml (1)
100-116:⚠️ Potential issue | 🔴 CriticalThe
dependency-review-actionis missing required parameters formerge_groupevents and will fail.The
dependency-review-actiononly auto-detects base and head refs onpull_request/pull_request_targetevents. Formerge_groupevents, you must explicitly passbase-refandhead-ref, or the action will fail with "Both a base ref and head ref must be provided". Additionally,comment-summary-in-pr: alwayswon't work correctly onmerge_groupsince those events don't include full PR context.🔧 Proposed fix
- name: 🔎 Dependency Review uses: actions/dependency-review-action@v4 with: fail-on-severity: high deny-licenses: GPL-3.0-only,GPL-3.0-or-later,AGPL-3.0-only,AGPL-3.0-or-later + base-ref: ${{ github.event.merge_group.base_sha || github.event.pull_request.base.sha }} + head-ref: ${{ github.event.merge_group.head_sha || github.event.pull_request.head.sha }} - comment-summary-in-pr: always + comment-summary-in-pr: ${{ github.event_name == 'pull_request' && 'always' || 'never' }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr-builder.yml around lines 100 - 116, The Dependency Review step using actions/dependency-review-action@v4 fails for merge_group events because base/head refs and PR context are not auto-detected; update the "🔎 Dependency Review" step to explicitly supply base-ref and head-ref when github.event_name == 'merge_group' (e.g., base-ref: ${{ github.event.pull_request.base.ref }} and head-ref: ${{ github.event.pull_request.head.ref }} or equivalent fields from the merge_group payload) and make comment-summary-in-pr conditional (disable or set to 'never' for merge_group) so the action has required refs and does not attempt to post a PR summary when PR context is missing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In @.github/workflows/pr-builder.yml:
- Around line 100-116: The Dependency Review step using
actions/dependency-review-action@v4 fails for merge_group events because
base/head refs and PR context are not auto-detected; update the "🔎 Dependency
Review" step to explicitly supply base-ref and head-ref when github.event_name
== 'merge_group' (e.g., base-ref: ${{ github.event.pull_request.base.ref }} and
head-ref: ${{ github.event.pull_request.head.ref }} or equivalent fields from
the merge_group payload) and make comment-summary-in-pr conditional (disable or
set to 'never' for merge_group) so the action has required refs and does not
attempt to post a PR summary when PR context is missing.
ℹ️ Review info
Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b7813212-417a-46bc-9ce3-cde7eca82462
📒 Files selected for processing (3)
.github/workflows/docs-style-check.yml.github/workflows/pr-builder.yml.github/workflows/pr-label-check.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/pr-label-check.yml
94f5002 to
2042d86
Compare
2042d86 to
17cfd19
Compare
4365d1d to
c579a27
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
codecov.yml (1)
61-61: Ensure required coverage checks still match your enforcement intent.At Line 61 and Line 98, default project/patch statuses are now informational, so they won’t block merges. If coverage must remain enforced, make sure branch protection requires the non-informational flag-specific statuses.
Also applies to: 98-98
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@codecov.yml` at line 61, The codecov.yml currently sets coverage statuses to non-blocking by using "informational: true" for the project and patch statuses; either change those flags to "informational: false" in the codecov.yml entries that define the project and patch status checks (search for the "informational: true" lines and the surrounding "project" and "patch" status blocks) to make coverage checks blocking again, or keep them informational and update your branch protection rules in your repository settings to require the corresponding Codecov status checks instead..github/workflows/pr-builder.yml (1)
134-135: Avoid fail-open behavior when fetching main for Nx base calculation.Line 135 uses
|| true, which can mask fetch failures and lead to incorrect affected-range computation.Proposed adjustment
- - name: 🔄 Fetch main branch for Nx affected base - run: git fetch origin main:main --update-head-ok || true + - name: 🔄 Fetch main branch for Nx affected base + run: | + for i in 1 2 3; do + git fetch origin main:main --update-head-ok && exit 0 + sleep 2 + done + echo "Failed to fetch main after retries." + exit 1🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr-builder.yml around lines 134 - 135, The git fetch invocation currently uses a fail-open pattern ("git fetch origin main:main --update-head-ok || true") which can hide failures and produce incorrect Nx affected-range calculations; update the fetch step used in the workflow by removing the "|| true" fallback so that the step fails on fetch errors (or replace it with an explicit retry/exit-on-failure strategy), ensuring the command referenced ("git fetch origin main:main --update-head-ok") returns a nonzero exit code on failure and the workflow/job halts so Nx's base calculation runs against a valid main branch state.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/pr-builder.yml:
- Line 102: The dependency-review-action@v4 step needs explicit base-ref and
head-ref inputs when run by non-pull_request events (like merge_group); update
the "🔎 Dependency Review" step that uses actions/dependency-review-action@v4 to
add with inputs base-ref and head-ref using the merge_group fallback expressions
(use github.event.merge_group.base_sha || github.event.pull_request.base.sha for
base-ref and github.event.merge_group.head_sha ||
github.event.pull_request.head.sha for head-ref) alongside the existing
fail-on-severity, deny-licenses, and comment-summary-in-pr settings so the
action works for both pull_request and merge_group triggers.
- Line 717: The paths-filter@v3 step is missing explicit base/ref inputs needed
for correct detection on merge_group events; update the step's with block for
the paths-filter action (the paths-filter@v3 step) to include base and ref using
the provided conditional expressions so merge_group uses
github.event.merge_group.base_sha and github.sha while pull_request uses
pull_request.base.sha and pull_request.head.sha (i.e., add base: ${{
github.event_name == 'merge_group' && github.event.merge_group.base_sha ||
github.event.pull_request.base.sha }} and ref: ${{ github.event_name ==
'merge_group' && github.sha || github.event.pull_request.head.sha }}).
---
Nitpick comments:
In @.github/workflows/pr-builder.yml:
- Around line 134-135: The git fetch invocation currently uses a fail-open
pattern ("git fetch origin main:main --update-head-ok || true") which can hide
failures and produce incorrect Nx affected-range calculations; update the fetch
step used in the workflow by removing the "|| true" fallback so that the step
fails on fetch errors (or replace it with an explicit retry/exit-on-failure
strategy), ensuring the command referenced ("git fetch origin main:main
--update-head-ok") returns a nonzero exit code on failure and the workflow/job
halts so Nx's base calculation runs against a valid main branch state.
In `@codecov.yml`:
- Line 61: The codecov.yml currently sets coverage statuses to non-blocking by
using "informational: true" for the project and patch statuses; either change
those flags to "informational: false" in the codecov.yml entries that define the
project and patch status checks (search for the "informational: true" lines and
the surrounding "project" and "patch" status blocks) to make coverage checks
blocking again, or keep them informational and update your branch protection
rules in your repository settings to require the corresponding Codecov status
checks instead.
ℹ️ Review info
Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 07ebccc6-9fa9-4edc-a8fe-01b10aa61d23
📒 Files selected for processing (4)
.github/workflows/docs-style-check.yml.github/workflows/pr-builder.yml.github/workflows/pr-label-check.ymlcodecov.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/pr-label-check.yml
c579a27 to
6ad564b
Compare
6ec83c7
6ad564b to
6ec83c7
Compare
| run: | | ||
| cd frontend | ||
| pnpm nx affected --target=lint --parallel=3 --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} | ||
| pnpm nx affected --target=lint --parallel=3 --base=${{ steps.set-shas.outputs.base }} --head=${{ steps.set-shas.outputs.head }} |
There was a problem hiding this comment.
Seems to be an unrelated change but seems like its valid. Lets see if cache is working properly
6ec83c7 to
c35d1e0
Compare
Purpose
This pull request updates several GitHub Actions workflow files to support the new
merge_groupevent, which is triggered by GitHub's merge queue feature. This ensures that our CI/CD pipelines and checks will run correctly when changes are merged via the queue, not just on traditional pull requests. The main changes involve updating workflow triggers and job conditions to includemerge_groupalongsidepull_request.Workflow trigger updates:
merge_groupas a trigger in.github/workflows/pr-builder.yml,.github/workflows/pr-label-check.yml, and.github/workflows/docs-style-check.ymlto ensure workflows run for merge queue events. [1] [2] [3]Job condition updates:
ifconditions for jobs likesecurity-audit,dependency-review,lint,build,test-frontend,build_samples, anddetect-powershell-changesin.github/workflows/pr-builder.ymlto run for bothpull_requestandmerge_groupevents. This guarantees that all relevant CI checks are performed for merge queue entries. [1] [2] [3] [4] [5] [6] [7]PR label check workflow:
check-labelsjob in.github/workflows/pr-label-check.ymlonly runs forpull_requestevents, even though the workflow is triggered formerge_groupas well, to avoid unnecessary label checks for merge queue events.These changes improve compatibility with GitHub's merge queue and ensure our workflows remain robust and reliable.
Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks
Summary by CodeRabbit