Dashboard › cli › Distillation
10f4bb71-acc0-4064-a74c-da12bb0916b3["lore_tm_v1_r1LpV-R950ksGy2rKQAA1capy5gzB3mXJ5WDxzfq8IA","lore_tm_v1_RdwrJwNhIT21SPs24yDdSVeBo2xE5zzGOmQ59Y233Vw","lore_tm_v1_QrBwVNKnMpOdtUj4iHr5uNdKD2oAxX2BA51b0o2uo5Q","lore_tm_v1_b1-7dZBxNss5OM7I0TVsarvPSS165RdqeSB6sK6QqpQ"]
feat/toolkit-bridge-upgrade, tracking origin/main, with 4 modified files: packages/cli/src/lib/binary.ts, packages/cli/test/lib/binary.test.ts, packages/cli/test/lib/ghcr.test.ts, and packages/cli/test/lib/install-script.test.ts; diff totals 232 insertions and 5 deletions.packages/cli/src/lib/binary.ts added exported UpgradeSource with readonly githubRepo, ghcrRepo, and tagPrefix fields.packages/cli/src/lib/binary.ts added ordered UPGRADE_SOURCES: 1. { githubRepo: "getsentry/toolkit", ghcrRepo: "getsentry/toolkit", tagPrefix: "cli@" }; 2. { githubRepo: "getsentry/cli", ghcrRepo: "getsentry/cli", tagPrefix: "" }. Toolkit is the primary source and the legacy CLI repository is the fallback.PRIMARY_UPGRADE_SOURCE is UPGRADE_SOURCES[0] and is the default for direct helper calls that have not resolved a source.getBinaryDownloadUrl(version, source = PRIMARY_UPGRADE_SOURCE) now creates tag ${source.tagPrefix}${version} and URL https://github.com/${source.githubRepo}/releases/download/${tag}/${getPlatformBinaryName()} instead of hard-coding getsentry/cli.getGitHubReleasesUrl(source = PRIMARY_UPGRADE_SOURCE) now builds https://api.github.com/repos/${source.githubRepo}/releases; exported GITHUB_RELEASES_URL is the primary source URL returned by this helper.packages/cli/src/lib/binary.ts added ResolvedUpgradeSource, containing the selected UpgradeSource and its successful Response.resolveUpgradeSource(fetchFn = customFetch, signal?) probes each UPGRADE_SOURCES entry at ${getGitHubReleasesUrl(source)}/latest with getGitHubHeaders() and the optional AbortSignal.UpgradeError("network_error", "Failed to fetch from GitHub: HTTP <status>"), and network exceptions propagate immediately.resolveUpgradeSource() throws UpgradeError("network_error", "No CLI upgrade source was found: every source returned HTTP 404").Response is returned to the caller so the caller never repeats the request.packages/cli/test/lib/binary.test.ts added tests that verify: 1. exact Toolkit-before-legacy ordering in UPGRADE_SOURCES; 2. first-source success makes only https://api.github.com/repos/getsentry/toolkit/releases/latest; 3. a Toolkit HTTP 404 falls back to https://api.github.com/repos/getsentry/cli/releases/latest; 4. HTTP 401, 403, 429, and 500 do not fall back; 5. TypeError("fetch failed") does not fall back; 6. two HTTP 404 responses produce "No CLI upgrade source was found".packages/cli/test/lib/ghcr.test.ts added source-selection coverage: getAnonymousToken(UPGRADE_SOURCES[0]) must request a token scope containing scope=repository:getsentry/toolkit:pull and resolve "toolkit-token"; fetchNightlyManifest("token", undefined, UPGRADE_SOURCES[0]) must request a URL containing /v2/getsentry/toolkit/manifests/nightly.packages/cli/test/lib/install-script.test.ts added a test requiring packages/cli/install to define UPGRADE_SOURCES=(...) whose whitespace-separated repositories exactly equal UPGRADE_SOURCES.map((source) => source.githubRepo), sharing the same ordered source list between TypeScript and the shell installer.packages/cli/src/lib/ghcr.ts, fetchTagPage(token, lastTag?, signal?) and listTags(token, prefix?, signal?) still build tag-list URLs from the module-level GHCR_REPO; downloadLayerBlob(token, digest, signal?) delegates to downloadNightlyBlob(token, digest, signal) and returns response.arrayBuffer().packages/cli/src/lib/delta-upgrade.ts, stableSource() still configures githubReleaseSource() with module-level GITHUB_RELEASES_URL, while nightlySource() still configures ghcrSource() with module-level GHCR_REPO; fetchRecentReleases() similarly requests ${GITHUB_RELEASES_URL}?per_page=12.packages/cli/src/lib/delta-upgrade.ts configures nightly delta lookup with registry https://ghcr.io, targetTag: (version) => \nightly-${version}`, compareVersions, customFetch, and user agent sentry-cli/${CLI_VERSION}`.