Dashboard › cli › Distillation
10968e64-647e-4065-b5f2-a95296779bec["lore_tm_v1_-sask1DPw52f6ZGsN58iYSrb4cLMUPXjVVGyT-Wip-U","lore_tm_v1_mVtf_TANQFBgaXCRWJDG6lXqEGZvufPph2rmmJuLnnk","lore_tm_v1_fsoNRMaWaA3r9E1d0RaPzAOdVWaiTN0cK2vtiqs6EiE"]
packages/cli/test/lib/version-check.test.ts now imports Vitest vi, UPGRADE_SOURCES from ../../src/lib/binary.js, and the ESM namespace * as deltaUpgrade from ../../src/lib/delta-upgrade.js; the namespace import carries // biome-ignore lint/performance/noNamespaceImport: Vitest requires the module namespace to spy on an ESM export.maybeCheckForUpdateInBackground test cleanup in packages/cli/test/lib/version-check.test.ts now calls vi.restoreAllMocks() after aborting pending checks, restoring globalThis.fetch, and restoring SENTRY_CLI_NO_UPDATE_CHECK.getVersionCheckInfo().lastChecked must be null, maybeCheckForUpdateInBackground() starts the background check, the test sleeps 100 ms, then calls abortPendingVersionCheck().packages/cli/test/lib/version-check.test.ts uses toolkitSource = UPGRADE_SOURCES[0]!, rejects any URL containing getsentry/cli, discovers { tag_name: "cli@99.0.0", draft: false }, and expects deltaUpgrade.prefetchStablePatches("99.0.0", expect.any(AbortSignal), toolkitSource). The exact sole request must be https://api.github.com/repos/getsentry/toolkit/releases?per_page=100.legacySource = UPGRADE_SOURCES[1]!; Toolkit discovery at https://api.github.com/repos/getsentry/toolkit/releases?per_page=100 returns HTTP 404, legacy discovery at https://api.github.com/repos/getsentry/cli/releases/latest returns { tag_name: "v99.0.0" }, and deltaUpgrade.prefetchStablePatches must receive "99.0.0", an AbortSignal, and legacySource. The two requested URLs must occur in that exact order.setReleaseChannel("nightly"), uses toolkitSource = UPGRADE_SOURCES[0]!, and rejects any access to getsentry/cli. It mocks Toolkit repository probing, a GHCR token response { token: "toolkit-token" }, and a nightly OCI manifest with schemaVersion: 2, layers: [], and annotations.version: "99.0.0-dev.200".deltaUpgrade.prefetchNightlyPatches("99.0.0-dev.200", expect.any(AbortSignal), toolkitSource) and exactly these requests in order: 1. 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/upgrade.ts: fetchLatestFromGitHub line 462, fetchLatestNightlyVersion line 561, a call to fetchLatestNightlyVersion() line 590, conditional fetchLatestFromGitHub() line 593, versionExists line 692, getBinaryDownloadUrl(version, source) line 905, downloadBinaryToTemp line 1042, attemptDeltaUpgrade call line 1141, and executeUpgrade line 1280 with a downloadBinaryToTemp call at line 1290.attemptDeltaUpgrade line 595, prefetchNightlyPatches line 688, and prefetchStablePatches line 696 in packages/cli/src/lib/delta-upgrade.ts; getBinaryDownloadUrl line 234 in packages/cli/src/lib/binary.ts; source-forwarding calls to prefetchNightlyPatches(latestVersion, signal, source) line 242 and prefetchStablePatches(latestVersion, signal, source) line 244 in packages/cli/src/lib/version-check.ts; and fetchChangelog line 752 in packages/cli/src/lib/release-notes.ts.packages/cli/src/commands/cli/upgrade.ts: versionExists(lookupMethod, target) line 297; executeUpgrade(method, target, downloadTag, offline, setMessage, source) line 680; executeUpgrade("curl", target, downloadTag, undefined, setMessage, source) line 766; and fetchChangelog line 875.packages/cli/src/lib/upgrade.ts imports PRIMARY_UPGRADE_SOURCE at line 42 and UPGRADE_SOURCES at line 45; uses sources: readonly UpgradeSource[] = UPGRADE_SOURCES at lines 440 and 516; selects source ? [source] : UPGRADE_SOURCES at lines 469 and 568; references UPGRADE_SOURCES at line 616; and defaults source: UpgradeSource = PRIMARY_UPGRADE_SOURCE at lines 864, 903, 1047, 1139, 1164, and 1286.packages/cli/src/lib/ghcr.ts imports PRIMARY_UPGRADE_SOURCE and UpgradeSource at line 20, defines GHCR_REPO = PRIMARY_UPGRADE_SOURCE.ghcrRepo at line 135, defaults sourceOrSignal: UpgradeSource | AbortSignal = PRIMARY_UPGRADE_SOURCE at line 209, resolves non-source input to PRIMARY_UPGRADE_SOURCE at line 213, and defaults source: UpgradeSource = PRIMARY_UPGRADE_SOURCE at lines 253, 288, 358, 454, 499, and 542.packages/cli/src/lib/delta-upgrade.ts imports PRIMARY_UPGRADE_SOURCE at line 39, checks if (!PRIMARY_UPGRADE_SOURCE) at line 75, and returns PRIMARY_UPGRADE_SOURCE at line 78.packages/cli/src/lib/binary.ts defines UPGRADE_SOURCES at line 116 and PRIMARY_UPGRADE_SOURCE = UPGRADE_SOURCES[0] at line 130; source-aware functions default to PRIMARY_UPGRADE_SOURCE at lines 236, 244, 252, 260, and 269; GITHUB_RELEASES_URL = getGitHubReleasesUrl() is at line 275; and source iteration uses options.sources ?? UPGRADE_SOURCES at line 341.packages/cli/src/lib/release-notes.ts imports PRIMARY_UPGRADE_SOURCE at line 20 and defaults source = PRIMARY_UPGRADE_SOURCE at line 762.