fix(ci): Add CODEOWNERS fastpath to selective testing#109163
Merged
fix(ci): Add CODEOWNERS fastpath to selective testing#109163
Conversation
CODEOWNERS changes were triggering a full backend test suite because the file doesn't appear in coverage data. Map it directly to its only known test dependency (tests/sentry/api/test_api_owners.py) so selective testing runs just that one test instead of ~22 shards.
rbro112
approved these changes
Feb 24, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
.github/CODEOWNERSis listed infile-filters.ymlas abackend_srctrigger becausetests/sentry/api/test_api_owners.pyvalidates it. However, since CODEOWNERS isn't a Python source file, it never appears in coverage data — so selective testing can't find any matching tests and falls back to running the entire backend suite (~22 shards).This adds an
EXTRA_FILE_TO_TEST_MAPPINGdict that maps non-source files to their known test dependencies. When a mapped file is changed, its associated tests are added directly to the selected set, avoiding the full suite fallback.Currently maps:
.github/CODEOWNERS→tests/sentry/api/test_api_owners.pyThe mapping is extensible for any other non-source files with known test dependencies in the future.