fix(ci): patch main regression surfaces

This commit is contained in:
Peter Steinberger
2026-04-06 04:16:18 +01:00
parent 82ad0f6b24
commit 2a5c355688
17 changed files with 127 additions and 46 deletions

View File

@@ -6,6 +6,7 @@ import net from "node:net";
import os from "node:os";
import path from "node:path";
import process from "node:process";
import { writeBuildStamp } from "./build-stamp.mjs";
import { resolveBuildRequirement } from "./run-node.mjs";
const DEFAULTS = {
@@ -454,6 +455,10 @@ async function main() {
ensureDir(options.outputDir);
if (!options.skipBuild) {
runCheckedCommand("pnpm", ["build"]);
// The watch harness must start from a completed-build baseline. Refresh
// the build stamp after the full build pipeline finishes so run-node does
// not spuriously rebuild inside the bounded watch window.
writeBuildStamp({ cwd: process.cwd() });
}
const preflightBuildRequirement = resolveBuildRequirement(buildRunNodeDeps(process.env));

View File

@@ -5,6 +5,7 @@ export type ChangedScope = {
runWindows: boolean;
runSkillsPython: boolean;
runChangedSmoke: boolean;
runControlUiI18n: boolean;
};
export function detectChangedScope(changedPaths: string[]): ChangedScope;

View File

@@ -1,7 +1,7 @@
import { execFileSync } from "node:child_process";
import { appendFileSync } from "node:fs";
/** @typedef {{ runNode: boolean; runMacos: boolean; runAndroid: boolean; runWindows: boolean; runSkillsPython: boolean; runChangedSmoke: boolean }} ChangedScope */
/** @typedef {{ runNode: boolean; runMacos: boolean; runAndroid: boolean; runWindows: boolean; runSkillsPython: boolean; runChangedSmoke: boolean; runControlUiI18n: boolean }} ChangedScope */
const DOCS_PATH_RE = /^(docs\/|.*\.mdx?$)/;
const SKILLS_PYTHON_SCOPE_RE = /^(skills\/|pyproject\.toml$)/;
@@ -15,6 +15,8 @@ const NODE_SCOPE_RE =
/^(src\/|test\/|extensions\/|packages\/|scripts\/|ui\/|\.github\/|openclaw\.mjs$|package\.json$|pnpm-lock\.yaml$|pnpm-workspace\.yaml$|tsconfig.*\.json$|vitest.*\.ts$|tsdown\.config\.ts$|\.oxlintrc\.json$|\.oxfmtrc\.jsonc$)/;
const WINDOWS_SCOPE_RE =
/^(src\/|test\/|extensions\/|packages\/|scripts\/|ui\/|openclaw\.mjs$|package\.json$|pnpm-lock\.yaml$|pnpm-workspace\.yaml$|tsconfig.*\.json$|vitest.*\.ts$|tsdown\.config\.ts$|\.github\/workflows\/ci\.yml$|\.github\/actions\/setup-node-env\/action\.yml$|\.github\/actions\/setup-pnpm-store-cache\/action\.yml$)/;
const CONTROL_UI_I18N_SCOPE_RE =
/^(ui\/src\/i18n\/|scripts\/control-ui-i18n\.ts$|\.github\/workflows\/control-ui-locale-refresh\.yml$)/;
const NATIVE_ONLY_RE =
/^(apps\/android\/|apps\/ios\/|apps\/macos\/|apps\/shared\/|Swabble\/|appcast\.xml$)/;
const CHANGED_SMOKE_SCOPE_RE =
@@ -33,6 +35,7 @@ export function detectChangedScope(changedPaths) {
runWindows: true,
runSkillsPython: true,
runChangedSmoke: true,
runControlUiI18n: true,
};
}
@@ -42,6 +45,7 @@ export function detectChangedScope(changedPaths) {
let runWindows = false;
let runSkillsPython = false;
let runChangedSmoke = false;
let runControlUiI18n = false;
let hasNonDocs = false;
let hasNonNativeNonDocs = false;
@@ -91,6 +95,10 @@ export function detectChangedScope(changedPaths) {
runChangedSmoke = true;
}
if (CONTROL_UI_I18N_SCOPE_RE.test(path)) {
runControlUiI18n = true;
}
if (!NATIVE_ONLY_RE.test(path)) {
hasNonNativeNonDocs = true;
}
@@ -100,7 +108,15 @@ export function detectChangedScope(changedPaths) {
runNode = true;
}
return { runNode, runMacos, runAndroid, runWindows, runSkillsPython, runChangedSmoke };
return {
runNode,
runMacos,
runAndroid,
runWindows,
runSkillsPython,
runChangedSmoke,
runControlUiI18n,
};
}
/**
@@ -136,6 +152,7 @@ export function writeGitHubOutput(scope, outputPath = process.env.GITHUB_OUTPUT)
appendFileSync(outputPath, `run_windows=${scope.runWindows}\n`, "utf8");
appendFileSync(outputPath, `run_skills_python=${scope.runSkillsPython}\n`, "utf8");
appendFileSync(outputPath, `run_changed_smoke=${scope.runChangedSmoke}\n`, "utf8");
appendFileSync(outputPath, `run_control_ui_i18n=${scope.runControlUiI18n}\n`, "utf8");
}
function isDirectRun() {
@@ -172,6 +189,7 @@ if (isDirectRun()) {
runWindows: true,
runSkillsPython: true,
runChangedSmoke: true,
runControlUiI18n: true,
});
process.exit(0);
}
@@ -184,6 +202,7 @@ if (isDirectRun()) {
runWindows: true,
runSkillsPython: true,
runChangedSmoke: true,
runControlUiI18n: true,
});
}
}

View File

@@ -41,6 +41,7 @@
"ssrf-policy",
"ssrf-runtime",
"media-runtime",
"media-generation-runtime",
"conversation-runtime",
"matrix-runtime-heavy",
"matrix-runtime-shared",