fix: check all source workspace host deps

This commit is contained in:
Codex
2026-06-29 09:17:18 +00:00
parent c9fd499fd2
commit 561129c873
+11 -7
View File
@@ -363,7 +363,7 @@ function sourceWorkspaceStatusFromFields(fields: Record<string, string>, exitCod
}
function sourceWorkspaceHostDependenciesStatusScript(hostDependencies: HwlabRuntimeSourceWorkspaceHostDependenciesSpec): string {
const checkCommands = hostDependencies.checkCommands.join("\n");
const checkCommands = shellLinesText(hostDependencies.checkCommands);
return [
"set +e",
`state_dir=${shellQuote(hostDependencies.stateDir)}`,
@@ -403,7 +403,7 @@ function sourceWorkspaceHostDependenciesSubmitScript(
sourceWorkspace: HwlabRuntimeSourceWorkspaceSpec,
hostDependencies: HwlabRuntimeSourceWorkspaceHostDependenciesSpec,
): string {
const checkCommands = hostDependencies.checkCommands.join("\n");
const checkCommands = shellLinesText(hostDependencies.checkCommands);
const noProxy = spec.networkProfile.proxy.noProxy.join(",");
const commandSha = createHash("sha256").update(hostDependencies.install.command).digest("hex");
const requiredCommandsSha = createHash("sha256").update(sourceWorkspace.requiredCommands.join("\n")).digest("hex");
@@ -473,9 +473,9 @@ function sourceWorkspaceHostDependenciesSubmitScript(
}
function sourceWorkspaceStatusScript(spec: HwlabRuntimeLaneSpec, sourceWorkspace: HwlabRuntimeSourceWorkspaceSpec): string {
const requiredCommands = sourceWorkspace.requiredCommands.join("\n");
const requiredFiles = sourceWorkspace.requiredFiles.join("\n");
const remoteUrls = [spec.gitUrl, spec.gitReadUrl, spec.gitWriteUrl].join("\n");
const requiredCommands = shellLinesText(sourceWorkspace.requiredCommands);
const requiredFiles = shellLinesText(sourceWorkspace.requiredFiles);
const remoteUrls = shellLinesText([spec.gitUrl, spec.gitReadUrl, spec.gitWriteUrl]);
return [
"set +e",
`workspace=${shellQuote(spec.workspace)}`,
@@ -746,8 +746,8 @@ function sourceWorkspaceJobContainerScript(
controlPlane: ReturnType<typeof hwlabNodeControlPlaneSourceWorkspaceBootstrap>,
workspaceInContainer: string,
): string {
const requiredCommands = sourceWorkspace.requiredCommands.join("\n");
const requiredFiles = sourceWorkspace.requiredFiles.join("\n");
const requiredCommands = shellLinesText(sourceWorkspace.requiredCommands);
const requiredFiles = shellLinesText(sourceWorkspace.requiredFiles);
return [
"set -eu",
`workspace=${shellQuote(workspaceInContainer)}`,
@@ -813,6 +813,10 @@ function sourceWorkspaceJobContainerScript(
].join("\n");
}
function shellLinesText(values: readonly string[]): string {
return values.length === 0 ? "" : `${values.join("\n")}\n`;
}
function sourceWorkspaceJobName(spec: HwlabRuntimeLaneSpec): string {
return `hwlab-${spec.nodeId.toLowerCase()}-${spec.lane}-source-workspace`.slice(0, 63).replace(/-$/u, "");
}