You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add coverage for loadManifest's source preference order and its remote path #7
loadManifest in packages/cli/src/manifest.ts documents a four-step preference order:
explicit --manifest <path>
manifests/ in a local checkout passed via --repo
manifests/cycle-<id>.json fetched from GitHub at --ref
manifests/cycle-<id>.json in the current working directory
No test in packages/cli/test/ touches this function (nothing references loadManifest, fetchImpl or FetchTextLike), even though claim, status and report all depend on it and it is the single point where a wrong manifest becomes a wrong payout.
Please add unit tests (a stubbed fetchImpl plus temp directories, following test/fixtures.ts):
each of the four sources resolves, and a higher-precedence source wins over a lower one;
candidateLocalPaths order (manifests/cycle-N.json, manifests/N.json, cycle-N.json);
packages/cli/test/manifest.test.ts now exercises everything this issue listed:
the four-step preference order (explicit path → local checkout via --repo → remote at --ref → working directory), including that a higher-precedence source wins and that the lower one is never called;
candidateLocalPaths order;
the remote URL shape (raw.githubusercontent.com/<repo>/<ref>/manifests/cycle-<id>.json);
404 → ManifestNotFoundError naming --repo/--ref/--manifest; invalid JSON and valid-JSON-but-not-a-manifest → ManifestParseError naming the URL; and a transport failure;
LoadedManifest.json being the exact text that was parsed.
The fetch stub rejects a second text() call, like real fetch, which is how the suite caught the double-read bug fixed in the same PR (#2). The CLI suite is 90 tests, up from 77, and npm run typecheck is clean.
Record correction: #13's description and commit trailer said "Part of #8" — that was a typo for this issue (#7). #8 is the percent/XLM formatting dedup, which is untouched.
Activity
Oyinkans0la12 commentedon Sep 14, 2026
Covered by #13, merged as
7cda63e.packages/cli/test/manifest.test.tsnow exercises everything this issue listed:--repo→ remote at--ref→ working directory), including that a higher-precedence source wins and that the lower one is never called;candidateLocalPathsorder;raw.githubusercontent.com/<repo>/<ref>/manifests/cycle-<id>.json);ManifestNotFoundErrornaming--repo/--ref/--manifest; invalid JSON and valid-JSON-but-not-a-manifest →ManifestParseErrornaming the URL; and a transport failure;LoadedManifest.jsonbeing the exact text that was parsed.The fetch stub rejects a second
text()call, like realfetch, which is how the suite caught the double-read bug fixed in the same PR (#2). The CLI suite is 90 tests, up from 77, andnpm run typecheckis clean.Record correction: #13's description and commit trailer said "Part of #8" — that was a typo for this issue (#7). #8 is the percent/XLM formatting dedup, which is untouched.