Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions scripts/clawhub-sync.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ import { spawnSync } from "node:child_process";
import { pathToFileURL } from "node:url";

const TAKEN_VERSION = /Version (\d+)\.(\d+)\.(\d+) already exists/;
// The registry hid this one version; any other taken version still fails the sync.
const SKIPPABLE_TAKEN = new Map([["hyperframes-creative", "1.0.13"]]);
// Versions the registry holds but does not list; any other taken version still fails the sync.
const SKIPPABLE_TAKEN = new Map([
["hyperframes-creative", "1.0.13"],
["hyperframes", "1.0.51"],
["hyperframes-cli", "1.0.73"],
["hyperframes-registry", "1.0.15"],
["media-use", "1.0.87"],
["remotion-to-hyperframes", "1.0.17"],
]);
const OWNER_HANDLE = "heygen-com";
const OWNER = ["--owner", OWNER_HANDLE];

Expand Down
20 changes: 20 additions & 0 deletions scripts/clawhub-sync.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,26 @@ describe("ClawHub skill sync", () => {
]);
});

it("publishes one patch past each acknowledged taken version", () => {
const acknowledged = [
["hyperframes", "1.0.51", "1.0.52"],
["hyperframes-cli", "1.0.73", "1.0.74"],
["hyperframes-registry", "1.0.15", "1.0.16"],
["media-use", "1.0.87", "1.0.88"],
["remotion-to-hyperframes", "1.0.17", "1.0.18"],
];
const clawhub = fakeClawhub({
syncFailed: acknowledged.map(([slug, taken]) => ({ slug, message: TAKEN(taken) })),
});

assert.deepEqual(sync(clawhub), []);
const published = clawhub.calls.filter((args) => args[0] === "publish");
assert.deepEqual(
published.map((args) => [args[3], args[args.indexOf("--version") + 1]]),
acknowledged.map(([slug, , next]) => [slug, next]),
);
});

it("fails rather than skipping further when the next patch is taken too", () => {
const clawhub = fakeClawhub({ syncFailed: [creativeTaken], takenVersions: ["1.0.14"] });

Expand Down
Loading