fix: support shrunk client payloads on v2-lite - #569
Conversation
client_payload arrives as plain JSON, base64(gzip), or a reference to a server-stashed payload. v2-lite resolved fields with fromJSON(fromJSON(inputs.client_payload)) in four places, which throws on the last two shapes before any step runs. Two changes are needed, because the YAML fix alone is not sufficient: - action.yml resolves the fields it needs for step expressions via scripts/resolve-payload-fields.js, as v2 does. CLIENT_PAYLOAD is still passed through untouched. - The engine bundle is bumped from core 2.1.246 to 2.1.301. The action deliberately does not inflate CLIENT_PAYLOAD itself - the payload is ~1.4MB+ inflated, so pushing it through a step output would risk E2BIG and defeat the compression. The engine inflates it, and 2.1.246 has no support for the envelope, so the checkout would succeed and the engine would then fail. The lite properties are preserved: dist is rebuilt with this branch's own package script (ncc + copy-wasm), so dist/node_modules still contains only @wasm-fmt rather than v2's vendored octokit/axios/lodash/moment, the runtime "Install Dependencies for plugins" step is untouched, and no NODE_PATH is introduced. The existing action pins (checkout v6, github-script v8, upload-artifact v6) are left as they are - the new step reuses this branch's github-script v8 rather than importing v2's v9. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Secrets | View in Orca |
There was a problem hiding this comment.
✨ PR Review
The PR is well-structured and correctly addresses the three payload shapes. The resolution script is clean, the security mitigations (origin check, size cap, secret masking) are solid, and the test coverage is thorough. One functional gap stands out in the updated action.yml.
1 issues detected:
🐞 Bug - `steps.payload-fields.outputs.github_token` is now resolved and masked, but the cm repo and cm org checkout steps are not using it — they were not updated alongside the base-branch checkout.
Details: The "Checkout cm repo" and "Checkout cm org" steps do not supply a token field. The entire motivation of this PR is to make the github_token from the payload available to downstream steps — the base-branch checkout was correctly updated to use steps.payload-fields.outputs.github_token || github.token, but the two CM checkouts were not. If either CM repository is private, these steps will fall back to the default GITHUB_TOKEN, which may not have access, silently producing a clone failure or an empty checkout that the engine then processes incorrectly.
File: action.yml (119-133)
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how
Same resolver change as develop: parse first and switch on the value of `type`, so the double-encoded compressed-payload envelope the GitHub trigger will send is inflated instead of being mistaken for a raw payload and silently resolving to empty fields. Both compressed forms stay supported permanently - Bitbucket has no run-name to protect and keeps sending the bare base64(gzip) form. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Same coverage as develop. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Same diagnostic as develop. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Closing — not needed. Shrink-payload support is landing on |
Problem
client_payloadarrives in one of three shapes — plain JSON,base64(gzip(JSON)), or a small reference to a payload stashed on the resolver. v2-lite read fields out of it withfromJSON(fromJSON(inputs.client_payload))in four places, which throws on the last two shapes before any step runs.Why the YAML fix alone is not enough
action.ymldeliberately passesCLIENT_PAYLOADthrough untouched — the action resolves only the fields needed for step expressions, and the engine inflates the payload. That's intentional: inflated it's ~1.4MB+, so pushing it through a step output would riskE2BIGand defeat the compression entirely.So the engine has to understand the envelope, and v2-lite's does not:
Without the bump the checkout steps would succeed and
dist/index.jswould then fail. Hence two changes.Changes
action.yml— resolve the fields viascripts/resolve-payload-fields.js, as v2 does.@linearb/gitstream-core2.1.246→2.1.301,dist/rebuilt.Lite properties preserved
dist/was rebuilt with this branch's ownpackagescript (ncc+copy-wasm) rather than copied from v2 — copying would have broken the thing that makes this branch lite:Also untouched: the runtime
Install Dependencies for pluginsstep, the absence ofNODE_PATH, and the existing action pins — the new step reuses this branch'sgithub-script@v8rather than importing v2's v9.checkout@v6,upload-artifact@v6,ALL=100and the git-fetch behaviour are all left as they are.Verification
oversized-payload-reference,payloadUrl,gunzipSync.steps.payload-fields.outputs.*references match the 7 keys emitted.Known follow-up (not in this PR)
dist/still carries four orphaned chunk files from the January build —407/582/788/888.index.jsand a root-levelruff_fmt_bg.wasm. The current build emits only178/880/966/index.js(matching v2 exactly), so these are dead weight on a branch whose point is being lite. Left alone deliberately: deleting build artifacts isn't part of a payload fix, and a smaller diff is easier to review. Worth a separate cleanup.Separately: this branch's releases have silently no-opped since January because a stray
v2-litetag shadows thev2-litebranch, sogit checkout v2-litein the release job detaches onto the tag and the push is a no-op. That needs fixing before anything here reaches consumers.🤖 Generated with Claude Code
✨ PR Description
Purpose: Enable v2-lite action version to handle compressed and oversized client payloads through a dedicated payload resolution utility.
Main changes:
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how