From 76658cd1590c192948960571ecfbb997f2e97147 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 16 Jun 2026 20:27:45 +0200 Subject: [PATCH] fix(ci): keep ci workflow edits off fast-only routing --- .github/workflows/ci.yml | 4 ++-- scripts/ci-changed-scope.mjs | 2 +- scripts/test-projects.test-support.mjs | 1 + src/scripts/ci-changed-scope.test.ts | 9 ++++++++- test/scripts/ci-workflow-guards.test.ts | 12 ++++++++++++ test/scripts/test-projects.test.ts | 7 +++++++ 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ea062e39ee..c76fb177319 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/scripts/ci-changed-scope.mjs b/scripts/ci-changed-scope.mjs index efd67f34599..97bce71ff34 100644 --- a/scripts/ci-changed-scope.mjs +++ b/scripts/ci-changed-scope.mjs @@ -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}`, ); diff --git a/scripts/test-projects.test-support.mjs b/scripts/test-projects.test-support.mjs index a5f0639a8fd..6078243d235 100644 --- a/scripts/test-projects.test-support.mjs +++ b/scripts/test-projects.test-support.mjs @@ -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"], diff --git a/src/scripts/ci-changed-scope.test.ts b/src/scripts/ci-changed-scope.test.ts index 07ff7ea83c7..0ab9280d0b2 100644 --- a/src/scripts/ci-changed-scope.test.ts +++ b/src/scripts/ci-changed-scope.test.ts @@ -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([ diff --git a/test/scripts/ci-workflow-guards.test.ts b/test/scripts/ci-workflow-guards.test.ts index 21a00a71388..a078b26558d 100644 --- a/test/scripts/ci-workflow-guards.test.ts +++ b/test/scripts/ci-workflow-guards.test.ts @@ -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"); diff --git a/test/scripts/test-projects.test.ts b/test/scripts/test-projects.test.ts index e026b9d89a1..7a0c26ec4d4 100644 --- a/test/scripts/test-projects.test.ts +++ b/test/scripts/test-projects.test.ts @@ -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",