Add skip-if-no-relevant-changes gate for expensive CI tests#12940
Draft
ericholscher wants to merge 3 commits intomainfrom
Draft
Add skip-if-no-relevant-changes gate for expensive CI tests#12940ericholscher wants to merge 3 commits intomainfrom
ericholscher wants to merge 3 commits intomainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CircleCI tests (
tests,tests-proxito,tests-search,tests-embedapi) are now gated behind a singleskip-if-no-relevant-changescommand. 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.mainalways runs the full matrix.pathstests^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-embedapiwere derived by grepping the actualfrom 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, andmedia/-only PRs are halted everywhere, replacing the oldskip-if-docs-onlycommand.circleci-agent step haltends a job successfully, socoverage-report(whichrequires: tests-search) still runs; its existingls .coverage.* 1>/dev/null 2>&1guard handles the missing.coverage.searchfile and uploads a partial report.Generated by Copilot.