fix(ci): keep Docker patch smoke on pnpm workspace config

This commit is contained in:
Altay
2026-05-08 16:32:11 +03:00
committed by Peter Steinberger
parent 3855e7b0ac
commit d22424f7d2
5 changed files with 30 additions and 4 deletions

View File

@@ -137,8 +137,9 @@ jobs:
node -e "
const fs = require(\"node:fs\");
const path = require(\"node:path\");
const pkg = require(\"/app/package.json\");
for (const [dep, rel] of Object.entries(pkg.pnpm?.patchedDependencies ?? {})) {
const YAML = require(\"yaml\");
const workspace = YAML.parse(fs.readFileSync(\"/app/pnpm-workspace.yaml\", \"utf8\")) ?? {};
for (const [dep, rel] of Object.entries(workspace.patchedDependencies ?? {})) {
const absolute = path.join(\"/app\", rel);
if (!fs.existsSync(absolute)) {
throw new Error(`missing patch for ${dep}: ${rel}`);
@@ -321,7 +322,22 @@ jobs:
env:
IMAGE_REF: ${{ needs.root_dockerfile_image.outputs.image_ref }}
run: |
docker run --rm --entrypoint sh "$IMAGE_REF" -lc 'which openclaw && openclaw --version'
docker run --rm --entrypoint sh "$IMAGE_REF" -lc '
which openclaw &&
openclaw --version &&
node -e "
const fs = require(\"node:fs\");
const path = require(\"node:path\");
const YAML = require(\"yaml\");
const workspace = YAML.parse(fs.readFileSync(\"/app/pnpm-workspace.yaml\", \"utf8\")) ?? {};
for (const [dep, rel] of Object.entries(workspace.patchedDependencies ?? {})) {
const absolute = path.join(\"/app\", rel);
if (!fs.existsSync(absolute)) {
throw new Error(`missing patch for ${dep}: ${rel}`);
}
}
"
'
- name: Run agents delete shared workspace Docker CLI smoke
env:

View File

@@ -168,6 +168,7 @@ RUN chown node:node /app
COPY --from=runtime-assets --chown=node:node /app/dist ./dist
COPY --from=runtime-assets --chown=node:node /app/node_modules ./node_modules
COPY --from=runtime-assets --chown=node:node /app/package.json .
COPY --from=runtime-assets --chown=node:node /app/pnpm-workspace.yaml .
COPY --from=runtime-assets --chown=node:node /app/patches ./patches
COPY --from=runtime-assets --chown=node:node /app/openclaw.mjs .
COPY --from=runtime-assets --chown=node:node /app/${OPENCLAW_BUNDLED_PLUGIN_DIR} ./${OPENCLAW_BUNDLED_PLUGIN_DIR}

View File

@@ -134,6 +134,9 @@ describe("Dockerfile", () => {
expect(dockerfile).toContain(
"COPY --from=runtime-assets --chown=node:node /app/node_modules ./node_modules",
);
expect(dockerfile).toContain(
"COPY --from=runtime-assets --chown=node:node /app/pnpm-workspace.yaml .",
);
expect(dockerfile).toContain(
"COPY --from=runtime-assets --chown=node:node /app/patches ./patches",
);
@@ -146,6 +149,9 @@ describe("Dockerfile", () => {
};
expect(Object.keys(pnpmWorkspace.patchedDependencies ?? {})).not.toHaveLength(0);
expect(dockerfile).toContain(
"COPY --from=runtime-assets --chown=node:node /app/pnpm-workspace.yaml .",
);
expect(dockerfile).toContain(
"COPY --from=runtime-assets --chown=node:node /app/patches ./patches",
);

View File

@@ -89,7 +89,7 @@ describe("pi package graph guardrails", () => {
expectNoGraphViolations(
piOverrides,
`pnpm.overrides must not target Pi packages. Found: ${piOverrides.join(", ") || "<none>"}. Pi-specific overrides can silently create an unsupported package graph.`,
`pnpm-workspace.yaml overrides must not target Pi packages. Found: ${piOverrides.join(", ") || "<none>"}. Pi-specific overrides can silently create an unsupported package graph.`,
);
});
});

View File

@@ -229,6 +229,9 @@ describe("bun global install smoke", () => {
expect(workflow).not.toContain('timeout 300s docker pull "$IMAGE_REF"');
expect(workflow).toContain("--progress=plain");
expect(workflow).toContain("--load");
expect(workflow).toContain("pnpm-workspace.yaml");
expect(workflow).toContain("workspace.patchedDependencies");
expect(workflow).not.toContain("pkg.pnpm?.patchedDependencies");
expect(workflow).not.toContain("--cache-from");
expect(workflow).not.toContain("--cache-to");
expect(workflow).not.toContain("type=gha");