Skip to content

fix(aws-lambda): keep the arm64 image staging script out of the published package - #6118

Merged
miguel-heygen merged 2 commits into
mainfrom
fix/lambda-package-release-tools
Oct 23, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
fix/lambda-package-release-tools

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

The v0.8.187 publish job stopped in verify:packed-manifests: with the release's prebuilt/ files added, @hyperframes/aws-lambda measured 73484 bytes packed and 267013 unpacked, over its budgets of 73369 and 266805.

scripts/stage-arm64-image.ts ships in the package but only runs from a checkout (the image workflow and the publish job). Nothing in dist or the CLI imports it, so this keeps it out of the tarball, the same as pin-handler-zip.ts. The budgets stay as they are.

Measured on a built tree with prebuilt/ generated by the real template writer and stand-in pin manifests, npm pack --dry-run: 73022 packed and 267570 unpacked before, 71425 and 262974 after (-1597 B and -4596 B). The publish job reads about 460 B higher packed and 560 B lower unpacked than these local numbers, so it should land near 71885 and 262417.

The PR-time check could not catch this: the publish job adds the two release pins (prebuilt/handler-zip.json, prebuilt/video-image.json) before verify:packed-manifests, and the Build job did not. The verifier now runs the same pin script on sparse stand-ins of release size when no pins exist (and removes them afterwards), so both runs pack the same file list.

Proof, on a full build with the stand-in pins: with main's file list the check fails with aws-lambda unpacked 267013 (the exact figure the publish job reported) over 266805, packed 73405 over 73369; with the exclusion it passes (Verified 14 packages are within their size budgets).

No visible change

Package file list and one CI step only.

…shed package

stage-arm64-image.ts is run from a checkout by the image workflow and the publish job, and nothing in dist or the CLI imports it. With the release's prebuilt/ files added, aws-lambda measured 73484 bytes packed and 267013 unpacked in the publish job, over its budgets of 73369 and 266805, so v0.8.187 did not publish.
@miguel-heygen
miguel-heygen force-pushed the fix/lambda-package-release-tools branch from 5af7b40 to 24ad35b Compare October 23, 2026 07:36

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head 24ad35b4

Scope

stage-arm64-image.ts is only ever run from a checkout (publish.yml:194, lambda-arm64-image.yml:93). Nothing in src, dist or the README points package users to it, so leaving it out of the tarball is safe. The new Build step uses the same pin-handler-zip.ts (plus --video-image) that publish runs before verify:packed-manifests. bun run build doesn't produce handler.zip, so the stand-in assets stay in place, and no later Build step reads prebuilt/. At this head, the Build job's pin and verify:packed-manifests steps both passed. CodeQL, Windows and the Lambda arm64 image runs were still in progress.

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 159 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

@miguel-heygen
miguel-heygen force-pushed the fix/lambda-package-release-tools branch from 24ad35b to cae7bfe Compare October 23, 2026 08:19
…ublish job

The publish job adds prebuilt/handler-zip.json and prebuilt/video-image.json before verify:packed-manifests; the PR check did not, so a package could pass on the PR and fail at publish. The verifier now runs the same pin script on sparse stand-ins of release size when no pins exist, and removes them afterwards. It lives in the verifier, not a Build step, so the edit-accuracy input closure stays unchanged.
@miguel-heygen
miguel-heygen force-pushed the fix/lambda-package-release-tools branch from cae7bfe to 6fdbc80 Compare October 23, 2026 08:25

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE · 0 blocker · 0 important · 0 nits — 0 resolved, 0 open, 0 new · 24ad35b4 → 6fdbc802

The stand-in pins moved into verify-packed-manifests.mjs. Publish is unaffected: its real handler-zip.json makes the new step a no-op. A developer's built zip, image, hashes and pins are moved aside and restored on both the success and error paths. The template the pin script writes is the same one build.mjs writes. The Build job's verify:packed-manifests passed at this head.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 401d065 Oct 23, 2026
66 checks passed
@miguel-heygen
miguel-heygen deleted the fix/lambda-package-release-tools branch October 23, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant