Dashboard › cli › Distillation
0b97fa3d-16e8-4a00-83a3-b4fdeaaa8e51["lore_tm_v1_ufcWWuDPU6WFpWcKe6On2XMBiW5_vEZ1vsEOQOpUKYM","lore_tm_v1_RziyNf12wpmX6pNk_3X3W-s5rbEvzmZKYbWYm15DIbE","lore_tm_v1_EgEHBRjWc3U1A11mpkXhjqFnOPfBxFTp9XjbbClqlhY","lore_tm_v1_S2qXMjPhpgDVr3KoKR5mGfDs-Q0mtRebb6J3GR3X2iU","lore_tm_v1_tkjJ2lLzZ25PwgdwfVa9Qvawnv5VoznL8FPs2uVaq_Q"]
validateMethod() in packages/cli/src/commands/cli/upgrade.ts permits offline mode only for method === "curl" and otherwise throws UpgradeError("unsupported_operation", "Offline upgrade is only supported for curl-installed binaries.").fetchLatestFromGitHubWithSource() in packages/cli/src/lib/upgrade.ts: it calls resolveUpgradeSource(), collects versions across paginated GitHub releases, sorts with compareVersions(b, a), and returns the highest version with its source. It tracks pages in visitedPages, throws UpgradeError("network_error", "GitHub returned cyclic release pagination") for cycles, "No version found in GitHub release" when no version exists, and Failed to fetch from GitHub: HTTP ${response.status} for a non-OK subsequent page.validateMethod() rules in packages/cli/src/commands/cli/upgrade.ts: method === "unknown" throws UpgradeError("unknown_method"); a pinned stable version with Homebrew throws UpgradeError("unsupported_operation", "Homebrew does not support installing a specific version. Run 'brew upgrade getsentry/tools/sentry' to upgrade to the latest formula version.").packages/cli/src/commands/cli/upgrade.ts: pinnedTarget strips VERSION_PREFIX_REGEX when versionArg is not in CHANNEL_VERSIONS; nightly pinned lookups use "curl" through resolvePinnedVersion(), while other channels use the detected installation method. Curl resolves through resolveExistingUpgradeVersion(target) and retains its source; package managers use versionExists(lookupMethod, target). Missing versions throw UpgradeError("version_not_found", \Version ${target} not found`)`.resolveTargetVersion(): standalone resolution applies when channel === "nightly", method === "curl", or method === "brew"; the precedence is pinnedTarget, then latestResolution?.version, then fetchLatestVersion(method, channel), with source inherited from latestResolution?.source.packages/cli/src/commands/cli/upgrade.ts: latest nightly uses NIGHTLY_TAG, while a specifically requested nightly version uses its own release tag. executeUpgrade(method, target, downloadTag, offline, setMessage, source) runs under withProgress(), and successful delta downloads log Applied delta patch (${formatBytes(downloadResult.patchBytes)} downloaded).resolveUpgradeInstallDir(dirname(getCurlInstallPaths().installPath), pathEnv) pins the install directory; runSetupOnNewBinary() receives the temporary binary, install: true, ensureAuthScopes: !json, and noAgentSkills; releaseLock(downloadResult.lockPath) runs in finally. Package-manager upgrades instead call resolveUpdatedCliPath(execPath, entryPath, pathEnv) after replacement and invoke setup with install: false.migrateToStandaloneForNightly() downloads with executeUpgrade("curl", target, downloadTag, undefined, setMessage, source), installs to determineInstallDir(homedir(), process.env), runs setup as method: "curl" and channel: "nightly", and warns that the former package-manager installation may still shadow the standalone binary in PATH.e565b1afb39a341605adc883de8812851de7d581: packages/cli/src/commands/cli/upgrade.ts:692 calls executeUpgrade(method, target, downloadTag, offline, setMessage, source); line 778 calls executeUpgrade("curl", target, downloadTag, undefined, setMessage, source); packages/cli/src/lib/ghcr.ts:148 defines export const GHCR_REPO = PRIMARY_UPGRADE_SOURCE.ghcrRepo;.c3d7791d84ebb5ad57a949129d66f9147973d239432b7695c3f1d034a1956351 -, 110d6530e57ca4fbfb2a3f98e52013d2668b5b5e, and d6c50e6e63351dd7e552c193199788fb455a5d47.setReleaseChannel references at commit e565b1afb39a341605adc883de8812851de7d581: imported in packages/cli/src/commands/cli/setup.ts:39 and called at line 513; imported in packages/cli/src/commands/cli/upgrade.ts:36, discussed at lines 199 and 856, and called at line 866; defined in packages/cli/src/lib/db/release-channel.ts:45. The upgrade code reads the cached version before persisting the channel because setReleaseChannel() clears the version-check cache.downloadResult throws UpgradeError("execution_failed", "Failed to download nightly binary"); setup uses install: true, method: "curl", channel: "nightly", ensureAuthScopes: !json, and always releases downloadResult.lockPath in finally.npm → npm uninstall -g sentry; pnpm → pnpm remove -g sentry; bun → bun remove -g sentry; yarn → yarn global remove sentry; brew → brew uninstall getsentry/tools/sentry. Warnings first say Your ${method}-installed sentry may still appear earlier in PATH., then, when a hint exists, Consider removing it: ${hint}.packages/cli/src/commands/cli/upgrade.ts: optional positional version accepts a specific version such as 0.5.0, "nightly", or "stable"; --check checks without installing; --force upgrades even when current; --offline uses only cached version info and patches with no network; --no-agent-skills skips agent-skill installation; --method is parsed by parseInstallationMethod and accepts curl, brew, npm, pnpm, bun, or yarn. Boolean defaults shown are false.resolveContext(version, flags) determines channel, versionArg, channelChanged, and method; target resolution runs under withProgress({ message: "Checking for updates...", json: flags.json }) via resolveTargetWithFallback(). Online check-only results with a version difference fetch a changelog using startChangelogFetch() with offline: false and resolved.source; regular upgrade flow starts changelog fetching early in parallel with the download.