Dashboard › cli › Distillation
dd652ff4-1f57-4a79-b430-be33233dbb55["lore_tm_v1_4MWnAzYkSD70sw6yLkkt2KZNbjUXT7L92XVkiUOaDO0","lore_tm_v1_Rki30DmmRwqR2br5p8PntcMVXNPpcjbxLc3Ygns4x1E","lore_tm_v1_-Rba8LHWgVcZYGAYeBF5DfMK_R68g7vNAcXPesGxjLE","lore_tm_v1_8YJHoFk8qslIrh1HXdZzfeBqhjaEHPyEt3qi9k0yFpw","lore_tm_v1_Agisn9hvDDDNTLNSNfSKx9qDrhsBsOrGdywm_5BYUfs","lore_tm_v1_Nj3OqeBfwU8m2o8WUympVQTTcHBr-mEL0gC2zcJ5WHo","lore_tm_v1_xl9rOii_UQ4zaSoQe9zo9ZUMDCMsG0qCywwRNCNl2IQ","lore_tm_v1_EPYZvSlV7zmG5SjCj9ZEP7QwjzbcInbKjhZEqeNJKTU","lore_tm_v1_bbxV5bsH_L_GNsYyCdc55wDnSTh78y8U6Zu3K7exnwg"]
packages/cli/test/lib/upgrade.test.ts now imports UPGRADE_SOURCES from ../../src/lib/binary.js and dynamically imports resolveExistingUpgradeVersion from ../../src/lib/upgrade.js.packages/cli/test/lib/upgrade.test.ts now model Toolkit release discovery as an array of releases with cli@-prefixed tags, including cli@v0.5.0, cli@v2.0.0, and cli@v3.0.0; unrelated product tags such as mcp@9.0.0 are present in coverage and must not be treated as CLI releases.fetchLatestFromGitHub() missing-tag test in packages/cli/test/lib/upgrade.test.ts now uses an empty release array [] rather than an object without tag_name.packages/cli/test/lib/upgrade.test.ts adds stable-version fallback coverage where an HTTP 404 from Toolkit permits fallback to an unprefixed legacy tag.packages/cli/test/lib/upgrade.test.ts now probes https://api.github.com/repos/getsentry/toolkit and receives HTTP 200 before obtaining the GHCR token and checking /manifests/nightly-....packages/cli/test/lib/upgrade.test.ts adds nightly source-selection coverage for Toolkit and legacy GHCR paths, including /v2/getsentry/toolkit/manifests/nightly and /v2/getsentry/cli/manifests/nightly.packages/cli/test/lib/upgrade.test.ts adds a test named "does not fall back when nightly transport error text says HTTP 404"; fallback decisions must be based on the typed transport failure rather than merely matching "HTTP 404" in error text.packages/cli/test/lib/upgrade.test.ts: executeUpgrade("unknown", "1.0.0") throws UpgradeError with Could not detect installation method.packages/cli/src/lib/custom-ca.ts defines getCustomCaCerts(): string | undefined, which calls resolve() and returns resolved?.tls.ca; it supplies raw PEM suitable for Node’s https.RequestOptions.ca and Sentry SDK NodeTransportOptions.caCerts.packages/cli/src/lib/custom-ca.ts defines customFetch(input, init?) as a drop-in fetch() replacement for non-authenticated requests: without custom TLS options it calls fetch(input, init), while with custom TLS options it calls fetch(input, { ...init, ...tlsOpts }).fetchWithTimeout() in sentry-client.ts, which applies TLS options alongside the SaaS warning.packages/cli/src/lib/custom-ca.ts::__resetForTests() resets resolved to undefined, resolvedSource to "none", resolvedLabel to "", and hasResolved and warnedSaas to false.packages/cli/src/lib/db/version-check.ts stores update-check state under metadata keys version_check.last_checked, version_check.latest_version, and version_check.last_notified.VersionCheckInfo.lastChecked is a Unix timestamp in milliseconds or null if “never checked”; VersionCheckInfo.latestVersion is a version string or null if “never fetched”; VersionCheckInfo.lastNotified is the Unix timestamp in milliseconds of the last printed update notification or null.KEY_LAST_NOTIFIED is separate from KEY_LAST_CHECKED, allowing cached latest-version data to remain hot while rate-limiting the printed “new version available” notification to once per day.markUpdateNotified() writes String(Date.now()) to version_check.last_notified; clearVersionCheckCache() clears all three version-check keys; setVersionCheckInfo(latestVersion) writes both the current timestamp and supplied latest version.last_checked triggers a fresh check on the next CLI invocation.packages/cli/src/lib/patch-cache.ts delegates cache operations to makeCache(join(getConfigDir(), "patch-cache")) from binpatch.packages/cli/src/lib/patch-cache.ts re-exports ChainMeta, PatchStepMeta, chainFileName, and patchFileName from binpatch.savePatchesToCache(chain, steps) calls cache().save(chain, steps) where chain contains patches and expectedSha256, and each step contains fromVersion and toVersion.loadCachedChain(currentVersion, targetVersion) calls cache().load(...), returns null when no chain exists, and normalizes every loaded patch’s data to new Uint8Array(patch.data).cleanupPatchCache() delegates to cache().cleanup(), while clearPatchCache() delegates to cache().clear().packages/cli/test/lib/version-check.test.ts now imports Vitest vi, UPGRADE_SOURCES, and the ../../src/lib/delta-upgrade.js module namespace; afterEach calls vi.restoreAllMocks() in addition to aborting pending checks, restoring globalThis.fetch, and restoring SENTRY_CLI_NO_UPDATE_CHECK."checks for update when never checked before": no lastChecked value makes shouldCheckForUpdate true and initiates a background check.packages/cli/test/lib/version-check.test.ts: Toolkit discovery returns [{ tag_name: "cli@99.0.0", draft: false }], prefetchStablePatches must receive "99.0.0", an AbortSignal, and UPGRADE_SOURCES[0], and the only request is https://api.github.com/repos/getsentry/toolkit/releases?per_page=100; legacy access is forbidden.packages/cli/test/lib/version-check.test.ts: Toolkit release discovery returns HTTP 404, legacy https://api.github.com/repos/getsentry/cli/releases/latest returns { tag_name: "v99.0.0" }, and prefetchStablePatches must receive "99.0.0", an AbortSignal, and UPGRADE_SOURCES[1].https://api.github.com/repos/getsentry/toolkit/releases?per_page=100; 2. https://api.github.com/repos/getsentry/cli/releases/latest.packages/cli/test/lib/version-check.test.ts: with release channel "nightly", Toolkit probe https://api.github.com/repos/getsentry/toolkit returns HTTP 200, token scope repository:getsentry/toolkit:pull returns "toolkit-token", and Toolkit’s nightly manifest reports version "99.0.0-dev.200".prefetchNightlyPatches must receive "99.0.0-dev.200", an AbortSignal, and UPGRADE_SOURCES[0]; no legacy access is allowed.https://api.github.com/repos/getsentry/toolkit; 2. https://ghcr.io/token?scope=repository:getsentry/toolkit:pull; 3. https://ghcr.io/v2/getsentry/toolkit/manifests/nightly.packages/cli/src/lib/version-check.ts: nightly checks call fetchLatestNightlyVersionWithSource(signal), stable checks call fetchLatestFromGitHubWithSource(signal), and patch prefetch receives the selected source via prefetchNightlyPatches(latestVersion, signal, source) or prefetchStablePatches(latestVersion, signal, source).packages/cli/src/lib/upgrade.ts exposes both source-aware and compatibility APIs: fetchLatestFromGitHubWithSource plus fetchLatestFromGitHub, and fetchLatestNightlyVersionWithSource plus fetchLatestNightlyVersion.null represents no previous check or fetch, and a first-time state triggers background update discovery.packages/cli/src/lib/upgrade.ts consistently pass the selected source through getAnonymousToken, fetchManifest, fetchNightlyManifest, and downloadNightlyBlob, including version-specific nightly tags of the form nightly-${version}.packages/cli/src/lib/ghcr.ts exposes source-aware operations getAnonymousToken, fetchManifest, fetchNightlyManifest, downloadNightlyBlob, listTags, and downloadLayerBlob; fetchNightlyManifest delegates to fetchManifest(token, GHCR_TAG, signal, source), and downloadLayerBlob delegates to downloadNightlyBlob(token, digest, signal, source).