Dashboard › cli › Distillation
e6c64bf2-152e-4662-afa6-336342e058ba["lore_tm_v1_EDZyZcRfq5N4cnWXWMH0UiOT-biX8sfyNIxHhPUur6M","lore_tm_v1_2Vfh9g7ZNPUJmWus-RVkDNtFUoFFk_QfckKrpeTeAc4","lore_tm_v1_2B7kJmN07lIxYc7876N4BSwJ0PBh56VwvNG7RSRDPFg","lore_tm_v1_gXjODcA8wbZ_tlc7Kiv1aWD7uYbsUfK3HvzcQ0dnPBM","lore_tm_v1_wOVUieNs2XnIDYDMsGbt-jlXHgj9Clmxy6217t1MJL4","lore_tm_v1_0AM-MayG0RHEFCjrFezRNb44v0mynixyi7ulP7xou34","lore_tm_v1_KFGrVT2vHJVnCCSy8UKa4HTfcroFfC-Zg9_msk04J20"]
packages/cli/src/lib/errors.ts defines UpgradeErrorReason as exactly "unknown_method" | "unsupported_operation" | "network_error" | "execution_failed" | "version_not_found" | "offline_cache_miss"; UpgradeError uses EXIT.UPGRADE, sets this.name = "UpgradeError", and stores the typed reason.UpgradeError default messages are: unknown_method β "Could not detect installation method. Use --method to specify."; unsupported_operation β "This operation is not supported for this installation method."; network_error β "Failed to fetch version information."; execution_failed β "Upgrade command failed."; version_not_found β "The specified version was not found."; offline_cache_miss β "Cannot upgrade offline β no pre-downloaded update is available.".packages/cli/node_modules/binpatch/dist/index.js, githubReleaseSource(config) uses config.fetch ?? fetch, requests ${releasesUrl}?per_page=${MAX_STABLE_CHAIN_DEPTH + 2} with GitHub v3 Accept and configured User-Agent, and instruments operations as "fetch-releases" and "download-patch" when config.instrument is present.githubReleaseSource(config).resolveChain() reports "network" when release or patch fetching fails, "no_patches" when the target release is absent, "malformed_chain" when the target lacks ${binaryName}.gz, or the specific extractStableChain() failure; successful patch downloads run concurrently via Promise.all() and return { patches, totalSize, expectedSha256, steps }.packages/cli/src/commands/cli/upgrade.ts found exactly 14 matches involving fetchChangelog, executeUpgrade, fetchLatestVersion, versionExists, resolveChannelAndVersion, downloadTag, and related calls/comments at lines 45, 50, 51, 58, 113, 136, 289, 325, 637, 642, 723, 727, 794, and 834.resolveChannelAndVersion(positional) in packages/cli/src/commands/cli/upgrade.ts treats case-insensitive "nightly" and "stable" positional arguments as channel selectors with versionArg: undefined; otherwise it uses getReleaseChannel() and preserves the positional argument as versionArg.resolveOfflineTarget(versionArg) strips VERSION_PREFIX_REGEX from an explicit version; otherwise it reads latestVersion from getVersionCheckInfo() and throws UpgradeError("network_error", "No cached version available. Run any command to trigger a background version check, then retry.") when absent.resolveTargetWithFallback() rejects channel switching under explicit --offline when no version is pinned because the cached version belongs to the old channel; it instructs the user to run 'sentry cli upgrade' with network access.persistChannelFn() because setReleaseChannel() clears the version cache on channel changes; it returns offline: "explicit".UpgradeError with reason === "network_error"; it returns offline: "network-fallback" when a cached target exists and otherwise rethrows the original network error.validateMethod() permits offline upgrades only for method === "curl" and throws "Offline upgrade is only supported for curl-installed binaries." for other methods.validateMethod() throws "unknown_method" for method === "unknown" and rejects a pinned stable Homebrew version with "Homebrew does not support installing a specific version. Run 'brew upgrade getsentry/tools/sentry' to upgrade to the latest formula version.".resolveTargetVersion() calls fetchLatestVersion(method, channel), strips VERSION_PREFIX_REGEX from an explicit version, supports check-only output via buildCheckResult(), and skips an already-current target unless flags.force or channelChanged is true.lookupMethod = channel === "nightly" ? "curl" : method, followed by versionExists(lookupMethod, target); a miss throws UpgradeError("version_not_found", \Version ${target} not found`)`.executeStandardUpgrade() uses the rolling NIGHTLY_TAG only for latest-nightly upgrades where channel === "nightly" && !versionArg; a pinned version uses its own release tag. It calls executeUpgrade(method, target, downloadTag, offline, setMessage) under withProgress().executeStandardUpgrade() runs runSetupOnNewBinary() with install: true, pins installDir via the upgrade-install-directory logic, sets ensureAuthScopes: !json, forwards noAgentSkills, and releases downloadResult.lockPath in finally; package-manager upgrades resolve the updated CLI path after installation and run setup with install: false.migrateToStandaloneForNightly() handles switching from brew/npm/pnpm/bun/yarn to nightly because nightly builds are standalone GitHub release assets only: it downloads through executeUpgrade("curl", target, downloadTag, undefined, setMessage), installs using determineInstallDir(homedir(), process.env), runs setup as method: "curl" and channel: "nightly", and releases the lock in finally.NIGHTLY_TAG for latest nightly and the pinned versionβs own tag when versionArg is present; no download result throws UpgradeError("execution_failed", "Failed to download nightly binary").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. It warns that the old ${method}-installed sentry may appear earlier in PATH.persistChannel() calls setReleaseChannel(channel) when the channel changed or the supplied version is one of CHANNEL_VERSIONS; it must run after offline target resolution because channel changes clear cached version-check data.startChangelogFetch() skips fetching when offline or when current and target versions match; otherwise it calls fetchChangelog({ channel, fromVersion, toVersion }) and swallows errors so changelog retrieval never blocks an upgrade.sentry cli upgrade nightly # Switch to nightly channel and update.upgradeCommand documentation lists two persisted release channels: stable as the default/latest stable release and nightly as built from main and updated on every commit; subsequent bare sentry cli upgrade calls use the persisted channel.sentry cli upgrade (latest on persisted channel), sentry cli upgrade nightly (switch to nightly and update), sentry cli upgrade stable (switch back to stable and update), sentry cli upgrade 0.5.0 (specific stable version), --check, --force, --method npm, --offline, and --no-agent-skills.upgradeCommand flags are: check boolean default false; force boolean default false; offline boolean default false; "no-agent-skills" boolean default false; and optional parsed method accepting curl, brew, npm, pnpm, bun, or yarn.upgradeCommand.func(), target resolution runs under progress text "Checking for updates..."; online check-only and already-up-to-date results exit early, while check-only after offline fallback is guarded from performing an actual upgrade and is built through buildCheckResultWithChangelog().startChangelogFetch(channel, CLI_VERSION, target, offline); offline runs omit changelog fetching.channel === "nightly" && method !== "curl"; otherwise it uses executeStandardUpgrade(). Final UpgradeResult records action ("downgraded" or "upgraded"), currentVersion, targetVersion, channel, original detected/selected method, forced, optional offline, optional migration warnings, and optional changelog.