◐ Shell
clean mode source ↗

ci: Skip test suite when no code files changed by stephanie-anderson · Pull Request #5889 · getsentry/sentry-python

Add a `changes` detection job using dorny/paths-filter to all test
workflows and ci.yml. Tests are only triggered when code-relevant
files are modified (*.py, *.cfg, *.toml, *.ini, sentry_sdk/**, tests/**,
scripts/**, Makefile, .github/workflows/**).

PRs that only touch non-code files (e.g. README.md) will skip the
full test matrix, saving CI resources. Pushes to master/release
branches always run the full suite.

The gate jobs ("All X tests passed") now accept `skipped` as a valid
result so required status checks still pass when tests are skipped.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

sentry-warden[bot]

Bot reviewed Mar 26, 2026

- Add requirements*.txt to path filters so dependency changes trigger CI
- Gate job now also fails if the changes detection job itself fails,
  preventing untested code from passing CI when change detection errors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Direct pushes to master are not allowed, so there's no need to
force-run the full suite on push events. The paths-filter action
now runs unconditionally for both push and pull_request events.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

sentry-warden[bot]

Explicitly check for failure and cancelled states instead of
excluding success and skipped. This fixes a bug where a cancelled
changes job would let the gate pass silently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Same pattern as the test workflows — a gate job that always runs
and explicitly checks for failure/cancelled states on all CI jobs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>