Skip to content

ci: skip CI jobs when unaffected by changed paths#1380

Open
mishushakov wants to merge 7 commits into
mainfrom
mishushakov/conditional-ci-jobs
Open

ci: skip CI jobs when unaffected by changed paths#1380
mishushakov wants to merge 7 commits into
mainfrom
mishushakov/conditional-ci-jobs

Conversation

@mishushakov
Copy link
Copy Markdown
Member

Adds a dorny/paths-filter change-detection job to the PR-triggered workflows so jobs only run when relevant paths change: Lint/Typecheck run only when package code, spec, or lint configs change; Generated files runs only when codegen inputs/outputs change; and the JS/Python/CLI SDK tests run only when the respective SDK changes (CLI also runs on JS SDK changes since it builds against it). The SDK test jobs are gated inside the reusable workflows via a new run input rather than by skipping the caller, so the required matrix status checks still report (skipped jobs report success) and branch protection stays satisfied. Shared paths (spec, lockfiles, package.json, .tool-versions) and workflow_dispatch runs still trigger everything.

🤖 Generated with Claude Code

Add a dorny/paths-filter "changes" detection job to the PR-triggered
workflows so jobs only run when relevant paths change:

- Lint / Typecheck: only when package code, spec, or lint configs change
- Generated files: only when codegen inputs/outputs change
- JS / Python / CLI SDK tests: only when the respective SDK changes
  (CLI also runs when the JS SDK changes, since it builds against it)

The SDK test jobs are gated inside the reusable workflows via a new
`run` input so the required matrix status checks still report (skipped
jobs report success), keeping branch protection satisfied.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cla-bot cla-bot Bot added the cla-signed label Jun 2, 2026
@cursor
Copy link
Copy Markdown

cursor Bot commented Jun 2, 2026

PR Summary

Medium Risk
Skipping lint, typecheck, codegen, or SDK tests on unrelated PRs can miss regressions if path filters are incomplete; SDK tests still run on shared paths and manual dispatch.

Overview
PRs now run path-based CI via dorny/paths-filter: Lint, Typecheck, and Generated files only execute when their configured paths change; SDK Tests classifies JS, Python, and CLI (CLI also keys off packages/js-sdk/**) and passes a boolean run into each reusable test workflow.

Reusable JS / Python / CLI workflows gain a run input (default true) and gate the matrix job with if: inputs.run, so callers can skip real work while still invoking the workflow—keeping required check names green when paths are untouched. workflow_dispatch on SDK tests bypasses filtering and runs everything; the filter step runs only on pull_request to avoid dispatch failures without a PR diff.

Reviewed by Cursor Bugbot for commit e430fc8. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2026

⚠️ No Changeset found

Latest commit: e430fc8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Package Artifacts

Built from 075fdf1. Download artifacts from this workflow run.

JS SDK (e2b@2.27.2-mishushakov-conditional-ci-jobs.0):

npm install ./e2b-2.27.2-mishushakov-conditional-ci-jobs.0.tgz

CLI (@e2b/cli@2.10.4-mishushakov-conditional-ci-jobs.0):

npm install ./e2b-cli-2.10.4-mishushakov-conditional-ci-jobs.0.tgz

Python SDK (e2b==2.25.1+mishushakov-conditional-ci-jobs):

pip install ./e2b-2.25.1+mishushakov.conditional.ci.jobs-py3-none-any.whl

Comment thread .github/workflows/sdk_tests.yml
mishushakov and others added 2 commits June 2, 2026 15:36
dorny/paths-filter falls back to git commands on non-PR events, which
fails without a checkout. Guard the filter step to pull_request only; the
run inputs already force a full run on workflow_dispatch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mishushakov mishushakov marked this pull request as ready for review June 2, 2026 14:52
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68854cbb35

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/generated_files.yml Outdated
Comment thread .github/workflows/sdk_tests.yml
Comment thread .github/workflows/generated_files.yml Outdated
mishushakov and others added 2 commits June 2, 2026 18:22
Enumerating individual generated outputs was fragile and missed the
Python volume/mcp codegen targets. Generated files are interleaved with
hand-written code inside the SDK source trees, so watch the whole trees
to catch drift without maintaining a per-file allowlist.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Simpler and fully robust: any package change re-verifies generated code
is in sync, with no per-path allowlist to maintain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 530b52d. Configure here.

Comment thread .github/workflows/generated_files.yml
The codegen toolchain versions are pinned via the lockfile/package.json
and .tool-versions, so a dependency-only PR can change generated output.
Watch the same shared paths as the lint/typecheck/sdk-tests filters.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mishushakov mishushakov enabled auto-merge (squash) June 4, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant