Skip to content

Add skip-if-no-relevant-changes gate for expensive CI tests#12940

Draft
ericholscher wants to merge 3 commits intomainfrom
claude/conditional-ci-stages-zJ6q1
Draft

Add skip-if-no-relevant-changes gate for expensive CI tests#12940
ericholscher wants to merge 3 commits intomainfrom
claude/conditional-ci-stages-zJ6q1

Conversation

@ericholscher
Copy link
Copy Markdown
Member

@ericholscher ericholscher commented Apr 14, 2026

Summary

CircleCI tests (tests, tests-proxito, tests-search, tests-embedapi) are now gated behind a single skip-if-no-relevant-changes command. Each job declares an allow-list regex of paths whose changes should trigger it; if no changed file matches, the job is halted on PR branches. main always runs the full matrix.

Job paths
tests ^readthedocs/
tests-proxito ^readthedocs/
tests-search ^readthedocs/(search/|projects/|proxito/|builds/|subscriptions/)
tests-embedapi ^readthedocs/(embed/|doc_builder/|projects/)

The narrow patterns for tests-search / tests-embedapi were derived by grepping the actual from readthedocs.* imports under each test directory.

Infrastructure changes (.circleci/, requirements/, tox*.ini, common/, pyproject.toml, readthedocs/settings/, readthedocs/conftest.py, readthedocs/rtd_tests/) always force every job to run, regardless of the job's allow pattern — so shared deps and test helpers can't silently break a suite. Docs-only, README-only, .github/-only, and media/-only PRs are halted everywhere, replacing the old skip-if-docs-only command.

circleci-agent step halt ends a job successfully, so coverage-report (which requires: tests-search) still runs; its existing ls .coverage.* 1>/dev/null 2>&1 guard handles the missing .coverage.search file and uploads a partial report.


Generated by Copilot.

claude added 3 commits April 14, 2026 04:19
These Stage 2 jobs (Elasticsearch sidecar / 6 Sphinx versions) are
expensive and don't need to run when the PR doesn't touch the logic
they exercise. Add a parameterized skip-if-no-relevant-changes command
that halts the job unless the diff against origin/main matches a path
pattern — with an infrastructure override (CI config, requirements,
tox, settings, shared test helpers) that always forces a run.
Adds a project-level SessionStart hook that fetches
readthedocs/common's copilot-instructions.md and injects it into
the session context, so Claude Code sessions in this repo always
have the live agent guidance loaded instead of just a pointer URL
in CLAUDE.md.
One mechanism for every job. General jobs (tests, tests-proxito) pass
'^readthedocs/' as their allow pattern, which halts docs-only,
README-only, .github-only, and media-only PRs while still running on
any real code change. The infra fallback inside the command continues
to force a run for requirements/, tox, settings, etc.

The previous skip-if-docs-only had become redundant on tests-search and
tests-embedapi, since their narrow allow patterns already exclude docs.
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.

2 participants