Skip to content

Commit 4a53501

Browse files
committed
fix(release): bind Bun smoke to candidate payload
1 parent 13f0e02 commit 4a53501

2 files changed

Lines changed: 101 additions & 58 deletions

File tree

‎.github/workflows/install-smoke-reusable.yml‎

Lines changed: 55 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,98 +1350,106 @@ jobs:
13501350
exit "$failed"
13511351
13521352
bun_global_install_smoke:
1353-
needs: [preflight, root_dockerfile_image, root_dockerfile_image_ready]
1353+
needs: [preflight, installer_smoke_candidate_payload]
13541354
if: needs.preflight.outputs.run_full_install_smoke == 'true' && needs.preflight.outputs.run_bun_global_install_smoke == 'true'
13551355
runs-on: ubuntu-24.04
13561356
timeout-minutes: 60
1357-
env:
1358-
OPENCLAW_DOCKER_E2E_REQUIRE_LOCAL_IMAGE: "1"
13591357
steps:
13601358
- *trusted_workflow_subdir_checkout_step
13611359
- *trusted_workflow_subdir_identity_step
13621360

1363-
- name: Validate root Dockerfile image artifact binding
1361+
- name: Validate candidate payload artifact binding
13641362
env:
1365-
ARCHIVE_SHA256: ${{ needs.root_dockerfile_image.outputs.archive_sha256 }}
1366-
ARTIFACT_DIGEST: ${{ needs.root_dockerfile_image.outputs.artifact_digest }}
1367-
ARTIFACT_ID: ${{ needs.root_dockerfile_image.outputs.artifact_id }}
1368-
ARTIFACT_NAME: ${{ needs.root_dockerfile_image.outputs.artifact_name }}
1369-
ARTIFACT_RUN_ATTEMPT: ${{ needs.root_dockerfile_image.outputs.artifact_run_attempt }}
1370-
ARTIFACT_RUN_ID: ${{ needs.root_dockerfile_image.outputs.artifact_run_id }}
1363+
ARTIFACT_DIGEST: ${{ needs.installer_smoke_candidate_payload.outputs.artifact_digest }}
1364+
ARTIFACT_ID: ${{ needs.installer_smoke_candidate_payload.outputs.artifact_id }}
1365+
ARTIFACT_NAME: ${{ needs.installer_smoke_candidate_payload.outputs.artifact_name }}
1366+
ARTIFACT_RUN_ATTEMPT: ${{ needs.installer_smoke_candidate_payload.outputs.artifact_run_attempt }}
1367+
ARTIFACT_RUN_ID: ${{ needs.installer_smoke_candidate_payload.outputs.artifact_run_id }}
1368+
ARTIFACT_HARNESS_REPOSITORY: ${{ needs.installer_smoke_candidate_payload.outputs.harness_repository }}
1369+
ARTIFACT_HARNESS_SHA: ${{ needs.installer_smoke_candidate_payload.outputs.harness_sha }}
1370+
ARTIFACT_REPOSITORY: ${{ needs.installer_smoke_candidate_payload.outputs.repository }}
1371+
ARTIFACT_TARGET_SHA: ${{ needs.installer_smoke_candidate_payload.outputs.target_sha }}
1372+
HARNESS_REPOSITORY: ${{ steps.workflow.outputs.repository }}
1373+
HARNESS_SHA: ${{ steps.workflow.outputs.sha }}
13711374
GH_TOKEN: ${{ github.token }}
13721375
TARGET_SHA: ${{ needs.preflight.outputs.target_sha }}
13731376
run: |
13741377
set -euo pipefail
13751378
[[ "$ARTIFACT_ID" =~ ^[1-9][0-9]*$ ]] || {
1376-
echo "Root image artifact ID is missing or invalid." >&2
1379+
echo "Candidate payload artifact ID is missing or invalid." >&2
13771380
exit 1
13781381
}
13791382
[[ "$ARTIFACT_DIGEST" =~ ^[a-f0-9]{64}$ ]] || {
1380-
echo "Root image artifact digest is missing or invalid." >&2
1381-
exit 1
1382-
}
1383-
[[ "$ARCHIVE_SHA256" =~ ^[a-f0-9]{64}$ ]] || {
1384-
echo "Root image archive SHA-256 is missing or invalid." >&2
1383+
echo "Candidate payload artifact digest is missing or invalid." >&2
13851384
exit 1
13861385
}
13871386
[[ "$ARTIFACT_RUN_ID" =~ ^[1-9][0-9]*$ ]] || {
1388-
echo "Root image artifact run ID is missing or invalid." >&2
1387+
echo "Candidate payload artifact run ID is missing or invalid." >&2
13891388
exit 1
13901389
}
13911390
[[ "$ARTIFACT_RUN_ATTEMPT" =~ ^[1-9][0-9]*$ ]] || {
1392-
echo "Root image artifact run attempt is missing or invalid." >&2
1391+
echo "Candidate payload artifact run attempt is missing or invalid." >&2
13931392
exit 1
13941393
}
1395-
expected_artifact_name="install-smoke-root-image-${TARGET_SHA:0:12}-${ARTIFACT_RUN_ID}-${ARTIFACT_RUN_ATTEMPT}"
1394+
[[ "$ARTIFACT_REPOSITORY" == "$GITHUB_REPOSITORY" ]]
1395+
[[ "$ARTIFACT_TARGET_SHA" == "$TARGET_SHA" ]]
1396+
[[ "$ARTIFACT_HARNESS_REPOSITORY" == "$HARNESS_REPOSITORY" ]]
1397+
[[ "$ARTIFACT_HARNESS_SHA" == "$HARNESS_SHA" ]]
1398+
expected_artifact_name="install-smoke-candidate-payload-${TARGET_SHA}-${ARTIFACT_RUN_ID}-${ARTIFACT_RUN_ATTEMPT}"
13961399
[[ "$ARTIFACT_NAME" == "$expected_artifact_name" ]] || {
1397-
echo "Root image artifact name does not match the target and producer run attempt." >&2
1400+
echo "Candidate payload artifact name does not match the producer tuple." >&2
13981401
exit 1
13991402
}
14001403
bash .release-harness/scripts/docker/shared-image-artifact.sh \
1401-
verify-upload "Root image" "$ARTIFACT_ID" "$ARTIFACT_NAME" "$ARTIFACT_DIGEST" \
1404+
verify-upload "Candidate payload" "$ARTIFACT_ID" "$ARTIFACT_NAME" "$ARTIFACT_DIGEST" \
14021405
"$ARTIFACT_RUN_ID" "$ARTIFACT_RUN_ATTEMPT"
14031406
1404-
- name: Download root Dockerfile image artifact
1407+
- name: Download candidate payload artifact
14051408
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
14061409
with:
1407-
artifact-ids: ${{ needs.root_dockerfile_image.outputs.artifact_id }}
1408-
path: ${{ runner.temp }}/install-smoke-root-image
1409-
run-id: ${{ needs.root_dockerfile_image.outputs.artifact_run_id }}
1410+
artifact-ids: ${{ needs.installer_smoke_candidate_payload.outputs.artifact_id }}
1411+
path: ${{ runner.temp }}/install-smoke-candidate-payload
1412+
run-id: ${{ needs.installer_smoke_candidate_payload.outputs.artifact_run_id }}
14101413
github-token: ${{ github.token }}
14111414

1412-
- name: Verify and load root Dockerfile image artifact
1413-
env:
1414-
IMAGE_REF: ${{ needs.root_dockerfile_image.outputs.image_ref }}
1415-
OPENCLAW_SHARED_IMAGE_ARCHIVE_SHA256: ${{ needs.root_dockerfile_image.outputs.archive_sha256 }}
1416-
OPENCLAW_SHARED_IMAGE_RUN_ATTEMPT: ${{ needs.root_dockerfile_image.outputs.artifact_run_attempt }}
1417-
OPENCLAW_SHARED_IMAGE_RUN_ID: ${{ needs.root_dockerfile_image.outputs.artifact_run_id }}
1418-
TARGET_SHA: ${{ needs.preflight.outputs.target_sha }}
1419-
WORKFLOW_SHA: ${{ steps.workflow.outputs.sha }}
1420-
run: |
1421-
set -euo pipefail
1422-
bash .release-harness/scripts/docker/shared-image-artifact.sh \
1423-
load "${RUNNER_TEMP}/install-smoke-root-image" install-smoke-root \
1424-
"$TARGET_SHA" "$WORKFLOW_SHA" "$IMAGE_REF"
1425-
1426-
- name: Require local root Dockerfile image
1427-
env:
1428-
IMAGE_REF: ${{ needs.root_dockerfile_image.outputs.image_ref }}
1429-
run: docker image inspect "$IMAGE_REF" >/dev/null
1430-
14311415
- name: Setup trusted release harness for Bun smoke
14321416
uses: ./.release-harness/.github/actions/setup-release-harness
14331417
with:
14341418
node-version: "24.x"
14351419

1420+
- name: Verify candidate payload contents
1421+
env:
1422+
HARNESS_REPOSITORY: ${{ steps.workflow.outputs.repository }}
1423+
HARNESS_SHA: ${{ steps.workflow.outputs.sha }}
1424+
MANIFEST_SHA256: ${{ needs.installer_smoke_candidate_payload.outputs.manifest_sha256 }}
1425+
PACKAGE_VERSION: ${{ needs.installer_smoke_candidate_payload.outputs.package_version }}
1426+
PRODUCER_RUN_ATTEMPT: ${{ needs.installer_smoke_candidate_payload.outputs.artifact_run_attempt }}
1427+
PRODUCER_RUN_ID: ${{ needs.installer_smoke_candidate_payload.outputs.artifact_run_id }}
1428+
SOURCE_ARCHIVE_SHA256: ${{ needs.installer_smoke_candidate_payload.outputs.source_archive_sha256 }}
1429+
TARGET_REPOSITORY: ${{ needs.installer_smoke_candidate_payload.outputs.repository }}
1430+
TARGET_SHA: ${{ needs.preflight.outputs.target_sha }}
1431+
run: |
1432+
set -euo pipefail
1433+
node .release-harness/scripts/install-smoke-candidate-payload.mts verify \
1434+
--payload-dir "${RUNNER_TEMP}/install-smoke-candidate-payload" \
1435+
--repository "$TARGET_REPOSITORY" \
1436+
--target-sha "$TARGET_SHA" \
1437+
--harness-repository "$HARNESS_REPOSITORY" \
1438+
--harness-sha "$HARNESS_SHA" \
1439+
--run-id "$PRODUCER_RUN_ID" \
1440+
--run-attempt "$PRODUCER_RUN_ATTEMPT" \
1441+
--package-version "$PACKAGE_VERSION" \
1442+
--manifest-sha256 "$MANIFEST_SHA256" \
1443+
--source-archive-sha256 "$SOURCE_ARCHIVE_SHA256"
1444+
14361445
- name: Install Bun for global smoke
14371446
run: npm install -g [email protected]
14381447

1439-
- name: Run Bun global install image-provider smoke
1448+
- name: Run Bun global install candidate-payload smoke
14401449
working-directory: .release-harness
14411450
env:
1442-
OPENCLAW_BUN_GLOBAL_SMOKE_ALLOW_UNRELEASED_CHANGELOG: ${{ inputs.allow_unreleased_changelog }}
1443-
OPENCLAW_BUN_GLOBAL_SMOKE_DIST_IMAGE: ${{ needs.root_dockerfile_image.outputs.image_ref }}
14441451
OPENCLAW_BUN_GLOBAL_SMOKE_HOST_BUILD: "0"
1452+
OPENCLAW_BUN_GLOBAL_SMOKE_PACKAGE_TGZ: ${{ runner.temp }}/install-smoke-candidate-payload/candidate.tgz
14451453
run: bash scripts/e2e/bun-global-install-smoke.sh
14461454

14471455
docker-e2e-fast:

‎test/scripts/install-smoke-no-push-workflow.test.ts‎

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ describe("install smoke no-push root image transport", () => {
305305

306306
it("verifies and loads the immutable artifact in every consumer", () => {
307307
const workflow = readWorkflow(INSTALL_SMOKE_REUSABLE);
308-
for (const jobName of ["root_dockerfile_smokes", "bun_global_install_smoke"]) {
308+
for (const jobName of ["root_dockerfile_smokes"]) {
309309
const consumer = job(workflow, jobName);
310310
expect(consumer.needs, jobName).toContain("root_dockerfile_image_ready");
311311
expect(consumer.env?.OPENCLAW_DOCKER_E2E_REQUIRE_LOCAL_IMAGE, jobName).toBe("1");
@@ -367,7 +367,7 @@ describe("install smoke no-push root image transport", () => {
367367
}
368368

369369
const text = readFileSync(INSTALL_SMOKE_REUSABLE, "utf8");
370-
expect(text.match(/verify-upload "Root image"/g)).toHaveLength(2);
370+
expect(text.match(/verify-upload "Root image"/g)).toHaveLength(1);
371371
expect(text).not.toContain("gh api");
372372
});
373373

@@ -507,15 +507,54 @@ describe("install smoke no-push root image transport", () => {
507507
}
508508

509509
const bunConsumer = job(workflow, "bun_global_install_smoke");
510+
expect(bunConsumer.needs).toEqual(["preflight", "installer_smoke_candidate_payload"]);
511+
const bunBinding = step(bunConsumer, "Validate candidate payload artifact binding");
512+
expect(bunBinding.env).toMatchObject({
513+
ARTIFACT_DIGEST: "${{ needs.installer_smoke_candidate_payload.outputs.artifact_digest }}",
514+
ARTIFACT_ID: "${{ needs.installer_smoke_candidate_payload.outputs.artifact_id }}",
515+
ARTIFACT_RUN_ATTEMPT:
516+
"${{ needs.installer_smoke_candidate_payload.outputs.artifact_run_attempt }}",
517+
ARTIFACT_RUN_ID: "${{ needs.installer_smoke_candidate_payload.outputs.artifact_run_id }}",
518+
ARTIFACT_HARNESS_SHA: "${{ needs.installer_smoke_candidate_payload.outputs.harness_sha }}",
519+
ARTIFACT_TARGET_SHA: "${{ needs.installer_smoke_candidate_payload.outputs.target_sha }}",
520+
HARNESS_SHA: "${{ steps.workflow.outputs.sha }}",
521+
TARGET_SHA: "${{ needs.preflight.outputs.target_sha }}",
522+
});
523+
expect(bunBinding.run).toContain('[[ "$ARTIFACT_HARNESS_SHA" == "$HARNESS_SHA" ]]');
524+
expect(bunBinding.run).toContain("verify-upload");
525+
expect(step(bunConsumer, "Download candidate payload artifact").with).toMatchObject({
526+
"artifact-ids": "${{ needs.installer_smoke_candidate_payload.outputs.artifact_id }}",
527+
"run-id": "${{ needs.installer_smoke_candidate_payload.outputs.artifact_run_id }}",
528+
});
510529
expect(step(bunConsumer, "Setup trusted release harness for Bun smoke")).toMatchObject({
511530
uses: "./.release-harness/.github/actions/setup-release-harness",
512531
with: { "node-version": "24.x" },
513532
});
533+
const bunVerify = step(bunConsumer, "Verify candidate payload contents");
534+
expect(bunVerify.env).toMatchObject({
535+
MANIFEST_SHA256: "${{ needs.installer_smoke_candidate_payload.outputs.manifest_sha256 }}",
536+
PACKAGE_VERSION: "${{ needs.installer_smoke_candidate_payload.outputs.package_version }}",
537+
PRODUCER_RUN_ATTEMPT:
538+
"${{ needs.installer_smoke_candidate_payload.outputs.artifact_run_attempt }}",
539+
PRODUCER_RUN_ID: "${{ needs.installer_smoke_candidate_payload.outputs.artifact_run_id }}",
540+
SOURCE_ARCHIVE_SHA256:
541+
"${{ needs.installer_smoke_candidate_payload.outputs.source_archive_sha256 }}",
542+
});
543+
expect(bunVerify.run).toContain("install-smoke-candidate-payload.mts verify");
544+
expect(bunVerify.run).toContain('--run-id "$PRODUCER_RUN_ID"');
545+
expect(bunVerify.run).toContain('--run-attempt "$PRODUCER_RUN_ATTEMPT"');
514546
expect(step(bunConsumer, "Install Bun for global smoke").run).toBe("npm install -g [email protected]");
515-
expect(step(bunConsumer, "Run Bun global install image-provider smoke")).toMatchObject({
547+
expect(step(bunConsumer, "Run Bun global install candidate-payload smoke")).toMatchObject({
516548
"working-directory": ".release-harness",
549+
env: {
550+
OPENCLAW_BUN_GLOBAL_SMOKE_HOST_BUILD: "0",
551+
OPENCLAW_BUN_GLOBAL_SMOKE_PACKAGE_TGZ:
552+
"${{ runner.temp }}/install-smoke-candidate-payload/candidate.tgz",
553+
},
517554
run: "bash scripts/e2e/bun-global-install-smoke.sh",
518555
});
556+
expect(JSON.stringify(bunConsumer)).not.toContain("root_dockerfile_image");
557+
expect(JSON.stringify(bunConsumer)).not.toContain("OPENCLAW_BUN_GLOBAL_SMOKE_DIST_IMAGE");
519558
expect(JSON.stringify(bunConsumer)).not.toContain(
520559
"./.release-harness/.github/actions/setup-node-env",
521560
);
@@ -658,7 +697,7 @@ describe("install smoke no-push root image transport", () => {
658697
});
659698
});
660699

661-
it("passes package changelog intent only to current-tree smoke scripts", () => {
700+
it("passes package changelog intent only to the candidate packager", () => {
662701
const workflow = readWorkflow(INSTALL_SMOKE_REUSABLE);
663702
expect(
664703
step(
@@ -668,12 +707,8 @@ describe("install smoke no-push root image transport", () => {
668707
).toMatchObject({
669708
ALLOW_UNRELEASED_CHANGELOG: "${{ inputs.allow_unreleased_changelog }}",
670709
});
671-
expect(
672-
step(job(workflow, "bun_global_install_smoke"), "Run Bun global install image-provider smoke")
673-
.env,
674-
).toMatchObject({
675-
OPENCLAW_BUN_GLOBAL_SMOKE_ALLOW_UNRELEASED_CHANGELOG:
676-
"${{ inputs.allow_unreleased_changelog }}",
677-
});
710+
expect(JSON.stringify(job(workflow, "bun_global_install_smoke"))).not.toContain(
711+
"OPENCLAW_BUN_GLOBAL_SMOKE_ALLOW_UNRELEASED_CHANGELOG",
712+
);
678713
});
679714
});

0 commit comments

Comments
 (0)