Dashboard › cli › Distillation
f94f4bc9-2e0f-4a77-a9c2-3af7a2360a81["lore_tm_v1_cRRIF19a0kvO14VH4Kxv_57ZY7_2ORK3O95HP1CDSFA","lore_tm_v1_JMrGQ248UyHopm6NWJW9-meFA1IBNQqO0VgtYvfvxiI"]
packages/cli/src/lib/binary.ts now imports UpgradeTransportError alongside stringifyUnknown and UpgradeError from ./errors.js.UpgradeSource with readonly fields githubRepo: string, ghcrRepo: string, and tagPrefix: string; it represents a repository pair hosting CLI stable GitHub releases and nightly GHCR images.UPGRADE_SOURCES, with fallback occurring only on HTTP 404: 1. { githubRepo: "getsentry/toolkit", ghcrRepo: "getsentry/toolkit", tagPrefix: "cli@" }; 2. { githubRepo: "getsentry/cli", ghcrRepo: "getsentry/cli", tagPrefix: "" }.PRIMARY_UPGRADE_SOURCE = UPGRADE_SOURCES[0] as the default for direct helper calls that do not resolve a source.getBinaryDownloadUrl(version, source = PRIMARY_UPGRADE_SOURCE) now builds the release tag as ${source.tagPrefix}${version} and returns https://github.com/${source.githubRepo}/releases/download/${tag}/${getPlatformBinaryName()}, replacing the hard-coded getsentry/cli release URL.getGitHubReleasesUrl(source = PRIMARY_UPGRADE_SOURCE), returning https://api.github.com/repos/${source.githubRepo}/releases.getGitHubReleaseByTagUrl(version, source = PRIMARY_UPGRADE_SOURCE), which prefixes the version with source.tagPrefix, applies encodeURIComponent(tag), and appends /tags/${encodedTag} to getGitHubReleasesUrl(source).packages/cli/src/lib/binary.ts: callers receive the successful probe response so the operation βnever repeats theβ successful probe request; the source resolver falls back to the legacy source only on HTTP 404.resolveUpgradeSource coverage in packages/cli/test/lib/binary.test.ts, including test "falls back to the legacy source only on HTTP 404"."preserves an arbitrary external abort reason" for resolveUpgradeSource: an AbortController is aborted with object { kind: "cancelled" }, the injected fetch throws that same object, and the returned request must reject with the identical reason rather than wrapping it.fetchManifest(token, tag, signal?, source = PRIMARY_UPGRADE_SOURCE) now requests ${GHCR_REGISTRY}/v2/${source.ghcrRepo}/manifests/${tag} rather than using a fixed GHCR_REPO, while retaining bearer authorization, OCI_MANIFEST_TYPE, getUserAgent(), retry handling, and the supplied abort signal."preserves external cancellation during the GHCR blob request" to ensure externally initiated aborts during blob retrieval retain their original cancellation reason.manifest.config to be absent or to satisfy isOciLayer(manifest.config).a84012184c79c2566c7466aa6beda5f767199218, packages/cli/src/lib/upgrade.ts validates GitHub release pagination: pagination URLs must remain on api.github.com and the selected source, malformed or out-of-source links produce "GitHub returned an invalid release pagination URL", and cycles produce "GitHub returned cyclic release pagination".a84012184c79c2566c7466aa6beda5f767199218, packages/cli/test/lib/upgrade.test.ts contains pagination tests in this order: "follows Toolkit release pagination to find the latest CLI release", "preserves an arbitrary abort reason during pagination", "rejects GitHub release pagination outside the selected source", "classifies malformed GitHub release pagination as a network error", and "rejects cyclic GitHub release pagination".a84012184c79c2566c7466aa6beda5f767199218, packages/cli/test/lib/ghcr.test.ts covers blob responses and redirects: direct status 200; 307 and 302 redirects followed without the authorization header; missing Location on a 307 producing "GHCR blob redirect (307) had no Location header"; unexpected non-200/redirect status; network failure while following a redirect; and preservation of external cancellation during the redirect request.a84012184c79c2566c7466aa6beda5f767199218, GHCR tag pagination tests generate exactly 100 page-1 tags to trigger pagination and 2 page-2 tags, and include "pagination with prefix filter only returns matching tags".a84012184c79c2566c7466aa6beda5f767199218, tests distinguish anonymous GHCR token scopes scope=repository:getsentry/toolkit:pull and scope=repository:getsentry/cli:pull; legacy delta-upgrade tests expected https://ghcr.io/token?scope=repository:getsentry/cli:pull.