Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions docs/operations/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions scripts/ci-projects.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 4 additions & 1 deletion scripts/ci-projects.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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", () => {
Expand Down
Loading