Skip to content

Commit 1b9e252

Browse files
BYKcodex
andauthored
Scope MCP documentation changes to repository checks (#1356)
## Summary - keep every tracked repository-root file selecting all enabled workspaces - scope changes under the MCP repository `docs/` tree to the root `docs:check` quality gate rather than selecting every workspace - retain transitive project selection when MCP code changes alongside docs Root `docs/` is not part of the deployed `mcp.sentry.dev` Worker assets. Wrangler serves `packages/mcp-cloudflare/public` and the Vite client instead. The MCP deployment workflow and production assets are unchanged. ## Validation - reproduced the selector failure before the fix: docs-only changes selected all workspaces - `test:ci-projects`: 6 passed, including a check of every tracked root-level file - `docs:check`, `check:generated`, and repository lint passed after updating from main - merged Toolkit CLI cutover (#1354) into this branch to validate the combined tree; exact-head CI and Warden review are pending --------- Co-authored-by: GPT-6 Sol <noreply@openai.com>
1 parent cba3c44 commit 1b9e252

2 files changed

Lines changed: 49 additions & 2 deletions

File tree

‎scripts/ci-projects.mjs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,13 @@ export function selectAffectedProjects(projects, changedFiles, eventName) {
330330
}
331331
}
332332

333-
if (changedProjects.some((project) => project === undefined)) {
333+
// MCP repository docs are checked by the quality job, not deployed by a project.
334+
if (
335+
changedProjects.some(
336+
(project, index) =>
337+
project === undefined && !changedFiles[index].startsWith("docs/"),
338+
)
339+
) {
334340
return projects.filter((project) => project.enabled);
335341
}
336342

‎scripts/ci-projects.test.mjs‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,40 @@ describe("workspace CI selection", () => {
9090
);
9191
});
9292

93+
it("does not run CLI projects for MCP docs and core changes", () => {
94+
const projects = buildProjects([
95+
entry("@sentry/mcp-core", "packages/mcp-core", {
96+
scripts: { test: "vitest run" },
97+
}),
98+
entry("@sentry/mcp-server", "packages/mcp-server", {
99+
dependencies: { "@sentry/mcp-core": "workspace:*" },
100+
scripts: { test: "vitest run" },
101+
}),
102+
entry("sentry", "packages/cli", { scripts: { test: "vitest run" } }),
103+
entry("sentry-cli-docs", "apps/cli-docs", {
104+
sentryCi: { dependencies: ["sentry"] },
105+
scripts: { build: "astro build" },
106+
}),
107+
]);
108+
109+
const names = (files) =>
110+
buildMatrix(
111+
selectAffectedProjects(projects, files, "pull_request"),
112+
).include.map(({ name }) => name);
113+
assert.deepEqual(names(["docs/contributing/tool-responses.md"]), []);
114+
assert.deepEqual(
115+
names([
116+
"docs/contributing/tool-responses.md",
117+
"packages/mcp-core/src/api-client/schema.ts",
118+
]),
119+
["@sentry/mcp-core", "@sentry/mcp-server"],
120+
);
121+
assert.deepEqual(
122+
names(["docs/contributing/tool-responses.md", "pnpm-lock.yaml"]),
123+
["sentry-cli-docs", "sentry", "@sentry/mcp-core", "@sentry/mcp-server"],
124+
);
125+
});
126+
93127
it("runs all enabled projects for root changes and non-PR events", () => {
94128
const projects = buildProjects([
95129
entry("one", "packages/one", { scripts: { build: "tsc" } }),
@@ -99,8 +133,15 @@ describe("workspace CI selection", () => {
99133
sentryCi: { enabled: false },
100134
}),
101135
]);
136+
const rootFiles = execFileSync("git", ["ls-files", "-z"], {
137+
cwd: root,
138+
encoding: "utf8",
139+
})
140+
.split("\0")
141+
.filter((file) => file !== "" && !file.includes("/"));
142+
assert.ok(rootFiles.length > 0);
102143
for (const [files, event] of [
103-
[["pnpm-lock.yaml"], "pull_request"],
144+
...rootFiles.map((file) => [[file], "pull_request"]),
104145
[["packages/deleted/package.json"], "pull_request"],
105146
[[], "push"],
106147
[[], "merge_group"],

0 commit comments

Comments
 (0)