Skip to content

fix(ci): Add CODEOWNERS fastpath to selective testing#109163

Merged
joshuarli merged 1 commit intomasterfrom
fix/selective-testing-codeowners-fastpath
Feb 24, 2026
Merged

fix(ci): Add CODEOWNERS fastpath to selective testing#109163
joshuarli merged 1 commit intomasterfrom
fix/selective-testing-codeowners-fastpath

Conversation

@joshuarli
Copy link
Member

Summary

.github/CODEOWNERS is listed in file-filters.yml as a backend_src trigger because tests/sentry/api/test_api_owners.py validates 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_MAPPING dict 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/CODEOWNERStests/sentry/api/test_api_owners.py

The mapping is extensible for any other non-source files with known test dependencies in the future.

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.
@joshuarli joshuarli requested a review from a team as a code owner February 24, 2026 00:16
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 24, 2026
@joshuarli joshuarli requested a review from rbro112 February 24, 2026 00:18
@joshuarli joshuarli merged commit 60c3f84 into master Feb 24, 2026
100 checks passed
@joshuarli joshuarli deleted the fix/selective-testing-codeowners-fastpath branch February 24, 2026 23:37
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants