Dashboard › cli › Distillation
0e53151c-224f-454e-bf01-2a096cc65ef4["lore_tm_v1_2XbvLcsyAsgMccHrpqqjVzmBxLGAerSDumFfmuWzRkg","lore_tm_v1_LxZKN06MjSrQQipToC9UUe7q9jSOkPs_edRK1BQ-NA8","lore_tm_v1_T97M4Dovb_XHRE5PXQxKPpLKov5WNpVILMfVksonyfM","lore_tm_v1_VoxAjFDMkZT7A0a_2B4DGQl6UMxNzQf1E-zTsl6pJQA","lore_tm_v1_w9AyV35NiB0uMhKqgozoTI-ewUnyqmM91EAzbw3qc84","lore_tm_v1_YLzeLwpO95wfMG8Q432WPxyNHNee3-YIsEp9fUS3yZo"]
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:562-603: resolveUpdatedCliPath() resolves whichSync("sentry", { PATH: pathEnv }) ?? entryPath ?? execPath; resolveUpgradeInstallDir() normally retains currentInstallDir, but relocates legacy ~/.sentry/bin to the XDG directory from determineInstallDir(homedir(), envWithoutPin) only when that distinct XDG directory is already on PATH./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:609-690: executeStandardUpgrade() uses NIGHTLY_TAG only for latest nightly (channel === "nightly" && !versionArg), invokes executeUpgrade(method, target, downloadTag, offline, setMessage), logs delta patchBytes, and runs setup on the downloaded curl binary with install: true, pinned installDir, and lock release in finally; package-manager upgrades instead resolve the post-install PATH entry via resolveUpdatedCliPath() and use install: false./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/commands/cli/upgrade.ts:693-768: migrateToStandaloneForNightly() migrates brew/npm/pnpm/bun/yarn users to a standalone nightly binary by downloading through executeUpgrade("curl", target, downloadTag, undefined, setMessage), installing to determineInstallDir(homedir(), process.env), running setup with method: "curl" and channel: "nightly", then releasing the lock. Uninstall hints are npm uninstall -g sentry, pnpm remove -g sentry, bun remove -g sentry, yarn global remove sentry, and brew uninstall getsentry/tools/sentry.<fromVersion>-<toVersion>.patch, metadata is named chain-<fromVersion>-<toVersion>.json, binary blobs are expected to be 50–80KB, cache lifetime is exactly 7 days via CACHE_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000, and chain walking is capped at MAX_CHAIN_WALK_DEPTH = 10.sanitizeVersion(version), replacing every character outside [^a-zA-Z0-9.-] with _; filenames are produced by patchFileName() and chainFileName().savePatchesToCache() creates the cache directory recursively with mode 0o700, writes all patch files in parallel, and stores ChainMeta containing fromVersion, toVersion, expectedSha256, cachedAt: Date.now(), and ordered patches entries with fromVersion, toVersion, and size.loadAllChainMetas() treats ENOENT as an empty cache and ignores malformed metadata; buildStepMap() maps each fromVersion to { toVersion, size }; walkChainSteps() returns null for missing links, an over-depth chain, or a zero-step chain; loadCachedChain() requires target expectedSha256, loads every patch in parallel, returns null if any patch is missing, and otherwise returns { patches, totalSize, expectedSha256 }.removeExpiredEntries() removes malformed metadata, deletes metadata older than 7 days, and deletes an expired chain’s patch only when no live chain references that filename; cleanupPatchCache() is opportunistic/fire-and-forget; clearPatchCache() removes all files after a successful upgrade; missing cache directories are treated as empty.makeCache(cacheDir) returns a PatchCache exposing save(), load(), cleanup(), and clear(), with the consumer choosing a location such as <configDir>/patch-cache; the directory is created lazily on first write.latestVersion assertion matching the query: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:474 expects infoBefore.latestVersion to be "1.0.0".getUpdateNotification older-version test should “use something clearly older”: /home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:178-184 caches "0.0.0-alpha" against test CLI_VERSION "0.0.0-dev" and expects no notification./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts: suppress upgrade, cli setup, cli fix, --version, -V, and --json; recognize CLI-management commands despite global flags before cli or its subcommand; do not suppress ordinary commands, cli feedback, or argument values named setup/fix; suppress output on non-TTY stderr; emit at most once per process and once per 24 hours across invocations."Update available:"; nightly uses "New nightly available:"; unexpected errors, ApiError 400/500, and generic Error use contextual "Upgrading may resolve this" copy without the standard label; ContextError, ValidationError, and ApiError 404 retain standard update copy./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:452-465 verifies lastChecked begins as null, calls maybeCheckForUpdateInBackground(), waits 100ms, and calls abortPendingVersionCheck()./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/version-check.test.ts:467-485: setVersionCheckInfo("1.0.0") sets a non-null lastChecked; maybeCheckForUpdateInBackground() is called exactly 5 times while probability is near 0, followed by a 50ms wait and abort.SENTRY_CLI_NO_UPDATE_CHECK=1 is tested in a subprocess because it is read at module-load time; the test tries Bun first and falls back to node --input-type=module, expects stdout "PASS", and skips when the subprocess exits nonzero with empty stdout due to module-loading limitations such as missing node:sqlite./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/test/lib/binary.test.ts:67-81: UPGRADE_SOURCES is ordered with getsentry/toolkit first (githubRepo and ghcrRepo "getsentry/toolkit", tagPrefix: "cli@") and legacy getsentry/cli second (githubRepo and ghcrRepo "getsentry/cli", tagPrefix: "").resolveUpgradeSource() test policy: select the first source on success; fall back from Toolkit to legacy CLI only on HTTP 404; do not fall back on HTTP 401, 403, 429, or 500; do not fall back on network failure; and throw "No CLI upgrade source was found" after both sources return 404. For version 0.45.0, probes are ordered https://api.github.com/repos/getsentry/toolkit/releases/tags/cli%400.45.0, then https://api.github.com/repos/getsentry/cli/releases/tags/0.45.0./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:295-340 returns the successful probe Response with its selected UpgradeSource, so the caller “never repeats the request.” Only HTTP 404 advances to the next source; all other HTTP or network failures abort immediately.resolveUpgradeSource() error mapping: AbortError is rethrown unchanged; TLS certificate failures become UpgradeError("network_error", buildTlsErrorDetail(error)); other fetch failures become UpgradeError("network_error", \Failed to connect to GitHub: ${stringifyUnknown(error)}`); non-404 HTTP failures become UpgradeError("network_error", `Failed to fetch from GitHub: HTTP ${response.status}`); exhaustion becomes UpgradeError("network_error", "No CLI upgrade source was found: every source returned HTTP 404")`./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/toolkit-bridge-upgrade/packages/cli/src/lib/binary.ts:220-275: platform artifacts are sentry-${os}-${arch}${libcSuffix}${suffix}, where architecture is arm64 or x64, musl adds -musl, and Windows adds .exe; release tags prepend source.tagPrefix; tagged release API URLs encode the tag; prefixed sources discover latest releases with ?per_page=100, while unprefixed sources use /latest.