fix(ci): keep ci workflow edits off fast-only routing

This commit is contained in:
Vincent Koc
2026-06-16 20:27:45 +02:00
parent 3ad3cc61b8
commit 76658cd159
6 changed files with 31 additions and 4 deletions

View File

@@ -850,10 +850,10 @@ jobs:
;;
contracts-plugins-ci-routing)
pnpm test:contracts:plugins
pnpm test src/commands/status.scan-result.test.ts src/scripts/ci-changed-scope.test.ts test/scripts/changed-lanes.test.ts test/scripts/run-vitest.test.ts test/scripts/test-projects.test.ts
pnpm test src/commands/status.scan-result.test.ts src/scripts/ci-changed-scope.test.ts test/scripts/changed-lanes.test.ts test/scripts/ci-workflow-guards.test.ts test/scripts/run-vitest.test.ts test/scripts/test-projects.test.ts
;;
ci-routing)
pnpm test src/commands/status.scan-result.test.ts src/scripts/ci-changed-scope.test.ts test/scripts/changed-lanes.test.ts test/scripts/run-vitest.test.ts test/scripts/test-projects.test.ts
pnpm test src/commands/status.scan-result.test.ts src/scripts/ci-changed-scope.test.ts test/scripts/changed-lanes.test.ts test/scripts/ci-workflow-guards.test.ts test/scripts/run-vitest.test.ts test/scripts/test-projects.test.ts
;;
bun-launcher)
OPENCLAW_TEST_BUN_LAUNCHER=1 pnpm test test/openclaw-launcher.e2e.test.ts

View File

@@ -57,7 +57,7 @@ const FAST_INSTALL_SMOKE_RUNTIME_SCOPE_RE =
const NODE_FAST_PLUGIN_CONTRACT_SCOPE_RE =
/^src\/plugins\/contracts\/(?:inventory\/bundled-capability-metadata|registry|tts-contract-suites)\.ts$/;
const NODE_FAST_CI_ROUTING_SCOPE_RE =
/^(scripts\/(?:ci-changed-scope|check-changed|run-vitest|test-projects(?:\.test-support)?)\.mjs$|scripts\/test-projects\.test-support\.d\.mts$|src\/commands\/status\.scan-result\.test\.ts$|src\/scripts\/ci-changed-scope\.test\.ts$|test\/scripts\/(?:changed-lanes|run-vitest|test-projects)\.test\.ts$|\.github\/workflows\/ci\.yml$)/;
/^(scripts\/(?:ci-changed-scope|check-changed|run-vitest|test-projects(?:\.test-support)?)\.mjs$|scripts\/test-projects\.test-support\.d\.mts$|src\/commands\/status\.scan-result\.test\.ts$|src\/scripts\/ci-changed-scope\.test\.ts$|test\/scripts\/(?:changed-lanes|run-vitest|test-projects)\.test\.ts$)/;
const NODE_FAST_SCOPE_RE = new RegExp(
`${NODE_FAST_PLUGIN_CONTRACT_SCOPE_RE.source}|${NODE_FAST_CI_ROUTING_SCOPE_RE.source}`,
);

View File

@@ -400,6 +400,7 @@ const PRECISE_SOURCE_TEST_TARGETS = new Map([
const BROAD_ONLY_TEST_HELPERS = new Set(["test/helpers/poll.ts"]);
const TOOLING_SOURCE_TEST_TARGETS = new Map([
[".crabbox.yaml", ["test/scripts/package-acceptance-workflow.test.ts"]],
[".github/workflows/ci.yml", ["test/scripts/ci-workflow-guards.test.ts"]],
[
".github/workflows/ci-check-testbox.yml",
["test/scripts/ci-workflow-guards.test.ts", "test/scripts/package-acceptance-workflow.test.ts"],

View File

@@ -689,7 +689,6 @@ describe("detectChangedScope", () => {
it("identifies CI routing changes as fast Node-only CI scope", () => {
expect(
detectNodeFastScope([
".github/workflows/ci.yml",
"scripts/check-changed.mjs",
"scripts/ci-changed-scope.mjs",
"scripts/run-vitest.mjs",
@@ -708,6 +707,14 @@ describe("detectChangedScope", () => {
});
});
it("keeps CI workflow edits off fast-only scope so native lanes can run", () => {
expect(detectNodeFastScope([".github/workflows/ci.yml"])).toEqual({
runFastOnly: false,
runPluginContracts: false,
runCiRouting: false,
});
});
it("keeps broad source changes on the full Node CI scope", () => {
expect(
detectNodeFastScope([

View File

@@ -345,6 +345,18 @@ describe("ci workflow guards", () => {
});
});
it("keeps workflow guards in fast CI-routing checks", () => {
const workflow = readCiWorkflow();
const fastCoreJob = workflow.jobs["checks-fast-core"];
const runStep = fastCoreJob.steps.find(
(step) => step.name === "Run ${{ matrix.task }} (${{ matrix.runtime }})",
);
expect(runStep.run).toContain("contracts-plugins-ci-routing)");
expect(runStep.run).toContain("ci-routing)");
expect(runStep.run.match(/test\/scripts\/ci-workflow-guards\.test\.ts/g)?.length).toBe(2);
});
it("keeps push docs validation ClawHub-backed", () => {
const workflow = readFileSync(".github/workflows/docs.yml", "utf8");

View File

@@ -484,6 +484,13 @@ describe("scripts/test-projects changed-target routing", () => {
});
});
it("keeps CI workflow edits on workflow guard tests", () => {
expect(resolveChangedTestTargetPlan([".github/workflows/ci.yml"])).toEqual({
mode: "targets",
targets: ["test/scripts/ci-workflow-guards.test.ts"],
});
});
it("keeps Crabbox and Testbox workflow edits on workflow regression tests", () => {
for (const workflowPath of [
".github/workflows/ci-check-testbox.yml",