Skip to content

feat(ci): Add file change detection to workflows - #7524

Draft
safina57 wants to merge 2 commits into
getsentry:masterfrom
safina57:ci/skip-tests-on-docs-only-changes
Draft

safina57 wants to merge 2 commits into
getsentry:masterfrom
safina57:ci/skip-tests-on-docs-only-changes

Conversation

@safina57

Copy link
Copy Markdown

Description

Adds a files-changed job to the test orchestrator that detects whether a PR touches anything beyond docs (markdown, docs/, LICENSE, .agents/, issue templates, CODEOWNERS). Each test group, and the coverage report job, now needs it and only runs when code changed. Docs-only PRs skip every group; check-required still reports, so the required status check keeps working. Pushes to master and release branches always run the full suite.

Tested on my fork with mock PRs: a CHANGELOG.md-only change skipped all groups and the coverage report while "All tests passed" stayed green, and a pyproject.toml-only change ran the full suite.

Issues

@alexander-alderman-webb

Copy link
Copy Markdown
Contributor

This won't work because the tests are required jobs.

@safina57

Copy link
Copy Markdown
Author

@alexander-alderman-webb the only test-related required check is All tests passed, not the individual groups and that job keeps if: always() and isn't gated on files-changed, so it always runs and reports, skipped groups don't count as failure/cancelled, so it goes green on docs-only PRs. The report job is gated too so it doesn't try to combine non-existent coverage, verified this by making a change in a **.md file where PR skipped all groups and All tests passed succeeded, https://github.com/safina57/sentry-python/actions/runs/35128371710, and another one where I made a change on pyproject.toml and the gate worked as intended https://github.com/safina57/sentry-python/actions/runs/35128878739/job/104904614766

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.

Do not run tests when only documentation is changed

2 participants