mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-22 18:38:12 +00:00
fix(release): tolerate npm propagation after publish
This commit is contained in:
@@ -1853,6 +1853,8 @@ describe("package artifact reuse", () => {
|
||||
"already has a public GitHub release page without complete postpublish evidence",
|
||||
);
|
||||
expect(releaseWorkflow).toContain("registry tarball");
|
||||
expect(releaseWorkflow).toContain("openclawNpmTarball");
|
||||
expect(releaseWorkflow).not.toContain('npm view "openclaw@${release_version}" dist.tarball');
|
||||
expect(releaseWorkflow).toContain("release SHA");
|
||||
expect(clawHubReleasePlanScript).toContain("not awaited by this proof");
|
||||
expect(releaseWorkflow).toContain("wait_for_job_success");
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
parseNpmViewFields,
|
||||
parseReleaseVerifyBetaArgs,
|
||||
readBoundedJsonResponse,
|
||||
runNpmViewWithRetry,
|
||||
} from "../../scripts/lib/release-beta-verifier.ts";
|
||||
|
||||
describe("parseReleaseVerifyBetaArgs", () => {
|
||||
@@ -90,6 +91,7 @@ describe("parseNpmViewFields", () => {
|
||||
version: "2026.5.10-beta.3",
|
||||
"dist-tags.beta": "2026.5.10-beta.3",
|
||||
"dist.integrity": "sha512-test",
|
||||
"dist.tarball": "https://registry.example/openclaw.tgz",
|
||||
}),
|
||||
"beta",
|
||||
),
|
||||
@@ -97,6 +99,7 @@ describe("parseNpmViewFields", () => {
|
||||
version: "2026.5.10-beta.3",
|
||||
distTagVersion: "2026.5.10-beta.3",
|
||||
integrity: "sha512-test",
|
||||
tarball: "https://registry.example/openclaw.tgz",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -106,7 +109,10 @@ describe("parseNpmViewFields", () => {
|
||||
JSON.stringify({
|
||||
version: "2026.5.10-beta.3",
|
||||
"dist-tags": { beta: "2026.5.10-beta.3" },
|
||||
dist: { integrity: "sha512-test" },
|
||||
dist: {
|
||||
integrity: "sha512-test",
|
||||
tarball: "https://registry.example/openclaw.tgz",
|
||||
},
|
||||
}),
|
||||
"beta",
|
||||
),
|
||||
@@ -114,10 +120,38 @@ describe("parseNpmViewFields", () => {
|
||||
version: "2026.5.10-beta.3",
|
||||
distTagVersion: "2026.5.10-beta.3",
|
||||
integrity: "sha512-test",
|
||||
tarball: "https://registry.example/openclaw.tgz",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("runNpmViewWithRetry", () => {
|
||||
it("retries transient registry failures with online metadata reads", async () => {
|
||||
const calls: string[][] = [];
|
||||
const delays: number[] = [];
|
||||
|
||||
await expect(
|
||||
runNpmViewWithRetry(["view", "openclaw@2026.5.10-beta.3", "version", "--json"], {
|
||||
attempts: 3,
|
||||
delay: async (delayMs) => {
|
||||
delays.push(delayMs);
|
||||
},
|
||||
run: (args) => {
|
||||
calls.push(args);
|
||||
if (calls.length < 3) {
|
||||
throw new Error("npm registry has not propagated the release yet");
|
||||
}
|
||||
return '"2026.5.10-beta.3"';
|
||||
},
|
||||
}),
|
||||
).resolves.toBe('"2026.5.10-beta.3"');
|
||||
|
||||
expect(calls).toHaveLength(3);
|
||||
expect(calls.every((args) => args.at(-1) === "--prefer-online")).toBe(true);
|
||||
expect(delays).toEqual([1000, 2000]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("readBoundedJsonResponse", () => {
|
||||
it("parses JSON bodies within the release verifier limit", async () => {
|
||||
await expect(
|
||||
|
||||
Reference in New Issue
Block a user