mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:50:43 +00:00
QA: fix private dist freshness check
This commit is contained in:
@@ -90,6 +90,11 @@ const statMtime = (filePath, fsImpl = fs) => {
|
||||
}
|
||||
};
|
||||
|
||||
const resolvePrivateQaRequiredDistEntries = (distRoot) => [
|
||||
path.join(distRoot, "plugin-sdk", "qa-lab.js"),
|
||||
path.join(distRoot, "plugin-sdk", "qa-runtime.js"),
|
||||
];
|
||||
|
||||
const isExcludedSource = (filePath, sourceRoot, sourceRootName) => {
|
||||
const relativePath = normalizePath(path.relative(sourceRoot, filePath));
|
||||
if (relativePath.startsWith("..")) {
|
||||
@@ -210,8 +215,9 @@ export const resolveBuildRequirement = (deps) => {
|
||||
}
|
||||
if (
|
||||
deps.env.OPENCLAW_BUILD_PRIVATE_QA === "1" &&
|
||||
((deps.privateQaDistEntry && statMtime(deps.privateQaDistEntry, deps.fs) == null) ||
|
||||
(deps.privateQaBundledCliEntry && statMtime(deps.privateQaBundledCliEntry, deps.fs) == null))
|
||||
(deps.privateQaRequiredDistEntries ?? resolvePrivateQaRequiredDistEntries(deps.distRoot)).some(
|
||||
(entry) => statMtime(entry, deps.fs) == null,
|
||||
)
|
||||
) {
|
||||
return { shouldBuild: true, reason: "missing_private_qa_dist" };
|
||||
}
|
||||
@@ -397,8 +403,7 @@ export async function runNodeMain(params = {}) {
|
||||
path: path.join(deps.cwd, sourceRoot),
|
||||
}));
|
||||
deps.configFiles = runNodeConfigFiles.map((filePath) => path.join(deps.cwd, filePath));
|
||||
deps.privateQaDistEntry = path.join(deps.distRoot, "plugin-sdk", "qa-lab.js");
|
||||
deps.privateQaBundledCliEntry = path.join(deps.distRoot, "extensions", "qa-lab", "cli.js");
|
||||
deps.privateQaRequiredDistEntries = resolvePrivateQaRequiredDistEntries(deps.distRoot);
|
||||
if (deps.args[0] === "qa") {
|
||||
deps.env.OPENCLAW_BUILD_PRIVATE_QA = "1";
|
||||
deps.env.OPENCLAW_ENABLE_PRIVATE_QA_CLI = "1";
|
||||
|
||||
Reference in New Issue
Block a user