Dashboard › cli › Distillation
5465141d-b5f3-413e-b219-09b0333c3c27["lore_tm_v1_YEwKp1HOX3mgayGbZ_f3bCzeps8oUgLYPXo2ScqbHRc","lore_tm_v1_u30ko_NmXzJ9VxDlYVKsovgtCLUp5euOdwnZ3XF9Cv8","lore_tm_v1_LpK5XOaojLxoaIYPiPLQgaOLtrEMxM19Tq02k3_mOVU","lore_tm_v1__LN4RqhtwhJ_mTLVyjy0bT5wJ3fF-IJNGx-Cj3q4m7A"]
/home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts lines 500β809 of 945.runSetupOnNewBinary(opts) builds child arguments in this order: "cli", "setup", "--quiet", "--method", method, "--channel", channel, "--no-modify-path"; it appends "--install" when install is true.installDir is provided, runSetupOnNewBinary() passes { ...process.env, SENTRY_INSTALL_DIR: installDir }; this pins the child installation directory and prevents determineInstallDir() from relocating the binary.runSetupOnNewBinary() invokes spawnWithRetry(binaryPath, args, env) and throws UpgradeError("execution_failed", \Setup failed with exit code ${exitCode}`)` for a nonzero exit code.executeStandardUpgrade() uses the rolling NIGHTLY_TAG only when channel === "nightly" and no versionArg was supplied; a pinned nightly version uses its own release tag.withProgress({ message: \Downloading ${target}...`, json }, ...)and callexecuteUpgrade(method, target, downloadTag, offline, setMessage)`.patchBytes, the CLI logs Applied delta patch (${formatBytes(downloadResult.patchBytes)} downloaded).executeStandardUpgrade() runs the downloaded temporary binary with setup installation enabled, sets installDir to dirname(getCurlInstallPaths().installPath), and always calls releaseLock(downloadResult.lockPath) in finally.executeStandardUpgrade() runs setup against execPath with install: false; Homebrew is excluded because its post_install hook already runs setup.migrateToStandaloneForNightly(method, target, versionArg, json?) migrates brew/npm/pnpm/bun/yarn installations to a standalone binary because nightly builds are distributed only as standalone GitHub release assets.determineInstallDir() logic, 3. run setup to update completions, PATH, and metadata, 4. return warnings that the old package-manager installation may remain earlier in PATH."Nightly builds are only available as standalone binaries." and "Migrating to standalone installation...".migrateToStandaloneForNightly() uses NIGHTLY_TAG for the latest nightly and no override tag for a pinned version, then calls executeUpgrade("curl", target, downloadTag, undefined, setMessage).UpgradeError("execution_failed", "Failed to download nightly binary").installDir = determineInstallDir(homedir(), process.env), invokes the new binary with method: "curl", channel: "nightly", and install: true, and always releases downloadResult.lockPath in finally.npm uninstall -g sentry; pnpm β pnpm remove -g sentry; bun β bun remove -g sentry; yarn β yarn global remove sentry; brew β brew uninstall getsentry/tools/sentry.Your ${method}-installed sentry may still appear earlier in PATH. and, when a hint exists, adds Consider removing it: ${hint}.resolveContext(version, flags) derives { channel, versionArg } through resolveChannelAndVersion(version), compares the channel with getReleaseChannel(), selects flags.method ?? (await detectInstallationMethod()), runs validateMethod(method, versionArg, channel, flags.offline), and returns { channel, versionArg, channelChanged, method }.persistChannel(channel, channelChanged, version) calls setReleaseChannel(channel) when the channel changed or CHANNEL_VERSIONS.has(version ?? ""); it must run after offline target resolution because a channel change clears cached version-check data.startChangelogFetch(channel, currentVersion, targetVersion, offline) immediately resolves undefined in offline mode or when current and target versions match; otherwise it calls fetchChangelog() and converts null results or rejected promises to undefined.buildCheckResultWithChangelog() starts with buildCheckResult(opts), sets result.offline = true in offline mode, awaits opts.changelogPromise, assigns it to result.changelog, and returns the result.upgradeCommand brief is "Update the Sentry CLI to the latest version" and documents two persisted release channels: stable as the default latest stable release and nightly as a build from main updated on every commit.sentry cli upgrade β update to latest using the persisted channel; 2. sentry cli upgrade nightly β βSwitch to nightly channel and updateβ; 3. sentry cli upgrade stable β switch back to stable and update; 4. sentry cli upgrade 0.5.0 β install a specific stable version; 5. sentry cli upgrade --check β check without installing; 6. sentry cli upgrade --force β force re-download when up to date; 7. sentry cli upgrade --method npm β force npm; 8. sentry cli upgrade --offline β upgrade from cached patches without network.sentry cli upgrade nightly behavior as: βSwitch to nightly channel and update.β0.5.0, "nightly"/"stable" to switch channels, or omission to upgrade within the current channel.check boolean default false; force boolean default false; offline boolean default false; and optional parsed method accepting curl, brew, npm, pnpm, bun, or yarn./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/packages/cli/src/commands/cli/upgrade.ts lines 810β945 of 945.upgradeCommand.func() resolves context first, then logs Installation method: ${method} and Current version: ${CLI_VERSION} at debug level.withProgress({ message: "Checking for updates...", json: flags.json }, ...) and passes persistChannelFn: () => persistChannel(channel, channelChanged, version) to resolveTargetWithFallback().{ kind: "done" }, an online check result with action === "checked" and differing current/target versions fetches a changelog through startChangelogFetch(channel, CLI_VERSION, result.targetVersion, false) before yielding CommandOutput.startChangelogFetch(channel, CLI_VERSION, target, offline) before downloading so the changelog request and binary download can proceed in parallel.--check returns buildCheckResultWithChangelog(...) and does not perform an actual upgrade.CLI_VERSION === target, the command returns action "up-to-date" unless flags.force is true or channelChanged is true; the result includes current/target versions, channel, method, forced: false, and offline: true only when applicable.isDowngrade(CLI_VERSION, target) and logs either Downgrading to ${target} or Upgrading to ${target}."curl" calls migrateToStandaloneForNightly(method, target, versionArg, flags.json); all other cases call executeStandardUpgrade() with method, channel, version argument, target, this.process.execPath, offline mode, and JSON mode."downgraded" or "upgraded", plus currentVersion, targetVersion, channel, method, forced, optional offline: true, migration warnings, and changelog.set +e around telemetry work, generates an event UUID using /proc, uuidgen, or an awk fallback, strips hyphens from the event ID, and submits an envelope to ${SENTRY_INGEST}/api/${SENTRY_PROJECT_ID}/envelope/.die() error path and a trap for unexpected failures caused by set -e/pipefail, including failures such as gunzip.--no-agent-skills, validates that --version has an argument, detects Darwin/Linux and architecture, distinguishes musl from glibc on Linux, and warns non-root users with installation instructions where applicable.ghcr.io, fetches the OCI manifest for :nightly, locates the matching layer digest, follows the GHCR redirect to Azure Blob Storage, and executes curl -sf "$redir_url" | gunzip > "$tmp_binary".setup_args="--install --method curl --channel $channel" so the release channel persists for future sentry cli upgrade calls./home/byk/.local/share/opencode/worktree/0e8c2f3bbe145a3280d6fb6ed900a5121f382cf0/glowing-cactus/.github/workflows/ci.yml lines 450β809 of 996.zig-bsdiff version 0.1.19 from zig-bsdiff-linux-x64.tar.gz, verifies SHA-256 9f1ac75a133ee09883ad2096a86d57791513de5fc6f262dfadee8dcee94a71b9, uses curl retries --retry 3 --retry-delay 5 --retry-all-errors, and extracts it to /usr/local/bin.actions/download-artifact@v8, pattern sentry-*-*, path new-binaries, and merge-multiple: true; the pattern includes platform binaries and -gz variants but excludes sentry-patches.refs/heads/main, CI logs into ghcr.io/getsentry/cli with ORAS, lists tags matching ^nightly-[0-9], sorts them with sort -V, selects the latest tag before nightly-${VERSION}, sets HAS_PREV=true, and downloads/decompresses every previous manifest layer whose OCI title ends in .gz into old-binaries."No previous versioned nightly found, skipping patches" and exits successfully.refs/heads/release/**, CI queries the latest non-prerelease, non-draft release from the first 5 GitHub releases, sets HAS_PREV=true, downloads matching .gz files for each new binary into old-binaries, tolerates missing assets with a warning, and best-effort decompresses them.new-binaries/sentry-*, skips .gz entries and platforms lacking an old binary, and runs bsdiff "$old_binary" "$new_binary" "patches/${name}.patch" --use-zstd.GENERATED, and prints Generated ${GENERATED} patches.MAX_RATIO: 50; this is deliberately below the clientβs 60% SIZE_THRESHOLD_RATIO limit to catch oversized single-step patches with margin.patches/*.patch against its corresponding new-binaries/${name}.gz, rounds the percentage to an integer, emits a GitHub Actions error when the ratio exceeds 50%, records exact patch/gzip byte sizes, and deletes the oversized patch."Delta patch generation produced oversized patches", labels a newly created issue bug, includes branch/commit/run details, and explains that excluded patches usually indicate a failed old-binary download producing an empty or wrong file.actions/upload-artifact@v7 as artifact sentry-patches from patches/*.patch."Delta patch generation failed" with branch, commit, and workflow-run details.publish-nightly job runs only for pushes to main, depends on [changes, build-binary, generate-patches], and runs on ubuntu-latest.sentry-*-gz into artifacts, uncompressed artifacts with pattern sentry-*-* into binaries, and optional sentry-patches into patches; missing patch artifacts are tolerated via continue-on-error: true.1.3.1, verifies SHA-256 d52c4af76ce6a3ceb8579e51fb751a43ac051cca67f965f973a0b0e897a2bb86, and extracts oras_${VERSION}_linux_amd64.tar.gz to /usr/local/bin.artifacts working directory to ghcr.io/getsentry/cli:nightly with artifact type application/vnd.sentry.cli.nightly, source annotation https://github.com/getsentry/cli, version annotation ${VERSION}, and bare *.gz layer titles required by findLayerByFilename().oras tag ghcr.io/getsentry/cli:nightly "nightly-${VERSION}", enabling patch-chain resolution for specific nightly versions.continue-on-error: true.sha256-${basename_patch} annotations from corresponding uncompressed binaries, gathers patch filenames, exits successfully when none exist, determines the previous nightly tag, and skips publishing if no previous nightly is found.${REPO}:patch-${VERSION} with artifact type application/vnd.sentry.cli.patch, annotation from-version=${PREV_VERSION}, per-platform SHA-256 annotations, and the generated patch files.test-e2e job depends on [build-binary, changes], uses actions/checkout@v6, pnpm/action-setup@v4, actions/setup-node@v6, the pinned ${{ env.NODE_VERSION_24 }}, and actions/cache@v5.ERR_STREAM_PREMATURE_CLOSE on a floating "24"; the source points to NODE_VERSION_24 in the top-level environment block.node_modules, packages/*/node_modules, and apps/*/node_modules, keyed by node-modules-${{ hashFiles('pnpm-lock.yaml', '.npmrc', 'packages/cli/patches/**') }}; cache misses run pnpm install --frozen-lockfile.sentry-linux-x64 into dist-bin, runs chmod +x dist-bin/sentry-linux-x64, generates the API schema with pnpm run generate:schema, and executes pnpm run test:e2e with SENTRY_CLI_BINARY=${{ github.workspace }}/dist-bin/sentry-linux-x64.${{ needs.changes.outputs.skill == 'true' }}: OPENROUTER_API_KEY is preferred and ANTHROPIC_API_KEY remains a fallback; tests auto-skip when neither key is present.build-npm matrix tests Node versions "20", "22", and "24" with fail-fast: false; the job depends on [lint, test-unit] and selects the production environment on main or release/**.