Dashboard › cli › Distillation
489c9d17-2a06-4074-938c-d04e07efddca["lore_tm_v1_oRe4o3AeVYtTBb0uW7veYhMtAeUFU-I9Y04jn4yjKto","lore_tm_v1_MVkRUh0uhql1hexQpZjP222TSw4R_rHRlK-GxBvVU6M","lore_tm_v1_DmitI9ajV9MTNYYY4eZbY743U6H6ACYnyR1wP8w4nsQ"]
dcf6719995800d28d6f88a8c709abe4aa3d0b6db (test(cli): validate GitHub request origin, authored and committed by Burak Yigit Kaya <byk@sentry.io> at Thu Sep 10 03:52:45 2026 +0000) changed packages/cli/test/commands/cli/upgrade.test.ts with 5 insertions and 3 deletions.packages/cli/test/commands/cli/upgrade.test.ts, the test "validates an npm stable pin through npm while tracking nightly" now determines whether a request reached GitHub by checking new URL(request).origin === "https://api.github.com" rather than whether the URL string merely contains "api.github.com"; the test still requires the npm request https://registry.npmjs.org/sentry/1.2.3 and forbids GitHub API requests.packages/cli/test/commands/cli/upgrade.test.ts covers pinned-upgrade routing while tracking nightly: Homebrew rejects stable pin 1.2.3 before any network request with "Homebrew does not support installing a specific version" and does not invoke migrateSpawnSpy; npm validates stable pin 1.2.3 through the npm registry rather than GitHub.packages/cli/test/commands/cli.test.ts updated curl-upgrade mocks from single legacy release objects such as { tag_name: "v0.0.0-dev" } and { tag_name: "v99.0.0" } to Toolkit release arrays using product-prefixed tags such as [{ tag_name: "cli@1.0.0" }] and [{ tag_name: "cli@99.0.0" }].upgradeCommand.func test "shows installation info with specified method" now calls curl with { check: true, method: "curl", json: true } and expects UpgradeResult.action === "checked" and method === "curl"; it previously used check: false and expected "up-to-date"."check mode shows update available" test documents that curl reads the Toolkit GitHub release list with product-prefixed tags, resolves cli@99.0.0 to targetVersion === "99.0.0", returns action === "checked", and includes warning "Run 'sentry cli upgrade' to update.".{ tag_name: "cli@2.0.0" } for URLs containing /releases/tags/cli%402.0.0 and [{ tag_name: "cli@99.0.0" }] otherwise; checking version 2.0.0 must include warning "Run 'sentry cli upgrade 2.0.0' to update."."check mode compares the current version with a stable target" verifies curl check-mode reports currentVersion === "0.0.0-dev" and targetVersion === "1.0.0" from Toolkit fixture cli@1.0.0, rather than asserting current and target versions match with no warnings.999.0.0 to throw "Version 999.0.0 not found", and explicitly asserts exactly 2 fetch calls via callCount === 2.upgradeSourceKey(source) after normalizing source-specific upgrade data.patch-chain:${fromVersion}-${toVersion}; cache loads emit cache.key, cache.hit, and, on a hit, cache.item_size, while saves emit cache.key and total patch size under cache.item_size. The cache directory is join(getConfigDir(), "patch-cache").packages/cli/src/lib/ghcr.ts documents a 30-second large-blob timeout as GHCR_BLOB_TIMEOUT = 30_000 and avoids automatically following authenticated redirects because fetch with redirect: "follow" could forward the Authorization header.https://example.com/patch.bin, a redirected blob-storage failure where a 307 redirect to https://blob.storage.azure.com/file is followed by HTTP 403, external cancellation during the GHCR blob request using AbortController and DOMException("aborted", "AbortError"), and HTTP 404 conversion to UpgradeError."features" | "fixes" | "performance" and builds source-specific changelog summaries by stripping VERSION_PREFIX_RE, selecting versions strictly greater than fromVersion and less than or equal to toVersion, and applying section truncation when originalCount > maxItems.requestedUrls and receives HTTP 500.