Dashboard › cli › Distillation
115e990c-0855-44eb-b275-24e2b61768c6["lore_tm_v1_-VE1Lv-A0sHUuM6Bl0gIUwRj-G-YPTAmv0V-5oklU20","lore_tm_v1_w0SmFtM9NVU-SxYaIwjNeqZMeSe1nVA1kTSmChqoXgA","lore_tm_v1_gz0MKGvjekxbf4VV3qjNBDQsssJGTHeh7WUE5o-GRQ0","lore_tm_v1_S9BzDrbyz5BLU4dIkcsmWaHGHuAIB69ysDhCqBnCXK0","lore_tm_v1_o92myg_2HLLLEEWF5UNBNb_Nf4ruAFd87XJrXr46PkE","lore_tm_v1_zytZjxX9rHOINuQzslegPLGa95OEfIuIAwWe7uFSCZc","lore_tm_v1_ccaXM4h1B4k63MmQtgU8BWi_rrDQ07FG_BqI35CdgrQ","lore_tm_v1_U-SxTevVR0THO_CVjcAwO2DC0AI3THR2NnY9NppZspk","lore_tm_v1_B6RtRnqG55mvlYKvO0t0KFExmdYv5x2dswVXTGRsRTM","lore_tm_v1_EOJfVBA0t_qJncQR8wCGqhbYPU2pZnxVqm-wvMeCZbI"]
getGitHubHeaders() in packages/cli/src/lib/binary.ts returns Accept: "application/vnd.github.v3+json" and "User-Agent": getUserAgent().fetchWithUpgradeError(url, init, serviceName) in packages/cli/src/lib/binary.ts calls customFetch(url, init); it rethrows AbortError unchanged, maps TLS certificate failures to UpgradeError("network_error", buildTlsErrorDetail(error)), and maps other connection failures to UpgradeError("network_error", \Failed to connect to ${serviceName}: ${msg}`)`.replaceBinarySync(tempPath, installPath) is intentionally synchronous so its multi-step rename sequence cannot be interrupted. Unix atomically renames over the target; Windows renames the running executable to ${installPath}.old, moves the temporary binary into place, and relies on cleanupOldBinary() to remove .old on the next CLI startup.packages/cli/test/lib/upgrade.test.ts verifies parseInstallationMethod() accepts brew, npm, pnpm, bun, and yarn, parses NPM, Curl, and YARN case-insensitively, and rejects pip, apt, and the empty string with Invalid method: ....fetchLatestFromGitHub() tests verify tag_name: "v1.2.3" becomes 1.2.3, the v prefix is stripped from v0.5.0, tag_name: "1.0.0" remains unchanged, HTTP 404 throws UpgradeError with Failed to fetch from GitHub: 404, a TypeError("fetch failed") becomes Failed to connect to GitHub: fetch failed, and a response without tag_name throws No version found in GitHub release.versionExists() tests verify stable curl and brew versions are checked through GitHub, while npm, pnpm, bun, and yarn versions are checked through npm; status 200 means true and 404 means false. GitHub network failure reports Failed to connect to GitHub, and npm network failure reports Failed to connect to npm registry.versionExists() tests verify GHCR token exchange plus /manifests/nightly-... lookup, with 0.14.0-dev.1772661724 returning true and 0.14.0-dev.9999999999 returning false; the GHCR path is used even when the passed installation method is npm, and network failures or a manifest HTTP 500 throw UpgradeError.packages/cli/test/lib/upgrade.test.ts use ELF magic bytes [0x7f, 0x45, 0x4c, 0x46] and verify: 1. a successful .gz response is decompressed into tempBinaryPath; 2. .gz HTTP 404 falls back to the raw binary in exactly 2 fetches; 3. a .gz network exception also falls back to raw in exactly 2 fetches; 4. failure of both URLs with HTTP 404 throws Failed to download binary: HTTP 404; 5. network failure of both URLs throws Failed to connect to GitHub; 6. the upgrade lock is released after failure.fetchLatestNightlyVersion() tests verify exactly 2 requests—GHCR token plus manifest—and extract annotation version 0.0.0-dev.1740000000; token HTTP 401 throws GHCR token exchange failed: HTTP 401, a missing manifest version throws Nightly manifest has no version annotation, and an already-aborted signal yields an error with name: "AbortError".sentry-${os}-${arch}${suffix}.gz, where OS is linux, darwin, or windows, architecture is arm64 or x64, and Windows uses suffix .exe; the manifest layer uses digest sha256:blobdigest, and executeUpgrade("curl", "0.0.0-dev.1740000000") downloads and decompresses the matching blob.maybeCheckForUpdateInBackground() tests in packages/cli/test/lib/version-check.test.ts save and temporarily delete SENTRY_CLI_NO_UPDATE_CHECK, mock GitHub with { tag_name: "v0.0.0-dev" }, call abortPendingVersionCheck() during cleanup, restore the original fetch and environment variable, and verify the background-check entry point does not throw.getVersionCheckInfo().lastChecked is null, so shouldCheckForUpdate is true and maybeCheckForUpdateInBackground() initiates a background check; the test waits 100 ms and then aborts it.setVersionCheckInfo("1.0.0"), verifies non-null lastChecked and latestVersion === "1.0.0", invokes maybeCheckForUpdateInBackground() 5 times while probability is near 0, waits 50 ms, and aborts the pending check.