Skip to content

ci: skip expensive jobs on docs/planning-only PRs#195

Merged
FSM1 merged 3 commits into
mainfrom
chore/ci-path-skip
Feb 24, 2026
Merged

ci: skip expensive jobs on docs/planning-only PRs#195
FSM1 merged 3 commits into
mainfrom
chore/ci-path-skip

Conversation

@FSM1

@FSM1 FSM1 commented Feb 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds dorny/paths-filter@v3 to both CI and E2E workflows to detect what changed
  • Docs/planning-only PRs now only run lint + typecheck, skipping tests, builds, and desktop builds
  • Desktop jobs (Windows + macOS cargo check and Tauri build) only run when apps/desktop/, packages/crypto/, or the CI workflow itself changes
  • Push to main and workflow_dispatch always run all jobs as a safety net

Test plan

  • This PR itself modifies ci.yml so all jobs should run (validates workflow syntax)
  • Verify skipped jobs show as "Skipped" in the Actions tab, not "Pending"
  • Can test docs-only skip on a follow-up branch that only touches .md files

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Chores
    • Optimized CI/CD workflows to execute only affected jobs based on code changes, reducing build times and improving deployment efficiency.

Add dorny/paths-filter to detect changed paths and conditionally skip
heavy CI jobs (tests, builds, desktop builds) when only docs/planning
files change. Lint and typecheck always run. Push to main always runs
all jobs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 24, 2026

Copy link
Copy Markdown

Walkthrough

The changes introduce path-based filtering to two CI workflows using dorny/paths-filter. A new "Detect Changes" job categorizes modifications into src and desktop streams, with downstream jobs conditionally executing only when relevant changes are detected or on manual/push events, reducing unnecessary workflow runs.

Changes

Cohort / File(s) Summary
Workflow Path Filtering
.github/workflows/ci.yml, .github/workflows/e2e.yml
Added "Detect Changes" job using dorny/paths-filter to classify modifications into src and desktop streams. Downstream jobs (api-spec, test, build, cargo-check, build-desktop, E2E) now conditionally execute based on filter outputs, skipping runs when changes don't affect relevant areas.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding path-based filtering to skip expensive CI jobs when only docs or planning files change, which directly aligns with the changeset's core objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/ci-path-skip

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

FSM1 and others added 2 commits February 24, 2026 02:24
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: b28daa873b9e
@FSM1 FSM1 enabled auto-merge (squash) February 24, 2026 01:33

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
.github/workflows/ci.yml (1)

81-85: Inconsistent if guard: api-spec is missing the !failure() && !cancelled() check.

All other gated jobs (test, build, cargo-check-*, build-desktop-*) use the !failure() && !cancelled() prefix in their if conditions, but api-spec does not. Since api-spec only depends on changes, the practical impact is minimal — however, if changes were to fail on a push event, api-spec would still attempt to run (because github.event_name == 'push' is true), whereas the intent would typically be to skip.

For consistency and defensive correctness:

Suggested fix
   api-spec:
     name: Verify API Spec & Client
     needs: [changes]
     if: |
-      github.event_name == 'push' || needs.changes.outputs.src == 'true'
+      !failure() && !cancelled() &&
+      (github.event_name == 'push' || needs.changes.outputs.src == 'true')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 81 - 85, The api-spec job's if guard
lacks the defensive prefix used elsewhere; update the api-spec job (identifier:
api-spec) to prepend the same !failure() && !cancelled() check to its existing
condition so it becomes: evaluate !failure() && !cancelled() first and then
permit the job when either github.event_name == 'push' or
needs.changes.outputs.src == 'true' — ensure proper parentheses/grouping around
the OR expression to preserve logic.
.github/workflows/e2e.yml (1)

11-33: The src filter is duplicated from ci.yml.

The filter definition is identical to the one in ci.yml (lines 24-33). If a new docs/planning directory is added to the repo, both files need to be updated in sync. This is a known limitation of GitHub Actions. Consider extracting this into a reusable workflow that both workflows call, or at minimum add a comment in each file referencing the other to keep them in sync.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/e2e.yml around lines 11 - 33, The "src" paths-filter block
duplicated in the Detect Changes workflow (steps using dorny/paths-filter with
id: filter and outputs.src) should be centralized; either extract the filters
block into a reusable workflow that both this workflow (name: Detect Changes)
and ci.yml call, or at minimum add a clear comment in this workflow near the
dorny/paths-filter step referencing ci.yml so future changes stay in sync;
update the step using id: filter to call the new reusable workflow (or leave it
but add the cross-reference comment) and ensure outputs.src remains wired to the
step outputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 81-85: The api-spec job's if guard lacks the defensive prefix used
elsewhere; update the api-spec job (identifier: api-spec) to prepend the same
!failure() && !cancelled() check to its existing condition so it becomes:
evaluate !failure() && !cancelled() first and then permit the job when either
github.event_name == 'push' or needs.changes.outputs.src == 'true' — ensure
proper parentheses/grouping around the OR expression to preserve logic.

In @.github/workflows/e2e.yml:
- Around line 11-33: The "src" paths-filter block duplicated in the Detect
Changes workflow (steps using dorny/paths-filter with id: filter and
outputs.src) should be centralized; either extract the filters block into a
reusable workflow that both this workflow (name: Detect Changes) and ci.yml
call, or at minimum add a clear comment in this workflow near the
dorny/paths-filter step referencing ci.yml so future changes stay in sync;
update the step using id: filter to call the new reusable workflow (or leave it
but add the cross-reference comment) and ensure outputs.src remains wired to the
step outputs.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ceef72 and 3f123a7.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/e2e.yml

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