Skip to content

Commit 11542c1

Browse files
committed
perf(release): shorten full validation evidence collection
1 parent a9c85d4 commit 11542c1

9 files changed

Lines changed: 714 additions & 227 deletions

‎.github/workflows/full-release-validation.yml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ jobs:
195195
with:
196196
ref: ${{ github.sha }}
197197
path: workflow
198+
sparse-checkout: |
199+
scripts/release-tooling-identity.mjs
200+
scripts/github/resolve-openclaw-ref.sh
201+
scripts/github/validate-release-suite-filters.sh
202+
scripts/full-release-candidate-contract.mjs
203+
scripts/full-release-validation-policy.mjs
204+
scripts/lib/record-shared.mjs
205+
scripts/lib/canonical-json.mjs
206+
scripts/lib/upgrade-survivor-policy.mjs
207+
sparse-checkout-cone-mode: false
198208
fetch-depth: 1
199209
persist-credentials: false
200210
submodules: false
@@ -554,6 +564,26 @@ jobs:
554564
with:
555565
ref: ${{ github.sha }}
556566
path: workflow
567+
sparse-checkout: |
568+
scripts/github/find-reusable-release-validation.sh
569+
scripts/release-ci-summary.mjs
570+
scripts/full-release-validation-policy.mjs
571+
scripts/full-release-candidate-contract.mjs
572+
scripts/release-preflight.mjs
573+
scripts/release-preflight.mts
574+
scripts/windows-cmd-helpers.mjs
575+
scripts/lib/canonical-json.mjs
576+
scripts/lib/record-shared.mjs
577+
scripts/lib/upgrade-survivor-policy.mjs
578+
scripts/lib/plain-gh.mjs
579+
scripts/lib/tsx-cli-shim.mjs
580+
scripts/lib/local-check-runtime.mts
581+
scripts/lib/failed-trailer.mts
582+
scripts/lib/error-format.mts
583+
scripts/lib/managed-child-process.mts
584+
scripts/lib/windows-taskkill.mjs
585+
scripts/lib/release-version.mjs
586+
sparse-checkout-cone-mode: false
557587
fetch-depth: 1
558588
persist-credentials: false
559589
submodules: false
@@ -563,6 +593,10 @@ jobs:
563593
with:
564594
ref: ${{ needs.resolve_target.outputs.sha }}
565595
path: target
596+
sparse-checkout: |
597+
package.json
598+
apps/macos/Sources/OpenClaw/Resources/Info.plist
599+
sparse-checkout-cone-mode: false
566600
fetch-depth: 1
567601
persist-credentials: false
568602
submodules: false

‎docs/reference/full-release-validation.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,16 @@ run. Evidence reuse runs only from `main` or a canonical SHA-pinned
271271
`release-ci/*` ref whose workflow commit remains on trusted `main` lineage;
272272
other workflow refs run the selected lanes fresh.
273273

274+
The reuse search checks each bound parent manifest for eligibility before
275+
loading its child runs, job logs, and execution plan. Incompatible profiles,
276+
inputs, targets, and non-root runs are rejected early. Eligible candidates
277+
still undergo complete provenance and attempt verification before reuse.
278+
The verifier reads independent children concurrently (at most seven), retains
279+
each attempt's job data for its policy checks, and waits for all reads before
280+
reporting success or failure. Attempts and pagination within each child remain
281+
sequential. Target resolution and reuse checkouts include only their tooling
282+
and release metadata; neither needs the complete source tree.
283+
274284
Fresh package-facing validation calls the `Full Release Candidate` reusable
275285
workflow once. Plugin Prerelease and OpenClaw Release Checks each dispatch an
276286
independent phase immediately, while their candidate phases wait for acquisition.

‎scripts/github/find-reusable-release-validation.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,21 @@ if [[ "$run_count" == "0" ]]; then
237237
no_reuse "no prior successful validation runs"
238238
fi
239239

240+
reuse_request="$(jq -nc \
241+
--arg targetSha "$TARGET_SHA" \
242+
--arg releaseProfile "$RELEASE_PROFILE" \
243+
--arg runReleaseSoak "$RUN_RELEASE_SOAK" \
244+
--argjson validationInputs "$expected_inputs" \
245+
'{targetSha: $targetSha, releaseProfile: $releaseProfile, runReleaseSoak: $runReleaseSoak, validationInputs: $validationInputs}')"
246+
240247
for ((index = 0; index < run_count; index += 1)); do
241248
run_id="$(jq -r ".[${index}].id" <<< "$runs_json")"
242249
validation_record=""
243250
if ! validation_record="$(
244251
node "$VALIDATOR" \
245252
--validate-run "$run_id" \
246253
--repo "$REPO" \
254+
--reuse-request-json "$reuse_request" \
247255
--trusted-workflow-ref "$TRUSTED_WORKFLOW_REF" \
248256
--trusted-workflow-full-ref "$TRUSTED_WORKFLOW_FULL_REF" \
249257
--trusted-workflow-sha "$TRUSTED_WORKFLOW_SHA" \

‎scripts/lib/plain-gh.mjs‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { execFileSync } from "node:child_process";
1+
import { execFile, execFileSync } from "node:child_process";
22
import fs from "node:fs";
3+
import { promisify } from "node:util";
34

45
/** @typedef {import("node:child_process").ExecFileSyncOptions} ExecFileSyncOptions */
56
/** @typedef {import("node:child_process").ExecFileSyncOptionsWithBufferEncoding} ExecFileSyncOptionsWithBufferEncoding */
@@ -13,6 +14,7 @@ import fs from "node:fs";
1314
*/
1415

1516
const PLAIN_GH_MAX_BUFFER_BYTES = 32 * 1024 * 1024;
17+
const execFileAsync = promisify(execFile);
1618

1719
/**
1820
* @param {string} filePath
@@ -167,15 +169,35 @@ export function execPlainGh(args, options = {}) {
167169
* @returns {string | Uint8Array<ArrayBuffer>}
168170
*/
169171
export function execGhRead(args, options = {}, params = {}) {
170-
const env = plainGhEnv(options.env ?? process.env);
171-
// Cache-aware reads stay on PATH even when another caller selects an explicit binary.
172-
delete env.OPENCLAW_GH_BIN;
173172
const execFileSyncImpl = params.execFileSyncImpl ?? execFileSync;
174173
return execFileSyncImpl("gh", args, {
175174
...options,
176-
env,
175+
env: ghReadEnv(options.env),
176+
maxBuffer: options.maxBuffer ?? PLAIN_GH_MAX_BUFFER_BYTES,
177+
});
178+
}
179+
180+
/** @param {NodeJS.ProcessEnv} [env] */
181+
function ghReadEnv(env) {
182+
const next = plainGhEnv(env);
183+
// Cache-aware reads stay on PATH even when another caller selects an explicit binary.
184+
delete next.OPENCLAW_GH_BIN;
185+
return next;
186+
}
187+
188+
/**
189+
* @param {readonly string[]} args
190+
* @param {import("node:child_process").ExecFileOptions} [options]
191+
* @returns {Promise<string>}
192+
*/
193+
export async function execGhReadAsync(args, options = {}) {
194+
const { stdout } = await execFileAsync("gh", args, {
195+
...options,
196+
encoding: "utf8",
197+
env: ghReadEnv(options.env),
177198
maxBuffer: options.maxBuffer ?? PLAIN_GH_MAX_BUFFER_BYTES,
178199
});
200+
return stdout;
179201
}
180202

181203
/**

0 commit comments

Comments
 (0)