Dashboard › cli › Distillation
e2a7f2b4-b2d1-4e69-90f1-e52e6127a9a8["lore_tm_v1_2rtYV5CWUQYc0IDg7vPlQLm6hNi4MdxDVXacdiXPPtI","lore_tm_v1_pch5QWmSCySM9YXlhS3aaHSCSE2wW0duGF_oUEh_bJo","lore_tm_v1_YKavPwy7DY9YQ1J7oIRHQOPl4DmF0vbWDFpUkbSQg_k","lore_tm_v1_ApWBlW06Dvj7KNJ3n4pTM-p-fKl-D_pLIyu_ErhwTH4","lore_tm_v1_Q0DumnA0Yv3vR6HnN2GrFQv2Y60hTJT5kprBrEUxhes","lore_tm_v1_SE8CzOTOywMklsK90IOGqY_B6pAMY4vhbuULJdu6LVY","lore_tm_v1_iwKyAu5k_1W_7Mn0Xiry5ybWexfNqIG-gp0eMfZFx6w","lore_tm_v1_Mgb1IRALo6I1afEPy1SKlRjMGXpKWAhzyw7lzHSBGVg"]
packages/cli/test/lib/release-notes.test.ts is 295 lines and imports marked, Vitestβs describe/expect/test, GitHubRelease, and buildChangelogSummary, ChangeCategory, countListItems, extractNightlyTimestamp, extractSections, and parseCommitMessages.SAMPLE_RELEASE_BODY models a simplified 0.21.0 release with New Features, Bug Fixes, Documentation, and Internal Changes. Feature entries cover dashboard pagination/glob filtering, a chart-rendering engine, bidirectional cursor pagination, and sentry sourcemap inject/upload; fixes cover table-widget rendering and meaningful network errors; docs cover missing command pages; internal entries cover informational-patch input and a Bun bump from 1.3.9 to 1.3.11.extractSections() tests require features and fixes to be retained, docs and internal changes to be filtered, #### Dashboard and #### Other subheadings to remain, blank bodies and bodies without matching sections to return [], and a ### Performance section with 2 entries to map to one "performance" section.buildChangelogSummary() fixtures contain releases 0.21.0, 0.20.0, 0.19.0, and 0.18.0; the version range "0.19.0"β"0.21.0" includes 0.20.0 and 0.21.0 but excludes 0.19.0.buildChangelogSummary() must return null when there are no releases in range (0.21.0β0.22.0), all bodies are absent/empty, or the only in-range content is internal (0.17.0β0.18.0).buildChangelogSummary() tests require stripping author attribution such as "by @user in", merging the same category across releases into one section, ordering features before fixes, accepting v-prefixed tags such as v0.21.0, and setting truncated === true, totalItems <= 3, and originalCount > 3 when maxItems is 3.parseCommitMessages() tests map feat, fix, and perf commits to exactly 3 output sections while filtering docs and chore; scoped commit text such as feat(dashboard): add pagination support retains the description, only the first line of multiline messages is displayed, commits containing #skip-changelog are omitted, and [] produces [].extractNightlyTimestamp("0.22.0-dev.1772661724") must return 1_772_661_724; stable version "0.21.0", "not-a-version", and "" must return null.countListItems() must count 3 items in "- item 1\n- item 2\n- item 3" and return 0 for paragraph-only content or an empty token array.@ version/tag syntax. Relevant artifacts include @sentry/cli@2.58.6, trpc-cli@0.12.4, sentry-cli@0.24.0, my-org/sentry-cli@0.24.0, cli@1.0.0, cli@0.45.0, @commit:getsentry/cli@abc123, @sentry/cli@latest init, and source references to tagPrefix.packages/cli/src/lib/binary.ts constructs source-specific release URLs through getBinaryDownloadUrl(), getGitHubReleasesUrl(), getGitHubReleaseByTagUrl(), getGitHubLatestReleaseUrl(), and getGitHubRepositoryUrl().getGitHubLatestReleaseUrl() uses ${getGitHubReleasesUrl(source)}?per_page=100 when source.tagPrefix is nonempty and ${getGitHubReleasesUrl(source)}/latest otherwise.resolveUpgradeSource() returns the successful probe Response to the caller so it βnever repeats the requestβ; only HTTP 404 advances to the next source, while all other HTTP statuses and network failures abort immediately.resolveUpgradeSource() uses options.fetch ?? customFetch, sends getGitHubHeaders() and options.signal, rethrows errors named "AbortError", maps TLS certificate errors through buildTlsErrorDetail(), maps other connection failures to UpgradeError("network_error", "Failed to connect to GitHub: β¦"), maps non-404 HTTP failures to "Failed to fetch from GitHub: HTTP ${response.status}", and throws "No CLI upgrade source was found: every source returned HTTP 404" after exhausting all sources.isNightlyVersion(version) detects nightlies with version.includes("-dev."); compareVersions(a, b) delegates to semverCompare(a, b) and returns -1 | 0 | 1; isDowngrade(current, target) is true when compareVersions(current, target) === 1; getBinaryFilename() returns "sentry.exe" on win32 and "sentry" elsewhere.packages/cli/src/lib/binary.ts, packages/cli/src/lib/ghcr.ts, packages/cli/test/lib/binary.test.ts, packages/cli/test/lib/ghcr.test.ts, and packages/cli/test/lib/install-script.test.ts; the diff contains 335 insertions and 25 deletions.packages/cli/src/lib/binary.ts gained UpgradeSource with readonly githubRepo, ghcrRepo, and tagPrefix; UPGRADE_SOURCES is ordered as (1) { githubRepo: "getsentry/toolkit", ghcrRepo: "getsentry/toolkit", tagPrefix: "cli@" }, then (2) { githubRepo: "getsentry/cli", ghcrRepo: "getsentry/cli", tagPrefix: "" }; PRIMARY_UPGRADE_SOURCE is UPGRADE_SOURCES[0].getBinaryDownloadUrl(version, source = PRIMARY_UPGRADE_SOURCE) now downloads from https://github.com/${source.githubRepo}/releases/download/${source.tagPrefix}${version}/${getPlatformBinaryName()}, replacing the fixed getsentry/cli URL.GITHUB_RELEASES_URL now equals getGitHubReleasesUrl() for the primary source rather than the hard-coded "https://api.github.com/repos/getsentry/cli/releases".packages/cli/src/lib/binary.ts now identifies semver.compare rather than Bun.semver.order as the implementation handling stable X.Y.Z and nightly X.Y.Z-dev.<unix-seconds> versions.packages/cli/src/lib/ghcr.ts now imports PRIMARY_UPGRADE_SOURCE and UpgradeSource from ./binary.js; GHCR_REPO defaults to PRIMARY_UPGRADE_SOURCE.ghcrRepo instead of the fixed "getsentry/cli".getAnonymousToken(sourceOrSignal: UpgradeSource | AbortSignal = PRIMARY_UPGRADE_SOURCE, signal?) preserves the old signal-only calling form while supporting a source; it requests ${GHCR_REGISTRY}/token?scope=repository:${source.ghcrRepo}:pull.PRIMARY_UPGRADE_SOURCE: fetchManifest(token, tag, signal?, source?), fetchNightlyManifest(token, signal?, source?), downloadNightlyBlob(token, digest, signal?, source?), internal fetchTagPage(token, lastTag?, signal?, source?), listTags(token, prefix?, signal?, source?), and downloadLayerBlob(token, digest, signal?, source?); manifest, tag-list, and blob URLs use source.ghcrRepo.packages/cli/test/lib/binary.test.ts verifies the default binary URL starts with "https://github.com/getsentry/toolkit/releases/download/", contains "/cli@1.0.0/", contains "sentry-" and the current arm64/x64 architecture, and has an .exe suffix only on Windows.resolveUpgradeSource() tests verify the primary Toolkit source is used after one successful request to https://api.github.com/repos/getsentry/toolkit/releases/tags/cli%400.45.0, with a response containing { tag_name: "cli@0.45.0" }.resolveUpgradeSource() tests verify fallback occurs only after Toolkit returns HTTP 404, after which the legacy probe is https://api.github.com/repos/getsentry/cli/releases/tags/0.45.0 and the selected source is UPGRADE_SOURCES[1].resolveUpgradeSource() tests verify HTTP statuses 401, 403, 429, and 500 do not fall back; each throws an error containing HTTP ${status} after only the Toolkit request.resolveUpgradeSource() tests verify TypeError("fetch failed") does not fall back and becomes "Failed to connect to GitHub: fetch failed" after only the Toolkit request.resolveUpgradeSource() tests verify two HTTP 404 responses produce "No CLI upgrade source was found" after requests to both the Toolkit cli%400.45.0 tag and legacy CLI 0.45.0 tag.getBinaryPaths("/usr/local/bin/sentry") must produce installPath="/usr/local/bin/sentry", tempPath="/usr/local/bin/sentry.download", oldPath="/usr/local/bin/sentry.old", and lockPath="/usr/local/bin/sentry.lock".samePath() tests require identical paths to match, genuinely different paths not to match, case-insensitive matching on Windows/macOS but case-sensitive matching elsewhere, tolerance for a trailing path separator on either side, and preservation of the root separator so root is not treated as empty.getLegacyInstallDirs("/home/user") must return only [join("/home/user", ".sentry", "bin")]; ~/.local/bin and ~/bin are valid current targets and βnever migration sources.βgetGitHubReleaseByTagUrl, resolveUpgradeSource, getGitHubLatestReleaseUrl, and getGitHubRepositoryUrl appear only in packages/cli/test/lib/binary.test.ts and packages/cli/src/lib/binary.ts in the reported results.getsentry/cli release/GHCR references found exactly 28 matches across tests and fixtures, including packages/cli/test/e2e/delta-upgrade.test.ts, packages/cli/test/lib/upgrade.test.ts, packages/cli/test/lib/delta-upgrade.test.ts, packages/cli/test/lib/delta-upgrade.mocked.test.ts, and packages/cli/test/lib/ghcr.test.ts; some remain intentional legacy-source expectations or GitHub fixture links.