chore(ci): make attw faster, skip opaque binary blob - #4481
Conversation
The attw gate packed the working tree verbatim, so the tarball it checked carried the debug .node binary: 630MB, 99.7% of the archive, gzipped on every run and never loaded by attw (it type-checks the JS/DTS surface only). The release workflow already runs 'rm -f dist/*.node' before publishing - native binaries ship as per-platform sub-packages - so the gate was validating a tarball 630MB larger than anything a consumer can install. Pack from a staging directory that excludes *.node with an otherwise identical file set and identical attw argv. Verdicts are byte-identical on the current tree; the check now matches the published shape instead of accidentally diverging from it. Measured 59.4s -> 4.2s locally and 61.0s -> 5.1s in CI for the attw step.
|
@harivansh-afk is attempting to deploy a commit to the Boundary Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe package validation flow now uses a local Node.js checker. The checker stages Changesattw validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to The change substantially reduces attw packaging time, but the staging package should be confirmed to preserve npm’s complete published file set, including any auto-included README or LICENSE files. The PR is otherwise mergeable with this bounded follow-up. Sequence Diagram(s)sequenceDiagram
participant PackageScript
participant AttwCheck
participant TemporaryPackage
participant Attw
PackageScript->>AttwCheck: Invoke local checker
AttwCheck->>TemporaryPackage: Stage package.json and filtered dist/
AttwCheck->>Attw: Run attw with forwarded arguments
Attw-->>AttwCheck: Return validation status
AttwCheck->>TemporaryPackage: Remove temporary directory
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
sxlijin
left a comment
There was a problem hiding this comment.
The staging wrapper itself is well-scoped and node --check baml_language/sdks/typescript/bridge_typescript/typescript_src/attw-check.js passes. There is one applicability gap against current canary, though: the generated TypeScript SDK harness still emits
pnpm exec attw --pack --profile esm-only
at baml_language/sdk_tests/harness_setup/src/typescript.rs:205. That invokes the dependency binary directly and bypasses the new package.json script, so the CI path this PR is intended to speed up does not use attw-check.js.
Please either change that command to pnpm run attw in this PR, or merge #4485 first (it already makes that exact harness change). With #4485 first, this PR remains independently useful and should merge cleanly; without it, this patch has no effect on the generated SDK-test attw invocation. There is no path or semantic conflict with #4483 or the already-merged #4499.
|
Why this needs a wrapper instead of a flag:
Changing the package's normal publish/include rules is also the wrong layer. The local debug build leaves the addon under That is why the script:
The measured cost in the patch is 59.4s with the 630 MiB addon versus 4.2s without it, with byte-identical ATTW output; the complexity is isolating the packaging input safely, not changing the type analysis. |
…ackage script The generated SDK-test harness invoked `pnpm exec attw --pack --profile esm-only` directly, bypassing the `attw` package script this PR rewires to the staging wrapper - so the CI path this PR speeds up never used it (review finding on this PR). Now self-contained: no sequencing dependency on any other PR. Safe on trees without this PR's package.json change too: the `attw` script already exists on canary with the old command.
|
Now self-contained (6b9f817): the generated harness invokes |
The attw gate packs the working tree verbatim, so the tarball it checks carries the debug
.nodebinary: 630MB, 99.7% of the archive, gzipped on every CI run and never loaded by attw (it type-checks the JS/DTS surface only).The interesting part: your release workflow already runs
rm -f dist/*.nodebefore publishing - native binaries ship as per-platform sub-packages - so the gate was validating a tarball 630MB larger than anything a consumer can actually install.This packs from a staging directory that excludes
*.node, with an otherwise identical file set and identical attw argv. Verdicts are byte-identical on the current tree, and the check now matches the published shape instead of accidentally diverging from it.Measured: 61.0s → 5.1s for the attw step in CI (59.4s → 4.2s locally).
Summary by CodeRabbit
Bug Fixes
Chores