Dashboard › cli › Distillation
6f44fe63-f936-4c8c-9efe-a0b2b52fc4bb["lore_tm_v1_RiCHSOAu5gkNgJSaTC_cOTQ7RJbdnSLy4ljBjyRZKu0","lore_tm_v1_1-BJioiRL5d6K7C5edkYdd5qeaXFiqVcM2FhmvjlqZw"]
.github/workflows/ci.yml, packages/cli/install, packages/cli/package.json, packages/cli/src/commands/cli/upgrade.ts, packages/cli/src/lib/binary.ts, packages/cli/src/lib/delta-upgrade.ts, packages/cli/src/lib/ghcr.ts, packages/cli/src/lib/release-notes.ts, packages/cli/src/lib/upgrade.ts, packages/cli/src/lib/version-check.ts, packages/cli/test/commands/cli/upgrade.test.ts, packages/cli/test/lib/binary.test.ts, packages/cli/test/lib/delta-upgrade.test.ts, packages/cli/test/lib/ghcr.test.ts, packages/cli/test/lib/install-script.test.ts, packages/cli/test/lib/release-notes.test.ts, packages/cli/test/lib/upgrade.test.ts, and packages/cli/test/lib/version-check.test.ts.packages/cli/src/commands/cli/upgrade.ts extended ResolveResult and resolveTargetWithFallback() results with optional source?: UpgradeSource, preserving the source selected during online target resolution.packages/cli/src/commands/cli/upgrade.ts added resolvePinnedVersion(lookupMethod, target): non-curl methods use versionExists() and return no source; curl uses resolveExistingUpgradeVersion(target), returns the selected UpgradeSource, and throws UpgradeError("version_not_found", \Version ${target} not found`)` when unresolved.resolveTargetVersion() now treats channel === "nightly", method === "curl", and method === "brew" as standalone resolution paths, using resolveLatestUpgradeVersion(channel) to obtain both version and source; other methods retain fetchLatestVersion(method, channel).resolveTargetVersion() uses lookupMethod = channel === "nightly" ? "curl" : method, retains the source from resolvePinnedVersion(), and returns it with either the "target" result or online "done" check result.executeStandardUpgrade(), migrateToStandaloneForNightly(), executeUpgrade(), downloadBinaryToTemp(), delta/full-download helpers, and startChangelogFetch() so discovery, changelog retrieval, delta lookup, and final download stay on the same UpgradeSource.startChangelogFetch() in packages/cli/src/commands/cli/upgrade.ts changed from positional arguments to an options object containing channel, currentVersion, targetVersion, offline, and optional source; it passes source to release-note retrieval and still resolves undefined without throwing when offline, unchanged, or on fetch failure.packages/cli/src/lib/delta-upgrade.ts replaced hard-coded GITHUB_RELEASES_URL and GHCR_REPO use with source-aware getGitHubReleasesUrl(source) and source.ghcrRepo. getPrimaryUpgradeSource() throws "No primary upgrade source is configured" if PRIMARY_UPGRADE_SOURCE is absent.UpgradeSource, defaulting through getPrimaryUpgradeSource(): fetchRecentReleases(signal?, source?), resolveStableChain(currentVersion, targetVersion, signal?, source?), resolveNightlyChain({ ..., source? }), resolveStableDelta(..., source?), resolveNightlyDelta(..., source?), attemptDeltaUpgrade(..., source?), prefetchNightlyPatches(targetVersion, signal?, source?), and prefetchStablePatches(targetVersion, signal?, source?).packages/cli/src/lib/upgrade.ts added ResolvedUpgradeVersion with exact fields readonly version: string and readonly source: UpgradeSource, establishing that a standalone version resolution selects the source for every later lookup and download in that operation.fetchLatestFromGitHubWithSource(signal?, sources = UPGRADE_SOURCES), resolveUpgradeSource(), and extractReleaseVersions(). Array responses exclude draft/prerelease releases, require each tag to begin with source.tagPrefix, strip that prefix, and then strip VERSION_PREFIX_REGEX; a missing usable version throws UpgradeError("network_error", "No version found in GitHub release").fetchLatestFromGitHub(signal?, source?) remains a compatibility API returning only the version string, but constrains discovery to [source] when supplied and otherwise searches ordered UPGRADE_SOURCES.fetchLatestNightlyVersionWithSource(signal?, sources = UPGRADE_SOURCES) and resolveNightlyManifest(tag, signal, sources). For each source it probes getGitHubRepositoryUrl(source), obtains a source-specific anonymous GHCR token, and fetches the source-specific manifest; only source-not-found and tag HTTP 404 conditions advance to the next source, while other errors are rethrown.resolveNightlyManifest() throws UpgradeError("network_error", "No CLI upgrade source was found: every source returned HTTP 404"); isUpgradeSourceNotFound() recognizes this exact aggregate failure.resolveLatestUpgradeVersion(channel, signal?) selects fetchLatestNightlyVersionWithSource() for "nightly" and fetchLatestFromGitHubWithSource() otherwise.resolveExistingUpgradeVersion(version) validates pinned standalone versions across ordered UPGRADE_SOURCES: nightly versions probe nightly-${version} manifests, stable versions probe getGitHubReleaseByTagUrl(version, source), all-source HTTP 404 returns null, and non-not-found failures propagate.versionExists(method, version, source?) now routes all nightly versions plus curl and brew versions through standaloneVersionExists(). With a selected source, nightly checks use that source’s GHCR and stable checks use its GitHub tag URL; without one, ordered-source resolution is used. A nightly HTTP 404 means absent, while HTTP 403 is no longer treated as absence.packages/cli/src/lib/upgrade.ts now default to PRIMARY_UPGRADE_SOURCE: downloadNightlyToPath(), downloadStableToPath(), downloadBinaryToTemp(), tryDeltaUpgrade(), downloadFullBinary(), and executeUpgrade(). Nightly token, manifest, and blob requests use the selected source; stable download URLs use getBinaryDownloadUrl(version, source).packages/cli/src/lib/version-check.ts changed background update discovery to fetchLatestFromGitHubWithSource() or fetchLatestNightlyVersionWithSource(), then passes the exact selected UpgradeSource into maybePrefetchPatches() and onward to prefetchStablePatches() or prefetchNightlyPatches().packages/cli/test/lib/delta-upgrade.test.ts defines LEGACY_UPGRADE_SOURCE = UPGRADE_SOURCES[1] and throws "Legacy upgrade source is not configured" when absent.https://api.github.com/repos/getsentry/cli/releases?per_page=12 for fetchRecentReleases(), resolveStableChain(), attemptDeltaUpgrade(), and prefetchStablePatches(), with no getsentry/toolkit request.https://ghcr.io/v2/getsentry/cli/tags/list?n=100 for resolveNightlyChain(), and https://ghcr.io/token?scope=repository:getsentry/cli:pull for attemptDeltaUpgrade() and prefetchNightlyPatches(), with no getsentry/toolkit request.packages/cli/src/lib/delta-upgrade.ts with mocked CLI_VERSION values via vi.resetModules() and vi.doMock("../../src/lib/constants.js", ...); stable scenarios use 0.13.0 → 0.14.0, nightly scenarios use 0.14.0-dev.100 → 0.14.0-dev.101, and restoreDeltaUpgradeModule() un-mocks constants and resets modules after each test.packages/cli/test/lib/version-check.test.ts added a stable Toolkit test where discovery requests only https://api.github.com/repos/getsentry/toolkit/releases?per_page=100, parses cli@99.0.0, and calls prefetchStablePatches("99.0.0", expect.any(AbortSignal), UPGRADE_SOURCES[0]).https://api.github.com/repos/getsentry/cli/releases/latest with v99.0.0, and patch prefetch receives UPGRADE_SOURCES[1].https://api.github.com/repos/getsentry/toolkit, https://ghcr.io/token?scope=repository:getsentry/toolkit:pull, and https://ghcr.io/v2/getsentry/toolkit/manifests/nightly; manifest annotation version: "99.0.0-dev.200" is passed with UPGRADE_SOURCES[0] to prefetchNightlyPatches().packages/cli/test/lib/delta-upgrade.test.ts, lines 808–824 define mockFetch() by replacing globalThis.fetch, save the original fetch in beforeEach(), and restore it in afterEach().fetchRecentReleases tests at lines 828–877 verify the default Toolkit releases URL, a 2-release response headed by 0.14.0, exact legacy URL selection, and empty arrays for HTTP 500 or a TypeError("fetch failed").downloadStablePatch tests at lines 881–912 verify a successful Uint8Array([1, 2, 3, 4, 5]) download from https://example.com/patch.bin, plus null on HTTP 404 and network failure.0.13.0 → 0.14.0 patch chain, a two-hop ordered chain 0.13.0 → 0.14.0 → 0.15.0 with parallel downloads, null when the target is absent, releases API failure, patch download failure, or chain depth exceeds MAX_STABLE_CHAIN_DEPTH.MAX_STABLE_CHAIN_DEPTH of 10; resolving 0.1.0 → 0.15.0 is expected to return null.