feat(ci): add path-based filtering to skip e2e on non-Go changes#332
Conversation
Add dorny/paths-filter to skip e2e tests when no Go source files change. The build-cli, integration-tests-unprivileged, and integration-tests jobs now only run when Go-related paths are modified. A ci-success gate job always runs and reports overall status, failing only if a required job failed (not if skipped).
- Add contents: read permission so actions/checkout works on push/ workflow_dispatch events - Check needs.changes.result in gate job to catch changes job failures - Use actions/checkout@v6 for consistency with rest of workflow
✅ Deploy Preview for devsydev canceled.
|
📝 WalkthroughWalkthroughThe PR modifies the CI workflow to detect changes to the workflow file itself, conditionally gate three main CI jobs when Go-related code changes are detected, and introduce a new aggregation job that validates the overall CI success without failing on skipped jobs. ChangesCI Workflow Change Detection and Job Gating
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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.
🧹 Nitpick comments (1)
.github/workflows/pr-ci.yml (1)
3-8: ⚡ Quick winConsider whether path-based filtering should apply to push events to main.
The workflow applies the same path-based filtering to
pushevents on themainbranch as it does to PRs. This means when a non-Go PR is merged to main, the subsequent push event won't run the full e2e test suite.Common patterns:
- PR CI: Selective (path-based) to save time and cost ✓
- Post-merge CI (push to main): Comprehensive to ensure main stays green
If the intent is to always validate main comprehensively, consider limiting the path filter to
pull_requestevents only, or running all jobs unconditionally for push events.Example: Limit filtering to pull_request events only
changes: runs-on: ubuntu-latest + if: github.event_name == 'pull_request' permissions: contents: readThen update the conditionals on gated jobs:
- if: needs.changes.outputs.go == 'true' + if: github.event_name != 'pull_request' || needs.changes.outputs.go == 'true'This would skip the jobs on PRs without Go changes, but always run them on push/workflow_dispatch.
Also applies to: 23-29
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/pr-ci.yml around lines 3 - 8, The push event is currently subject to the same path-based filters as pull_request which prevents full CI from running after merges to main; update the YAML so path filters (the paths: /paths-ignore: or paths: entries) apply only under the pull_request trigger and not under on: push (or alternatively remove path filtering from push so push to main always runs full jobs); edit the top-level triggers in the workflow to keep workflow_dispatch and pull_request with the path filter and make push: branches: [main] unconditional so post-merge pushes always execute the comprehensive e2e jobs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/pr-ci.yml:
- Around line 3-8: The push event is currently subject to the same path-based
filters as pull_request which prevents full CI from running after merges to
main; update the YAML so path filters (the paths: /paths-ignore: or paths:
entries) apply only under the pull_request trigger and not under on: push (or
alternatively remove path filtering from push so push to main always runs full
jobs); edit the top-level triggers in the workflow to keep workflow_dispatch and
pull_request with the path filter and make push: branches: [main] unconditional
so post-merge pushes always execute the comprehensive e2e jobs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0b08181d-d5f7-4ad4-80fa-04c3c8e67d1f
📒 Files selected for processing (1)
.github/workflows/pr-ci.yml
Summary
This allows non-Go PRs (docs, CI config, desktop) to merge without running the full 35+ e2e test suite, saving significant CI time and cost.
Summary by CodeRabbit