Dashboard › cli › Distillation
7da21494-ec0e-43e8-a719-b5d2005f090b["lore_tm_v1_8W2WtiKQb2iv0Unqy5BF6m_wWiWoGNy_74YZTaVBoPU","lore_tm_v1_iTXcUCiLC3FFdpxSr18tp1VfiPWOYmXOy0EVDiiS2Mo","lore_tm_v1_a40eu90UNg7MRr0egCJ2SGS-pnePuR2QscwVErIA2xo"]
packages/cli/src/lib/delta-upgrade.ts was made source-aware: it imports getGitHubReleasesUrl, PRIMARY_UPGRADE_SOURCE, and UpgradeSource from ./binary.js, replacing the fixed GITHUB_RELEASES_URL and fixed GHCR_REPO dependencies.packages/cli/src/lib/delta-upgrade.ts added isGitHubRelease(value: unknown), which accepts only non-null objects having string tag_name and array assets; its narrowed type additionally permits draft?: boolean and prerelease?: boolean.nightlySource(source: UpgradeSource) in packages/cli/src/lib/delta-upgrade.ts now configures ghcrSource() with repo: source.ghcrRepo; other exact settings remain registry: "https://ghcr.io", targetTag: (version) => \nightly-${version}`, binaryName: getPlatformBinaryName(), compareVersions, userAgent: `sentry-cli/${CLI_VERSION}`, fetch: customFetch, and instrument`.resolveNightlyChain() in packages/cli/src/lib/delta-upgrade.ts gained optional source?: UpgradeSource, defaults it with getPrimaryUpgradeSource(), and creates OciClient with repo: source.ghcrRepo. It returns null when the filtered chain has no tags or exceeds MAX_NIGHTLY_CHAIN_DEPTH.resolveNightlyDelta() in packages/cli/src/lib/delta-upgrade.ts gained a final parameter source: UpgradeSource = getPrimaryUpgradeSource() and passes it to nightlySource(source), preserving the prior public parameters targetVersion, oldBinaryPath, destPath, offline?, and setMessage?.resolveDelta() in packages/cli/src/lib/delta-upgrade.ts wraps resolveAndApply() and returns both the delta result and telemetry-selected source as { result, source: tel._source.current }; it supplies CLI_VERSION, target version, old/destination paths, patch cache, offline mode, progress handler, and telemetry.validateChainStep() in packages/cli/src/lib/delta-upgrade.ts first compares getPatchFromVersion(manifest) with opts.expectedFrom; a mismatch yields { reason: "version-mismatch", expected, actual }. If binpatch validation fails, the adapter distinguishes an existing oversized patch layer as { reason: "size-exceeded", layerSize, budget } from an absent layer as { reason: "missing-layer", layerName }.packages/cli/src/lib/ghcr.ts now imports PRIMARY_UPGRADE_SOURCE and UpgradeSource from ./binary.js, allowing GHCR operations to use the release source selected during version discovery.packages/cli/src/lib/ghcr.ts uses GHCR_REQUEST_TIMEOUT = 10_000 milliseconds and GHCR_MAX_RETRIES = 1; the rolling nightly OCI tag is GHCR_TAG = "nightly".packages/cli/src/lib/ghcr.ts added GhcrManifestHttpError extends UpgradeError. Its constructor accepts (tag: string, status: number), uses error code "network_error", emits Failed to fetch manifest for tag "${tag}": HTTP ${status}, sets name = "GhcrManifestHttpError", and retains the HTTP status in readonly property status.getAnonymousToken() in packages/cli/src/lib/ghcr.ts now accepts sourceOrSignal: UpgradeSource | AbortSignal = PRIMARY_UPGRADE_SOURCE plus optional signal?: AbortSignal, retaining compatibility with callers that previously passed an AbortSignal as the first argument. It requests ${GHCR_REGISTRY}/token?scope=repository:${source.ghcrRepo}:pull and selects the appropriate external signal by checking for ghcrRepo.getNightlyVersion(manifest) in packages/cli/src/lib/ghcr.ts reads manifest.annotations?.version; if absent, it throws UpgradeError("network_error", "Nightly manifest has no version annotation").packages/cli/src/lib/ghcr.ts deliberately use a two-step redirect flow: first request the GHCR blob with Bearer authorization, redirect: "manual", and buildSignal(GHCR_BLOB_TIMEOUT, signal); then follow the returned Azure Blob Storage signed URL without the Authorization header. Forwarding the GHCR Bearer token to Azure causes HTTP 404.packages/cli/src/lib/ghcr.ts uses only the user-agent header and the callerβs signal, with no AbortSignal.timeout; rationale: a full nightly binary is approximately 30 MB, and a 30-second timeout would require sustained throughput of approximately 8 Mbps. GHCR connection latency remains guarded by the first-step timeout.packages/cli/src/lib/release-notes.ts keeps exactly three user-facing changelog categories: New Features (β¨, ### New Features, or feat: commits), Bug Fixes (π, ### Bug Fixes, or fix: commits), and Performance (β‘, ### Performance, or perf: commits); all other categories are filtered out.extractSections(body) in packages/cli/src/lib/release-notes.ts uses marked.lexer() to locate matching level-3 headings and retain intervening tokens, including level-4 scope subheadings and lists; blank input returns [].COMMIT_PREFIX_TO_CATEGORY in packages/cli/src/lib/release-notes.ts maps "feat" β "features", "fix" β "fixes", and "perf" β "performance".fetchReleasesForChangelog(source: UpgradeSource) in packages/cli/src/lib/release-notes.ts now requests ${getGitHubReleasesUrl(source)}?per_page=${CHANGELOG_MAX_RELEASES} with getGitHubHeaders(), rather than using the fixed GITHUB_RELEASES_URL. Network errors, non-success responses, malformed JSON, or non-array JSON produce [], with debug logging for request, parse, and shape failures.fetchNightlyChangelog() in packages/cli/src/lib/release-notes.ts gained source: UpgradeSource, so nightly commit history is fetched from the release source selected during version discovery.X.Y.Z-dev.<unix-seconds>: sinceDate is (fromTs + 1) * 1000 because GitHubβs since is inclusive and the installed commit must be excluded; untilDate is (toTs + 1) * 1000 because GitHubβs until is exclusive and the target commit must be included.