Dashboard › cli › Distillation
f46f5520-ee0d-4589-8769-e2da2cfbf364["lore_tm_v1_d6MZ89n7gZS5JSWpuokOTXfR8UJEyZQhdX5Eu72DKbQ","lore_tm_v1_8nSIRmnhu2u-Z25Lg7dBFPuX7srUVcUtF0FxACizQLM","lore_tm_v1_6mslwGTUDCPTMh1s58ah6o517MvflF7FrlkO0tdVExE","lore_tm_v1_0BYgHIGpc4aWU7MKEQjqC2NifC1TRXSJ4bWTqdYyF9c","lore_tm_v1_9NAshJ4h_7dbXWsG5Vj7QLNljuHU3ULV7DlIIplw1FY"]
packages/cli/test/lib/delta-upgrade.test.ts was 2013 lines. Its "selected source affinity" suite uses importDeltaUpgradeWithVersion(version) with vi.resetModules()/vi.doMock("../../src/lib/constants.js") and restores state via vi.doUnmock() plus vi.resetModules().packages/cli/test/lib/delta-upgrade.test.ts: stable attempt/prefetch request only https://api.github.com/repos/getsentry/cli/releases?per_page=12; nightly attempt/prefetch request only https://ghcr.io/token?scope=repository:getsentry/cli:pull; every case asserts no URL contains getsentry/toolkit.packages/cli/test/lib/delta-upgrade.mocked.test.ts was exactly 500 lines and mocks CLI_VERSION: "0.13.0" so canAttemptDelta() does not short-circuit on test-mode "0.0.0-dev".packages/cli/test/lib/delta-upgrade.mocked.test.ts still contained stale documentation saying isolation occurs under bun test --isolate, despite the repository’s Node.js/Vitest convention.packages/cli/test/lib/delta-upgrade.mocked.test.ts: (1) a synthetic TRDIFF10 patch resolves a 0.13.0 → 0.14.0 chain but produces an empty output and must throw SHA-256 mismatch; (2) HTTP 500 during chain resolution returns null; (3) garbage patch bytes [0, 1, 2, 3] are caught by attemptDeltaUpgrade() and return null; (4) real fixtures small-old.bin, small.trdiff10, and small-new.bin produce SHA-256 54d0dcd74478bc154b5b24393fdc6129518271baa36f446384d60e84021bb724, patchBytes: 89, and chainLength: 1.packages/cli/test/lib/delta-upgrade.mocked.test.ts: a target manifest lacking the ${BINARY_NAME}.gz layer returns null; a target with a 30,000,000-byte gzip layer but no patch tags also returns null; /tags/list is mocked because tag listing runs in parallel with manifest fetching.packages/cli/test/lib/delta-upgrade.test.ts, 8 in packages/cli/test/lib/delta-upgrade.mocked.test.ts, 2 in packages/cli/src/lib/version-check.ts, 1 in packages/cli/src/lib/upgrade.ts, and 7 exported functions in packages/cli/src/lib/delta-upgrade.ts.packages/cli/src/lib/delta-upgrade.ts export locations were resolveStableChain line 279, resolveNightlyChain line 292, resolveStableDelta line 503, resolveNightlyDelta line 522, attemptDeltaUpgrade line 541, prefetchNightlyPatches line 634, and prefetchStablePatches line 642."network", never a false "malformed_chain" poison alert; a genuine poisoned publish requires an HTTP-200 manifest that subsequently fails validation.OciClient.downloadBlob redirected blob requests to always carry a live timeout signal, including when the caller supplies no signal, so a stalled Azure Blob download can never hang the CLI forever.OciClient request, including redirects, to use the injected fetch, never the global fetch.location: https://blob.example.com/obj, capturing the second request’s signal, and requiring it to be a live AbortSignal even when downloadBlob receives signal=undefined.ghcrSource({ registry: "https://ghcr.io", repo: "owner/project", userAgent: "test/1.0.0", binaryName: BINARY, targetTag: (v) => \nightly-${v}`, compareVersions: cmp })andgithubReleaseSource({ releasesUrl: "https://api.github.com/repos/owner/project/releases", binaryName: "lore-linux-x64", userAgent: "test/1.0.0", instrument })`.BINARY = "tool-linux-x64", lower-case sha256: digests in extractSha256, and construct GitHub asset URLs as https://example.test/${tag}/${assetName}.{ failure: "malformed_chain" }; its nightly tag filtering keeps only (currentVersion, targetVersion] and sorts ascending, e.g. patch-1.1.0, patch-1.2.0, patch-1.3.0.packages/cli/src/lib/patch-cache.ts was exactly 43 lines and wraps binpatch’s makeCache(join(getConfigDir(), "patch-cache")).packages/cli/src/lib/patch-cache.ts re-exports ChainMeta, PatchStepMeta, chainFileName, and patchFileName from binpatch; the barrel re-export is intentionally retained with biome-ignore lint/performance/noBarrelFile.savePatchesToCache() delegates to PatchCache.save() with Pick<PatchChain, "patches" | "expectedSha256"> and { fromVersion, toVersion }[]; cleanupPatchCache() and clearPatchCache() directly delegate to the binpatch cache.loadCachedChain(currentVersion, targetVersion) returns null on a cache miss and normalizes every loaded patch’s data to new Uint8Array(patch.data) on a hit.