Repository navigation
ci: Run required check workflows on merge_group - #131264
Merged
Merged
Conversation
Contributor
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
joshuarli
added a commit
that referenced
this pull request
Nov 16, 2026
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-tests` job decides what to run. It follows backend.yml's `select-tests`: - Changed files come from `parse-pr-files.py`, piped from `gh api` exactly as backend.yml does it. - The `Trigger: Override Selective Testing` label turns selection off through the same `skip_selective_testing` output. - The selector writes the same kind of file for `SELECTED_TESTS_FILE`. What it selects: - Changes to the workflow, harness, settings, dependencies, build config or templates run everything. So do files the selector doesn't recognize. - Python under `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. - Frontend files map to tests through a static import graph and a page map kept by hand. Changes to the shared app shell run everything. If selection fails, everything runs. If nothing is selected, the acceptance jobs are skipped and the required `Acceptance` status still succeeds. Shared with backend selection, in the new `selected_tests_common.py`: - the Python files that always run the whole suite, moved from `compute-sentry-selected-tests.py` - matching files against those triggers - the per-test coverage query The 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: - The existing run step gains one line that appends the coverage flags. - `uvx coverage combine` is 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. <!-- 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]>
BYK
approved these changes
Nov 17, 2026
Add merge_group (checks_requested) triggers to the backend, frontend, acceptance, and pre-commit workflows so their required checks report on merge queue commits. No merge queue is configured yet, so this is inert until one is enabled. Refs DI-2871 Co-Authored-By: Burak Yigit Kaya <[email protected]>
sentry-junior
Bot
force-pushed
the
ci/merge-group-triggers
branch
from
November 17, 2026 12:56
6ea7e0e to
354eefe
Compare
BYK
approved these changes
Nov 18, 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 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.
Stacked on #131262, which has to land first. Without it,
backend.yml's auto-commit steps would commit straight to master from merge queue runs.This adds
merge_group: {types: [checks_requested]}tobackend.yml,frontend.yml,acceptance.yml, andpre-commit.yml. It also addsmerge_groupto the event allow-list onacceptance.yml'sfiles-changedjob, which only allowedpull_requestandpush. Without that, the acceptance suite would skip on merge groups whileAcceptancestill passed. Together these changes make sureBackend,Frontend,Acceptance, andpre-commit lintreport on merge queue commits. No merge queue is configured on master yet, so this does nothing until one is enabled.getsentry / backendneeds a separate dispatch change and is not part of this PR.What a
merge_grouprun does with the current workflows:dorny/paths-filterv4.0.2 diffsmerge_group.base_sha..head_sha, so jobs are path-filtered like push-to-master. In a batched queue, that diff covers every PR in the group.select-testsis PR-only in bothbackend.ymlandacceptance.yml, so the backend and acceptance suites run in full, andbackend-migration-testsruns too.git-merge-base.shexits early on any event other thanpull_request, so Jest and oxlint run at full scope. That's the right call: with squash merges a merge group commit has noHEAD^2, and even with merge commitsHEAD^1..HEAD^2would miss the other PRs batched ahead of it.Backend,Frontend,Acceptance) useif: always(). They report even when every job is filtered out.head_refis empty, so each group falls back torun_id. Queue entries never cancel each other.github.event.pull_requestare already gated onpull_request, or fall back safely when the PR field is empty: selected tests, failure reporting, lint baseline, suppression pruning, and pre-commit autofix (refs/pull).lint:suppressions --ciwithout--base, the same as master. Live debt still has to fit the committed budgets.report-backend-test-failuresstays PR-only. It posts and cleans up a comment oncontext.payload.pull_request, which a merge group doesn't have. You could parse a PR number out ofmerge_group.head_ref, but in a batched group that names only the last PR, which may not have caused the failure. Its stale-comment cleanup would also delete that PR's own failure report. The queue already links the failing check when it removes an entry.Refs DI-2871
via @BYK, michael.
--
View Session [Sentry]