From b15d8636ed144e429dd118d017ec4416e4414d78 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Fri, 27 Nov 2026 14:57:50 +0000 Subject: [PATCH] ci: run lean workspace checks on merge queue entries Merge queue runs now select no matrix projects. The quality job instead typechecks, builds, bundles, and policy-checks the whole workspace and fails on untracked generated files, which catches two green pull requests that break main together. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com> --- .github/workflows/test.yml | 20 ++++++++++++++++++++ docs/operations/github-actions.md | 7 ++++--- scripts/ci-projects.mjs | 4 ++++ scripts/ci-projects.test.mjs | 5 ++++- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d56b8176c2..360d65eb93 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,6 +85,26 @@ jobs: - run: pnpm --filter '@sentry/mcp-core...' --filter @sentry/logger --if-present run build - run: pnpm run lint - run: pnpm run check:generated + # A merge queue run checks what two green pull requests can break + # together: builds, types and policies. scripts/ci-projects.mjs selects no + # projects on merge_group, so the matrix, npm-runtime and the macOS + # catalog skip, and `test` accepts that. + - name: Typecheck every workspace (merge queue) + if: github.event_name == 'merge_group' + run: pnpm run typecheck + - name: Build the CLI and docs (merge queue) + if: github.event_name == 'merge_group' + run: pnpm run build:cli + - name: Bundle the MCP server (merge queue) + if: github.event_name == 'merge_group' + run: pnpm --filter @sentry/mcp-server run bundle + - name: Check project policies (merge queue) + if: github.event_name == 'merge_group' + run: pnpm -r --if-present run ci:policy + # Puts untracked files in the index so the next step's diff reports them. + - name: Include untracked files in the generated files check (merge queue) + if: github.event_name == 'merge_group' + run: git add --intent-to-add --all - name: Check generated files run: git diff --exit-code diff --git a/docs/operations/github-actions.md b/docs/operations/github-actions.md index 59f832724f..4df7cb620f 100644 --- a/docs/operations/github-actions.md +++ b/docs/operations/github-actions.md @@ -15,9 +15,10 @@ Runs on pushes to `main` and release branches, pull requests, and merge queue entries. Discovery reads pnpm workspace projects and their package scripts. Pull requests check changed projects, their workspace consumers, and semantic dependencies (the CLI -docs depend on `sentry`). Root-level changes and non-PR events check every -enabled project. Each project has its own build, lint, typecheck, test, policy, -and E2E steps when those scripts exist. The always-present `test` job checks +docs depend on `sentry`). Root-level changes and pushes check every enabled +project. Merge queue entries select no projects; the quality job typechecks, +builds, and policy-checks the whole workspace instead. Each project has its own +build, lint, typecheck, test, policy, and E2E steps when those scripts exist. The always-present `test` job checks discovery, installation, repository quality, and every selected project. It is the required status check for `main` and `release/**`, so no other job may use the check name `test`: GitHub would accept that check in its place. diff --git a/scripts/ci-projects.mjs b/scripts/ci-projects.mjs index 9a3a03e75c..2f2724bfbf 100644 --- a/scripts/ci-projects.mjs +++ b/scripts/ci-projects.mjs @@ -310,6 +310,10 @@ export function findProjectsByRole(projects, roles) { /** Select directly changed projects and every transitive workspace consumer. */ export function selectAffectedProjects(projects, changedFiles, eventName) { + // Merge queue runs check the whole workspace in test.yml's quality job. + if (eventName === "merge_group") { + return []; + } if (eventName !== "pull_request") { return projects.filter((project) => project.enabled); } diff --git a/scripts/ci-projects.test.mjs b/scripts/ci-projects.test.mjs index bdac17209f..4917e07edd 100644 --- a/scripts/ci-projects.test.mjs +++ b/scripts/ci-projects.test.mjs @@ -154,7 +154,6 @@ describe("workspace CI selection", () => { ...rootFiles.map((file) => [[file], "pull_request"]), [["packages/deleted/package.json"], "pull_request"], [[], "push"], - [[], "merge_group"], ]) { assert.deepEqual( buildMatrix(selectAffectedProjects(projects, files, event)).include.map( @@ -163,6 +162,10 @@ describe("workspace CI selection", () => { ["one", "two"], ); } + assert.deepEqual( + buildMatrix(selectAffectedProjects(projects, [], "merge_group")), + { include: [] }, + ); }); it("keeps a stable CI status and one dynamic job per package", () => {