Skip to content

ci: Run required check workflows on merge_group - #131264

Merged
BYK merged 1 commit into
ci/gate-autocommit-on-pull-requestfrom
ci/merge-group-triggers
Nov 18, 2026
Merged

BYK merged 1 commit into
ci/gate-autocommit-on-pull-requestfrom
ci/merge-group-triggers

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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]} to backend.yml, frontend.yml, acceptance.yml, and pre-commit.yml. It also adds merge_group to the event allow-list on acceptance.yml's files-changed job, which only allowed pull_request and push. Without that, the acceptance suite would skip on merge groups while Acceptance still passed. Together these changes make sure Backend, Frontend, Acceptance, and pre-commit lint report on merge queue commits. No merge queue is configured on master yet, so this does nothing until one is enabled. getsentry / backend needs a separate dispatch change and is not part of this PR.

What a merge_group run does with the current workflows:

  • Change detection: dorny/paths-filter v4.0.2 diffs merge_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.
  • Test scope: select-tests is PR-only in both backend.yml and acceptance.yml, so the backend and acceptance suites run in full, and backend-migration-tests runs too. git-merge-base.sh exits early on any event other than pull_request, so Jest and oxlint run at full scope. That's the right call: with squash merges a merge group commit has no HEAD^2, and even with merge commits HEAD^1..HEAD^2 would miss the other PRs batched ahead of it.
  • Required-check jobs (Backend, Frontend, Acceptance) use if: always(). They report even when every job is filtered out.
  • Runners: every runner check falls back to the master runners (x86).
  • Concurrency: head_ref is empty, so each group falls back to run_id. Queue entries never cancel each other.
  • PR-only steps: the steps that read github.event.pull_request are already gated on pull_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 ratchet: oxlint runs lint:suppressions --ci without --base, the same as master. Live debt still has to fit the committed budgets.

report-backend-test-failures stays PR-only. It posts and cleans up a comment on context.payload.pull_request, which a merge group doesn't have. You could parse a PR number out of merge_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]

@linear-code

linear-code Bot commented Nov 16, 2026

Copy link
Copy Markdown

DI-2871

@github-actions github-actions Bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Nov 16, 2026
@github-actions

Copy link
Copy Markdown
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 #discuss-dev-infra channel.

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
BYK marked this pull request as ready for review November 17, 2026 12:54
@BYK
BYK requested review from a team as code owners November 17, 2026 12:54
@sentry-junior
sentry-junior Bot requested a review from BYK November 17, 2026 12:55
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
sentry-junior Bot force-pushed the ci/merge-group-triggers branch from 6ea7e0e to 354eefe Compare November 17, 2026 12:56
@BYK
BYK merged commit 2dd10fc into master Nov 18, 2026
83 checks passed
@BYK
BYK deleted the ci/merge-group-triggers branch November 18, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant