mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 09:39:25 +00:00
* fix(ci): keep preflight job outputs under GitHub's 1 MiB cap Pull requests that need the full canonical Node test plan failed preflight with "Job outputs exceed 1,048,576 bytes", which made ci-gate report every lane as selected=missing. The compact plan lists 7,749 striped test files explicitly, and GitHub measures job outputs in UTF-16, so the effective cap for all preflight outputs is 524,288 characters. The manifest reached ~522K characters on the github profile as the tracked test inventory grew. Emit each Node matrix row's groups as gzip+base64 JSON at the manifest boundary and unpack them in the shard runner. On current main this takes the github-profile manifest from 522,522 to 195,410 characters and the blacksmith profile from 450,639 to 158,571, with identical jobs and group membership. The manifest imports the codec through the existing target-plan seam, the trusted runner checkout lists it, and plain OPENCLAW_NODE_TEST_GROUPS_JSON remains for the Vitest cache warmer. Related to #139929 and #136820. * fix(ci): load the Node test groups codec only for grouped rows The manifest imported scripts/lib/ci-node-test-groups-codec.mts unconditionally through importTargetPlan. An ordinary manual workflow_dispatch whose target_ref predates the codec is not a compatibility target, so the import threw before planning even though such targets emit an ungrouped plan and never call the encoder. Import the codec only when the emitted Node rows carry groups, and keep the clear failure when a grouped plan comes from a target without it. The workflow-guard fixture can now omit the codec so a codec-free manual target runs the real manifest step. * fix(ci): preserve grouped historical test plans Negotiate the packed group codec against the selected target and fall back to the same five-field legacy projection when the codec is unavailable. Five-field projection adapted from #140036. Co-authored-by: Peter Steinberger <steipete@gmail.com> --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org> Co-authored-by: Peter Steinberger <steipete@gmail.com>
21 lines
1 KiB
TypeScript
21 lines
1 KiB
TypeScript
// Packs Node test shard groups for the CI job-output boundary.
|
|
//
|
|
// GitHub caps a job's outputs at 1 MiB measured in UTF-16, so the preflight
|
|
// manifest has 524,288 characters for every matrix combined. The full
|
|
// pull-request compact plan lists each striped test file explicitly, which
|
|
// alone reached that cap; gzip+base64 keeps the per-row payload proportional
|
|
// to the compressed file list instead of the raw path bytes. The shard runner
|
|
// unpacks the same envelope, so both sides must ship from one revision.
|
|
import { gunzipSync, gzipSync } from "node:zlib";
|
|
|
|
export function encodeNodeTestGroups(groups: readonly unknown[]): string {
|
|
return gzipSync(Buffer.from(JSON.stringify(groups), "utf8")).toString("base64");
|
|
}
|
|
|
|
export function decodeNodeTestGroups(encoded: string): unknown[] {
|
|
const parsed: unknown = JSON.parse(gunzipSync(Buffer.from(encoded, "base64")).toString("utf8"));
|
|
if (!Array.isArray(parsed)) {
|
|
throw new Error("Packed node test groups must decode to a JSON array");
|
|
}
|
|
return parsed;
|
|
}
|