Skip to content

Commit cb1d892

Browse files
authored
fix(release): stage Codex for npm onboarding candidates (#130360)
* fix(release): stage Codex for npm onboarding candidates * refactor(release): share candidate registry lifecycle
1 parent c9f791e commit cb1d892

7 files changed

Lines changed: 151 additions & 51 deletions

‎scripts/e2e/codex-on-demand-docker.sh‎

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ set -euo pipefail
66
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
77
source "$ROOT_DIR/scripts/lib/docker-e2e-image.sh"
88
source "$ROOT_DIR/scripts/lib/docker-e2e-package.sh"
9+
source "$ROOT_DIR/scripts/e2e/lib/prepublish-plugin-registry.sh"
910

1011
IMAGE_NAME="$(docker_e2e_resolve_image "openclaw-codex-on-demand-e2e" OPENCLAW_CODEX_ON_DEMAND_E2E_IMAGE)"
1112
DOCKER_TARGET="${OPENCLAW_CODEX_ON_DEMAND_DOCKER_TARGET:-bare}"
1213
HOST_BUILD="${OPENCLAW_CODEX_ON_DEMAND_HOST_BUILD:-1}"
1314
PACKAGE_TGZ="${OPENCLAW_CURRENT_PACKAGE_TGZ:-}"
14-
PREPUBLISH_PLUGIN_REGISTRY_ARGS=()
15+
OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DOCKER_ARGS=()
1516
AUTO_PREPUBLISH_PLUGIN_REGISTRY_ROOT=""
1617
run_log=""
1718

@@ -20,33 +21,9 @@ run_log=""
2021
# the Codex assertions instead of failing as a silent package-install timeout.
2122
export OPENCLAW_E2E_NPM_INSTALL_TIMEOUT="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-1200s}"
2223

23-
configure_prepublish_plugin_registry() {
24-
local registry_dir="$1"
25-
local resolved_registry_dir
26-
resolved_registry_dir="$(cd "$registry_dir" && pwd)"
27-
local manifest="$resolved_registry_dir/prepublish-plugin-registry.json"
28-
if [ ! -f "$manifest" ]; then
29-
echo "Prepublish plugin registry manifest is missing." >&2
30-
exit 1
31-
fi
32-
local source_sha="${OPENCLAW_DOCKER_E2E_SELECTED_SHA:-}"
33-
local candidate_version="${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION:-}"
34-
local manifest_sha256="${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_MANIFEST_SHA256:-}"
35-
source_sha="${source_sha:-$(node -e 'process.stdout.write(require(process.argv[1]).sourceSha)' "$manifest")}"
36-
candidate_version="${candidate_version:-$(node -e 'process.stdout.write(require(process.argv[1]).candidateVersion)' "$manifest")}"
37-
if [ -z "$manifest_sha256" ]; then
38-
manifest_sha256="$(node -e 'const fs=require("node:fs"),crypto=require("node:crypto");process.stdout.write(crypto.createHash("sha256").update(fs.readFileSync(process.argv[1])).digest("hex"))' "$manifest")"
39-
fi
40-
PREPUBLISH_PLUGIN_REGISTRY_ARGS=(
41-
-e OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR=/tmp/openclaw-prepublish-plugin-registry
42-
-e OPENCLAW_DOCKER_E2E_SELECTED_SHA="$source_sha"
43-
-e OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION="$candidate_version"
44-
-e OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_MANIFEST_SHA256="$manifest_sha256"
45-
-v "$resolved_registry_dir:/tmp/openclaw-prepublish-plugin-registry:ro"
46-
)
47-
}
4824
if [ -n "${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:-}" ]; then
49-
configure_prepublish_plugin_registry "$OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR"
25+
openclaw_prepublish_plugin_registry_configure_docker_args \
26+
"$OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR"
5027
fi
5128

5229
cleanup() {
@@ -88,7 +65,7 @@ if [ -z "${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:-}" ] &&
8865
OPENCLAW_DOCKER_ALL_LOG_DIR="$AUTO_PREPUBLISH_PLUGIN_REGISTRY_ROOT" \
8966
OPENCLAW_DOCKER_ALL_TIMINGS=0 \
9067
node "$ROOT_DIR/scripts/test-docker-all.mjs" --prepare-plugin-registry >/dev/null
91-
configure_prepublish_plugin_registry \
68+
openclaw_prepublish_plugin_registry_configure_docker_args \
9269
"$AUTO_PREPUBLISH_PLUGIN_REGISTRY_ROOT/prepublish-plugin-registry"
9370
fi
9471

@@ -100,7 +77,7 @@ echo "Running Codex on-demand Docker E2E..."
10077
if ! docker_e2e_run_with_harness \
10178
-e COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
10279
-e "OPENCLAW_TEST_STATE_SCRIPT_B64=$OPENCLAW_TEST_STATE_SCRIPT_B64" \
103-
${PREPUBLISH_PLUGIN_REGISTRY_ARGS[@]+"${PREPUBLISH_PLUGIN_REGISTRY_ARGS[@]}"} \
80+
"${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DOCKER_ARGS[@]}" \
10481
"${DOCKER_E2E_PACKAGE_ARGS[@]}" \
10582
-i "$IMAGE_NAME" bash -s >"$run_log" 2>&1 <<'EOF'; then
10683
set -euo pipefail
@@ -135,16 +112,8 @@ cleanup_inner() {
135112
trap cleanup_inner EXIT
136113
137114
configure_plugin_registry() {
138-
[ -n "${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:-}" ] || return 0
139-
local registry_root="/tmp/openclaw-codex-registry"
140-
OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_REQUIRED_PACKAGES_JSON='["@openclaw/codex"]' \
141-
openclaw_prepublish_plugin_registry_start \
142-
"$OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR" \
143-
"${OPENCLAW_DOCKER_E2E_SELECTED_SHA:?missing selected SHA}" \
144-
"${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION:?missing candidate version}" \
145-
"${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_MANIFEST_SHA256:?missing manifest SHA-256}" \
146-
"$registry_root" \
147-
plugin_registry_pid
115+
openclaw_prepublish_plugin_registry_start_mounted \
116+
/tmp/openclaw-codex-registry plugin_registry_pid '["@openclaw/codex"]'
148117
}
149118
150119
mkdir -p "$NPM_CONFIG_PREFIX" "$XDG_CACHE_HOME" "$NPM_CONFIG_CACHE"

‎scripts/e2e/lib/prepublish-plugin-registry.sh‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
#!/usr/bin/env bash
22

3+
openclaw_prepublish_plugin_registry_configure_docker_args() {
4+
local registry_dir="$1"
5+
local resolved_registry_dir
6+
resolved_registry_dir="$(cd "$registry_dir" && pwd)"
7+
local manifest="$resolved_registry_dir/prepublish-plugin-registry.json"
8+
if [ ! -f "$manifest" ]; then
9+
echo "Prepublish plugin registry manifest is missing." >&2
10+
return 1
11+
fi
12+
13+
local source_sha="${OPENCLAW_DOCKER_E2E_SELECTED_SHA:-}"
14+
local candidate_version="${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION:-}"
15+
local manifest_sha256="${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_MANIFEST_SHA256:-}"
16+
source_sha="${source_sha:-$(node -e 'process.stdout.write(require(process.argv[1]).sourceSha)' "$manifest")}"
17+
candidate_version="${candidate_version:-$(node -e 'process.stdout.write(require(process.argv[1]).candidateVersion)' "$manifest")}"
18+
if [ -z "$manifest_sha256" ]; then
19+
manifest_sha256="$(node -e 'const fs=require("node:fs"),crypto=require("node:crypto");process.stdout.write(crypto.createHash("sha256").update(fs.readFileSync(process.argv[1])).digest("hex"))' "$manifest")"
20+
fi
21+
22+
OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DOCKER_ARGS=(
23+
-e OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR=/tmp/openclaw-prepublish-plugin-registry
24+
-e OPENCLAW_DOCKER_E2E_SELECTED_SHA="$source_sha"
25+
-e OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION="$candidate_version"
26+
-e OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_MANIFEST_SHA256="$manifest_sha256"
27+
-v "$resolved_registry_dir:/tmp/openclaw-prepublish-plugin-registry:ro"
28+
)
29+
}
30+
331
openclaw_prepublish_plugin_registry_start() {
432
local artifact_dir="$1" source_sha="$2" candidate_version="$3"
533
local manifest_sha256="$4" registry_root="$5" pid_variable="$6"
@@ -90,3 +118,19 @@ NODE
90118
export npm_config_registry="$NPM_CONFIG_REGISTRY"
91119
printf -v "$pid_variable" "%s" "$server_pid"
92120
}
121+
122+
openclaw_prepublish_plugin_registry_start_mounted() {
123+
local registry_root="$1" pid_variable="$2" required_packages_json="$3"
124+
shift 3
125+
[ -n "${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:-}" ] || return 0
126+
127+
OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_REQUIRED_PACKAGES_JSON="$required_packages_json" \
128+
openclaw_prepublish_plugin_registry_start \
129+
"$OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR" \
130+
"${OPENCLAW_DOCKER_E2E_SELECTED_SHA:?missing selected SHA}" \
131+
"${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION:?missing candidate version}" \
132+
"${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_MANIFEST_SHA256:?missing manifest SHA-256}" \
133+
"$registry_root" \
134+
"$pid_variable" \
135+
"$@"
136+
}

‎scripts/e2e/npm-onboard-channel-agent-docker.sh‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
77
SOURCE_ROOT="$(cd "${OPENCLAW_NPM_ONBOARD_SOURCE_ROOT:-${OPENCLAW_LIVE_DOCKER_REPO_ROOT:-$ROOT_DIR}}" && pwd)"
88
source "$ROOT_DIR/scripts/lib/docker-e2e-image.sh"
99
source "$ROOT_DIR/scripts/lib/docker-e2e-package.sh"
10+
source "$ROOT_DIR/scripts/e2e/lib/prepublish-plugin-registry.sh"
1011

1112
IMAGE_NAME="$(docker_e2e_resolve_image "openclaw-npm-onboard-channel-agent-e2e" OPENCLAW_NPM_ONBOARD_E2E_IMAGE)"
1213
DOCKER_TARGET="${OPENCLAW_NPM_ONBOARD_DOCKER_TARGET:-bare}"
@@ -23,6 +24,7 @@ STATUS_TEXT_MAX_BYTES="$(
2324
run_log=""
2425
plugin_pack_dir=""
2526
plugin_package_args=()
27+
OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DOCKER_ARGS=()
2628

2729
cleanup() {
2830
if [ -n "${PACKAGE_TGZ:-}" ]; then
@@ -95,6 +97,11 @@ prepare_source_plugin_package() {
9597

9698
prepare_source_plugin_package
9799

100+
if [ -n "${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:-}" ]; then
101+
openclaw_prepublish_plugin_registry_configure_docker_args \
102+
"$OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR"
103+
fi
104+
98105
docker_e2e_package_mount_args "$PACKAGE_TGZ"
99106
run_log="$(docker_e2e_run_log npm-onboard-channel-agent)"
100107
OPENCLAW_TEST_STATE_SCRIPT_B64="$(docker_e2e_test_state_shell_b64 npm-onboard-channel-agent empty)"
@@ -108,10 +115,12 @@ if ! docker_e2e_run_with_harness \
108115
-e "OPENCLAW_TEST_STATE_SCRIPT_B64=$OPENCLAW_TEST_STATE_SCRIPT_B64" \
109116
"${DOCKER_E2E_PACKAGE_ARGS[@]}" \
110117
"${plugin_package_args[@]}" \
118+
"${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DOCKER_ARGS[@]}" \
111119
-i "$IMAGE_NAME" bash -s >"$run_log" 2>&1 <<'EOF'; then
112120
set -Eeuo pipefail
113121
114122
source scripts/lib/openclaw-e2e-instance.sh
123+
source scripts/e2e/lib/prepublish-plugin-registry.sh
115124
openclaw_e2e_eval_test_state_from_b64 "${OPENCLAW_TEST_STATE_SCRIPT_B64:?missing OPENCLAW_TEST_STATE_SCRIPT_B64}"
116125
export NPM_CONFIG_PREFIX="$HOME/.npm-global"
117126
export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"
@@ -126,6 +135,7 @@ scenario_tmp="$(mktemp -d "${TMPDIR:-/tmp}/openclaw-npm-onboard-channel-agent.XX
126135
MOCK_REQUEST_LOG="$scenario_tmp/mock-openai-requests.jsonl"
127136
export SUCCESS_MARKER MOCK_REQUEST_LOG
128137
mock_pid=""
138+
plugin_registry_pid=""
129139
130140
case "$CHANNEL" in
131141
telegram)
@@ -155,6 +165,7 @@ esac
155165
156166
cleanup() {
157167
openclaw_e2e_stop_process "${mock_pid:-}"
168+
openclaw_e2e_stop_process "${plugin_registry_pid:-}"
158169
rm -rf "$scenario_tmp"
159170
}
160171
trap cleanup EXIT
@@ -180,6 +191,11 @@ dump_debug_logs() {
180191
}
181192
trap 'status=$?; dump_debug_logs "$status"; exit "$status"' ERR
182193
194+
if [ -n "${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR:-}" ]; then
195+
openclaw_prepublish_plugin_registry_start_mounted \
196+
/tmp/openclaw-npm-onboard-plugin-registry plugin_registry_pid '["@openclaw/codex"]'
197+
fi
198+
183199
openclaw_e2e_install_package /tmp/openclaw-install.log
184200
185201
command -v openclaw >/dev/null

‎scripts/lib/docker-e2e-scenarios.mts‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ const updateMigrationCommand = upgradeSurvivorScriptCommand(
6464
const updateRunPackageSelfUpgradeCommand =
6565
"OPENCLAW_QA_ALLOW_UPDATE_RUN_SELF=1 OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:update-run-package-self-upgrade";
6666
const CODEX_HARNESS_API_KEY_ENV = "OPENCLAW_LIVE_CODEX_HARNESS_AUTH=api-key";
67+
const npmOnboardLaneOptions = {
68+
prepublishPluginPackages: ["@openclaw/codex"],
69+
resources: ["service"],
70+
stateScenario: "empty",
71+
weight: 3,
72+
} satisfies LaneOptions;
6773

6874
const LIVE_RETRY_PATTERNS = [
6975
/529\b/i,
@@ -461,17 +467,17 @@ export const mainLanes: DockerE2eLane[] = [
461467
npmLane(
462468
"npm-onboard-channel-agent",
463469
"OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:npm-onboard-channel-agent",
464-
{ resources: ["service"], stateScenario: "empty", weight: 3 },
470+
npmOnboardLaneOptions,
465471
),
466472
npmLane(
467473
"npm-onboard-discord-channel-agent",
468474
"OPENCLAW_NPM_ONBOARD_CHANNEL=discord OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:npm-onboard-channel-agent",
469-
{ resources: ["service"], stateScenario: "empty", weight: 3 },
475+
npmOnboardLaneOptions,
470476
),
471477
npmLane(
472478
"npm-onboard-slack-channel-agent",
473479
"OPENCLAW_NPM_ONBOARD_CHANNEL=slack OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:npm-onboard-channel-agent",
474-
{ resources: ["service"], stateScenario: "empty", weight: 3 },
480+
npmOnboardLaneOptions,
475481
),
476482
// Prerelease validation must pair frozen core bytes with matching target plugin bytes.
477483
// Keep the registry-backed lanes above unchanged for published-package proof.
@@ -481,15 +487,15 @@ export const mainLanes: DockerE2eLane[] = [
481487
"e2e/npm-onboard-channel-agent-docker.sh",
482488
"OPENCLAW_NPM_ONBOARD_CHANNEL=discord OPENCLAW_NPM_ONBOARD_USE_SOURCE_PLUGIN_PACKAGE=1",
483489
),
484-
{ resources: ["service"], stateScenario: "empty", weight: 3 },
490+
npmOnboardLaneOptions,
485491
),
486492
npmLane(
487493
"npm-onboard-slack-candidate-channel-agent",
488494
liveDockerScriptCommand(
489495
"e2e/npm-onboard-channel-agent-docker.sh",
490496
"OPENCLAW_NPM_ONBOARD_CHANNEL=slack OPENCLAW_NPM_ONBOARD_USE_SOURCE_PLUGIN_PACKAGE=1",
491497
),
492-
{ resources: ["service"], stateScenario: "empty", weight: 3 },
498+
npmOnboardLaneOptions,
493499
),
494500
npmLane(
495501
"release-user-journey",

‎test/scripts/docker-build-helper.test.ts‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3882,10 +3882,10 @@ grep -Fxq preserved "$TMPDIR/caller-fd"
38823882

38833883
expectTextToIncludeAll(runner, [
38843884
"OPENCLAW_DOCKER_ALL_LANES=codex-on-demand",
3885-
"OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR=/tmp/openclaw-prepublish-plugin-registry",
38863885
"source scripts/e2e/lib/prepublish-plugin-registry.sh",
3887-
"openclaw_prepublish_plugin_registry_start",
3888-
"OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_REQUIRED_PACKAGES_JSON='[\"@openclaw/codex\"]'",
3886+
"openclaw_prepublish_plugin_registry_configure_docker_args",
3887+
"openclaw_prepublish_plugin_registry_start_mounted",
3888+
"'[\"@openclaw/codex\"]'",
38893889
]);
38903890
expectTextToIncludeAll(registryHelper, [
38913891
'OPENCLAW_NPM_REGISTRY_DIST_TAGS="$dist_tags"',
@@ -3899,6 +3899,20 @@ grep -Fxq preserved "$TMPDIR/caller-fd"
38993899
);
39003900
});
39013901

3902+
it("reuses the candidate registry lifecycle for channel onboarding", () => {
3903+
const runner = readFileSync(NPM_ONBOARD_CHANNEL_AGENT_DOCKER_E2E_PATH, "utf8");
3904+
3905+
expectTextToIncludeAll(runner, [
3906+
'source "$ROOT_DIR/scripts/e2e/lib/prepublish-plugin-registry.sh"',
3907+
"openclaw_prepublish_plugin_registry_configure_docker_args",
3908+
"openclaw_prepublish_plugin_registry_start_mounted",
3909+
"'[\"@openclaw/codex\"]'",
3910+
]);
3911+
expect(runner.indexOf("openclaw_prepublish_plugin_registry_start_mounted")).toBeLessThan(
3912+
runner.indexOf("\nopenclaw_e2e_install_package"),
3913+
);
3914+
});
3915+
39023916
it("cleans package-backed onboarding and plugin Docker artifacts on every exit path", () => {
39033917
for (const path of [
39043918
CODEX_ON_DEMAND_DOCKER_E2E_PATH,

‎test/scripts/docker-e2e-plan.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,22 @@ function bundledPluginSweepLane(index: number): ReturnType<typeof summarizeLane>
144144
}
145145

146146
describe("scripts/lib/docker-e2e-plan", () => {
147+
it("prepares the matching Codex package for candidate npm onboarding", () => {
148+
const laneNames = [
149+
"npm-onboard-channel-agent",
150+
"npm-onboard-discord-channel-agent",
151+
"npm-onboard-slack-channel-agent",
152+
"npm-onboard-discord-candidate-channel-agent",
153+
"npm-onboard-slack-candidate-channel-agent",
154+
];
155+
const lanes = laneNames.map((name) => findLaneByName(name));
156+
157+
expect(lanes.map((lane) => lane?.name)).toEqual(laneNames);
158+
expect(requiredPrepublishPluginPackagesForLanes(lanes.flatMap((lane) => lane ?? []))).toEqual([
159+
"@openclaw/codex",
160+
]);
161+
});
162+
147163
it("omits a package-script lane unavailable from the candidate", () => {
148164
const plan = planFor({
149165
candidatePackageRoot: writeCandidatePackage({}),

‎test/scripts/prepublish-plugin-registry-shell.test.ts‎

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,39 @@ function createTarball(
3030
}
3131

3232
describe("prepublish plugin registry shell helper", () => {
33+
it("derives the immutable Docker mount contract from the registry artifact", () => {
34+
const root = tempDirs.make("openclaw-prepublish-registry-mount-");
35+
const manifestPath = join(root, "prepublish-plugin-registry.json");
36+
writeFileSync(
37+
manifestPath,
38+
`${JSON.stringify({ candidateVersion: VERSION, packages: [], sourceSha: SOURCE_SHA })}\n`,
39+
);
40+
41+
const result = spawnSync(
42+
"bash",
43+
[
44+
"-c",
45+
`
46+
set -euo pipefail
47+
source "$HELPER"
48+
openclaw_prepublish_plugin_registry_configure_docker_args "$ARTIFACT_DIR"
49+
printf '%s\n' "\${OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DOCKER_ARGS[@]}"
50+
`,
51+
],
52+
{ encoding: "utf8", env: { ...process.env, ARTIFACT_DIR: root, HELPER: SCRIPT } },
53+
);
54+
55+
expect(result.status, result.stderr).toBe(0);
56+
expect(result.stdout).toContain(`OPENCLAW_DOCKER_E2E_SELECTED_SHA=${SOURCE_SHA}`);
57+
expect(result.stdout).toContain(
58+
`OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION=${VERSION}`,
59+
);
60+
expect(result.stdout).toContain(`${root}:/tmp/openclaw-prepublish-plugin-registry:ro`);
61+
expect(result.stdout).toContain(
62+
`OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_MANIFEST_SHA256=${sha256(manifestPath)}`,
63+
);
64+
});
65+
3366
it("verifies and serves every artifact package plus caller-owned fixtures", () => {
3467
const root = tempDirs.make("openclaw-prepublish-registry-shell-");
3568
const artifactDir = join(root, "artifact");
@@ -85,10 +118,12 @@ cleanup() {
85118
fi
86119
}
87120
trap cleanup EXIT
88-
export OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_REQUIRED_PACKAGES_JSON='["@openclaw/codex"]'
89-
openclaw_prepublish_plugin_registry_start \
90-
"$ARTIFACT_DIR" "$SOURCE_SHA" "$VERSION" "$MANIFEST_SHA256" \
91-
"$REGISTRY_ROOT" registry_pid \
121+
export OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_DIR="$ARTIFACT_DIR"
122+
export OPENCLAW_DOCKER_E2E_SELECTED_SHA="$SOURCE_SHA"
123+
export OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_CANDIDATE_VERSION="$VERSION"
124+
export OPENCLAW_PREPUBLISH_PLUGIN_REGISTRY_MANIFEST_SHA256="$MANIFEST_SHA256"
125+
openclaw_prepublish_plugin_registry_start_mounted \
126+
"$REGISTRY_ROOT" registry_pid '["@openclaw/codex"]' \
92127
"@openclaw/brave-plugin" "$VERSION" "$EXTRA_TARBALL"
93128
node <<'NODE'
94129
const packages = ["@openclaw/codex", "@openclaw/telegram", "@openclaw/brave-plugin"];

0 commit comments

Comments
 (0)