Repository navigation
ci(acceptance): Select acceptance tests on pull requests - #131325
Merged
Merged
Conversation
Pull requests now run only the acceptance tests that their changes can reach. Frontend changes map through a static import graph and a test-to-page map, Python changes through per-test coverage that a daily scheduled acceptance run records, and changed tests run themselves. Build, harness, dependency, and app-shell changes run the whole suite, and so does any failure to select. Pushes to master always run the whole suite, so a test that selection misses fails there. Refs DI-2876 Co-Authored-By: Joshua Li <[email protected]>
An unset job output is null, and null == '0' in workflow expressions, so the whole-suite fallback skipped acceptance instead of running it. Co-Authored-By: Joshua Li <[email protected]>
A comment body can no longer match across its closing */, so the pattern has one way to match each comment. Co-Authored-By: Joshua Li <[email protected]>
The backend and acceptance selectors now share selected_tests_common.py: the Python full-suite triggers, trigger matching, and the per-test coverage query. Acceptance reuses parse-pr-files.py and the skip_selective_testing output from backend.yml for changed files and the override label. The four shell scripts are gone. The run step keeps its inline shell with one more line for the coverage flags. Coverage moves from an artifact lookup to actions/cache, saved only when every shard passed, and shards are combined with one inline coverage call. Refs DI-2876 Co-Authored-By: Joshua Li <[email protected]>
joshuarli
marked this pull request as ready for review
November 16, 2026 23:52
joshuarli
approved these changes
Nov 16, 2026
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 985b7f2. Configure here.
joshuarli
added a commit
that referenced
this pull request
Nov 17, 2026
Adding `Trigger: Override Selective Testing` to a pull request now starts a full acceptance run right away. Before, it only took effect on the next push, because the `pull_request` trigger in `acceptance.yml` left out `labeled`. Workflow triggers can't filter by label name, so every label event starts a run: - **Override label:** the run behaves like a push and runs the full suite. It shares the PR's concurrency group, so it cancels an in-flight selective run. - **Any other label:** - `detect what files changed` is skipped, so every acceptance job skips. - The run gets its own concurrency group, so it doesn't cancel the real run. - The aggregator reports as `Acceptance (ignored label event)`. GitHub counts a job skipped by a condition as passing for required checks. A skipped job named `Acceptance` could replace a real failure, or a run still in progress, on the same commit. The rename keeps ignored runs off the `Acceptance` check. Trade-offs: - Each ignored label event still uses a small runner for a few seconds. - The label condition appears in three places, because concurrency, job `if` and job `name` can't read workflow `env`. Open question: none of the `labeled` paths has run on a real label event yet. Related: #131325, #131325 (comment) Refs DI-2885 <!-- junior-request-attribution:start --> via @joshuarli. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A1715dc6ab4670d38b8ce3142b22c1d71 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A1715dc6ab4670d38b8ce3142b22c1d71) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A1715dc6ab4670d38b8ce3142b22c1d71/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Joshua Li <[email protected]>
jan-auer
added a commit
that referenced
this pull request
Nov 17, 2026
…-store * ref/inline-payload-defaults: (2542 commits) feat(classifiers): Support search syntax in classifier list query (#131423) ref(settings): Update settings tour entry copy (#131424) fix(conversations): Track tab switch from the View Timeline button (#131196) ref(sourcemaps): Read has_debug_ids in the source map debugger (#130425) ci(acceptance): Re-run on the override selective testing label (#131408) feat(inbox): Include inbox URLs in item responses (#131406) ref(flags): Remove `organizations:jira-explicit-mapping-removals` (frontend) (#130393) ci(acceptance): Select acceptance tests on pull requests (#131325) fix(audit-log): Render legacy internal integration token entries (#131042) ref(api): Drop the isRecord guard from SentryApiError body reads (#131394) ref: bump sentry-protos to 0.120.1 (#131396) feat(inbox): add URL configuration for inbox events (#131336) fix(circuit-breaker): Don't raise from record_error or record_success when redis fails (#131364) fix(redis): Let cluster client_args set the per-node connection limit (#131355) fix(sentry-apps): Stop retrying service hooks to blocked or unreachable URLs (#131171) fix(charts): Stop tooltip errors when a chart refresh removes series (#131341) perf(crons): Make the check-in timeout index partial (#131376) feat(api): Know per-operation error codes and read top-level codes (#131362) feat(api): Generate error codes and challenge fields from the spec (#131287) feat(apidocs): Mark auth-challenge error codes in the error component (#131346) ... # Conflicts: # src/sentry/conf/server.py # src/sentry/event_manager.py # src/sentry/ingest/consumer/attachment_event.py # src/sentry/ingest/consumer/processors.py # src/sentry/processing/backpressure/topology.py # src/sentry/tasks/store.py # tests/sentry/ingest/ingest_consumer/test_ingest_consumer_kafka.py # tests/sentry/ingest/ingest_consumer/test_ingest_consumer_processing.py # tests/sentry/processing/backpressure/test_checking.py # tests/sentry/processing/backpressure/test_monitoring.py # tests/sentry/tasks/test_post_process.py # tests/sentry/tasks/test_store.py # tests/sentry/tasks/test_symbolication.py
sentry-junior Bot
added a commit
that referenced
this pull request
Nov 17, 2026
files-changed and select-tests are skipped on schedule and workflow_dispatch. Without a status function, the implicit success() on acceptance-coverage counted those skipped ancestors and skipped the job, so no coverage cache was ever saved and select-tests fell back to the full suite for every Python change. Refs #131325 Co-Authored-By: Joshua Li <[email protected]>
joshuarli
added a commit
that referenced
this pull request
Nov 17, 2026
`combine acceptance coverage` now runs on `schedule` and `workflow_dispatch` once every acceptance shard passes, so the `acceptance-coverage-` cache that `select-tests` restores actually gets written. Without that cache, every PR that touches Python falls back to the full acceptance suite. `files-changed` and `select-tests` are skipped on `schedule`. The job's `if:` has no status function, so the implicit `success()` stays in place and also looks at those skipped ancestors, which skips the job even when `needs.acceptance.result == 'success'`. The `acceptance` job avoids the same problem with `always() && !cancelled()`. Adding `!cancelled()` keeps the existing requirement that acceptance itself succeeded. Until the next scheduled run, a manual `workflow_dispatch` of `acceptance` on master would seed the cache. Refs #131325 <!-- junior-request-attribution:start --> via @joshuarli. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent-dispatch%3Adispatch_85c55561853e09366939b9c7ceea098a --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_85c55561853e09366939b9c7ceea098a) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_85c55561853e09366939b9c7ceea098a/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Joshua Li <[email protected]>
xb18
pushed a commit
to xb18/sentry
that referenced
this pull request
Nov 22, 2026
…defaults * origin/master: (2542 commits) feat(classifiers): Support search syntax in classifier list query (getsentry#131423) ref(settings): Update settings tour entry copy (getsentry#131424) fix(conversations): Track tab switch from the View Timeline button (getsentry#131196) ref(sourcemaps): Read has_debug_ids in the source map debugger (getsentry#130425) ci(acceptance): Re-run on the override selective testing label (getsentry#131408) feat(inbox): Include inbox URLs in item responses (getsentry#131406) ref(flags): Remove `organizations:jira-explicit-mapping-removals` (frontend) (getsentry#130393) ci(acceptance): Select acceptance tests on pull requests (getsentry#131325) fix(audit-log): Render legacy internal integration token entries (getsentry#131042) ref(api): Drop the isRecord guard from SentryApiError body reads (getsentry#131394) ref: bump sentry-protos to 0.120.1 (getsentry#131396) feat(inbox): add URL configuration for inbox events (getsentry#131336) fix(circuit-breaker): Don't raise from record_error or record_success when redis fails (getsentry#131364) fix(redis): Let cluster client_args set the per-node connection limit (getsentry#131355) fix(sentry-apps): Stop retrying service hooks to blocked or unreachable URLs (getsentry#131171) fix(charts): Stop tooltip errors when a chart refresh removes series (getsentry#131341) perf(crons): Make the check-in timeout index partial (getsentry#131376) feat(api): Know per-operation error codes and read top-level codes (getsentry#131362) feat(api): Generate error codes and challenge fields from the spec (getsentry#131287) feat(apidocs): Mark auth-challenge error codes in the error component (getsentry#131346) ... # Conflicts: # tests/sentry/ingest/ingest_consumer/test_ingest_consumer_processing.py # tests/sentry/tasks/test_reprocessing2.py # tests/sentry/tasks/test_store.py # tests/sentry/tasks/test_symbolication.py
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.

The acceptance workflow runs on almost every pull request and costs a lot of runner time. This change makes pull requests run only the acceptance tests their changes can reach. Pushes to master still run everything, so anything the selector misses shows up on master and we improve the selector from there.
Refs DI-2876
A new
select-testsjob decides what to run. It follows backend.yml'sselect-tests:parse-pr-files.py, piped fromgh apiexactly as backend.yml does it.Trigger: Override Selective Testinglabel turns selection off through the sameskip_selective_testingoutput.SELECTED_TESTS_FILE.What it selects:
src/maps to tests through per-test coverage. A new daily scheduled run of this workflow, which can also be started by hand, records it. Until the first run, Python changes run everything.If selection fails, everything runs. If nothing is selected, the acceptance jobs are skipped and the required
Acceptancestatus still succeeds.Shared with backend selection, in the new
selected_tests_common.py:compute-sentry-selected-tests.pyThe backend selector's behavior doesn't change. Only acceptance has the frontend import graph, the page map, and the app shell rules.
The daily run combines the shards' coverage only when every shard passed, then saves it with
actions/cache. Pull requests restore the newest copy, so they need no artifact lookup or extra permissions.Two lines of inline shell stay:
uvx coverage combineis one call. Coverage isn't in the stdlib, and that job doesn't have the sentry virtualenv.Known gaps: Python code that only runs at import time, imports the frontend graph can't parse, and pages that are missing from the page map.
#131271 edits the same matrix lines; whichever lands second keeps both behaviors. With #131264, merge queue runs still run everything.
via @joshuarli.
--
View Session [Sentry]