mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
fix(release): accept trusted tooling lineage evidence (#130865)
This commit is contained in:
@@ -329,7 +329,10 @@ for ((index = 0; index < run_count; index += 1)); do
|
||||
)
|
||||
else
|
||||
.manifestVersion == 3
|
||||
and .workflowRefProof == "manifest-v3-protected-tag-exact-sha"
|
||||
and (
|
||||
.workflowRefProof == "manifest-v3-protected-tag-exact-sha"
|
||||
or .workflowRefProof == "manifest-v3-protected-tag-tooling-lineage"
|
||||
)
|
||||
and (.workflowRef | test("^release-ci/[0-9a-f]{12}-[1-9][0-9]*$"))
|
||||
and (.workflowRef | startswith("release-ci/\($parent.workflowSha[0:12])-"))
|
||||
end
|
||||
|
||||
@@ -667,6 +667,71 @@ describe("scripts/github/find-reusable-release-validation.sh", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("reuses strict evidence produced by an ancestor of the protected tooling tag", () => {
|
||||
const { clone, priorSha } = getSharedRepo();
|
||||
const producerSha = "d".repeat(40);
|
||||
const trustedWorkflowRef = `release-publish/${VERIFIER_SHA.slice(0, 12)}-456`;
|
||||
const producerRef = `release-ci/${producerSha.slice(0, 12)}-122`;
|
||||
const record = normalizedEvidence({
|
||||
producerSha,
|
||||
targetSha: priorSha,
|
||||
trustedWorkflowRef,
|
||||
workflowRef: producerRef,
|
||||
});
|
||||
record.current.workflowRefProof = "manifest-v3-protected-tag-tooling-lineage";
|
||||
record.root.workflowRefProof = "manifest-v3-protected-tag-tooling-lineage";
|
||||
const { binDir, fixtures, validatorPath } = setUpFixtures([{ record, runId: "111" }]);
|
||||
|
||||
const result = runResolver({
|
||||
binDir,
|
||||
fixtures,
|
||||
repoDir: clone,
|
||||
targetSha: priorSha,
|
||||
trustedWorkflowRef,
|
||||
validatorPath,
|
||||
verifierOnMain: false,
|
||||
workflowRef: `release-ci/${VERIFIER_SHA.slice(0, 12)}-123`,
|
||||
});
|
||||
|
||||
expect(result.status).toBe(0);
|
||||
expect(parseOutput(result.stdout)).toMatchObject({
|
||||
evidence_run_id: "111",
|
||||
reuse: "true",
|
||||
});
|
||||
});
|
||||
|
||||
it.each(["manifest-v3-protected-tag-diverged", "protected-tag-tooling-lineage"])(
|
||||
"rejects unrecognized protected tooling proof %s",
|
||||
(workflowRefProof) => {
|
||||
const { clone, priorSha } = getSharedRepo();
|
||||
const trustedWorkflowRef = `release-publish/${VERIFIER_SHA.slice(0, 12)}-456`;
|
||||
const producerRef = `release-ci/${VERIFIER_SHA.slice(0, 12)}-122`;
|
||||
const record = normalizedEvidence({
|
||||
producerSha: VERIFIER_SHA,
|
||||
targetSha: priorSha,
|
||||
trustedWorkflowRef,
|
||||
workflowRef: producerRef,
|
||||
});
|
||||
record.current.workflowRefProof = workflowRefProof;
|
||||
record.root.workflowRefProof = workflowRefProof;
|
||||
const { binDir, fixtures, validatorPath } = setUpFixtures([{ record, runId: "111" }]);
|
||||
|
||||
const result = runResolver({
|
||||
binDir,
|
||||
fixtures,
|
||||
repoDir: clone,
|
||||
targetSha: priorSha,
|
||||
trustedWorkflowRef,
|
||||
validatorPath,
|
||||
verifierOnMain: false,
|
||||
workflowRef: `release-ci/${VERIFIER_SHA.slice(0, 12)}-123`,
|
||||
});
|
||||
|
||||
expect(result.status).toBe(0);
|
||||
expect(parseOutput(result.stdout)).toMatchObject({ reuse: "false" });
|
||||
},
|
||||
);
|
||||
|
||||
it.each([
|
||||
{
|
||||
label: "moved protected tag",
|
||||
|
||||
Reference in New Issue
Block a user