Dashboard › opencode › Distillation
39f89a61-463f-4486-838b-9b51b45dc754["lore_tm_v1_S1x55HY_SicQdWmoZj2EvZ_NImaAoejZQz_05OuzT_Q"]
useTestConfigDir(), process.env[CONFIG_DIR_ENV_VAR] should be restored to savedConfigDir; deleting process.env.SENTRY_CONFIG_DIR can break test files loaded after afterEach when module-level code or hooks read an undefined value.main commit.CLI_VERSION.404), 2. ambiguous matches across multiple organizations, and 3. insufficient context to resolve a value such as a project suffix without knowing its organization.ResolutionError for entity-not-found scenarios, replacing misleading ContextError messages such as “Issue 99124558 is required,” with clearer identification of the unresolved resource and hints such as using the full ID format or checking access permissions.src/commands/event/view.ts, src/commands/issue/list.ts, src/commands/issue/utils.ts, src/lib/errors.ts, src/lib/resolve-target.ts, test/commands/event/view.test.ts, test/commands/issue/utils.test.ts, test/commands/log/view.test.ts, test/commands/trace/list.test.ts, test/commands/trace/view.test.ts, test/lib/errors.test.ts, and test/lib/resolve-target-listing.test.ts; AGENTS.md was also modified.bunx ultracite check initially found undeclared ResolutionError references in test/commands/event/view.test.ts and later 2 undeclared-reference errors in test/lib/resolve-target-listing.test.ts.src/commands/issue/utils.ts:256 had unnecessary return undefined, resolveIssue() at line 277 had cognitive complexity 16 exceeding the maximum 15, and formatting problems in src/commands/issue/utils.ts, src/lib/sentry-url-parser.ts, and tests; planned fixes were bare return, signature/line wrapping, backtick-string adjustment, and complexity reduction.src/lib/api-client.ts:1147-L1151: getIssueInOrg() passed string issueId to retrieveAnIssue, whereas similar methods such as getLatestEvent and getAutofixState use Number(issueId); suggested fix was issue_id: Number(issueId).useTestConfigDir(prefix = "sentry-test-", options?) creates a unique test config directory before each test, calls closeDatabase(), saves process.env[CONFIG_DIR_ENV_VAR], sets it to the new directory, then closes the database, restores the saved value when defined, and calls cleanupTestDir(dir) after each test.createTestConfigDir() uses a project-local temporary directory and can create a .git directory when isolateProjectRoot is true, preventing DSN detection from walking to the real project root and causing fingerprint mismatches.cleanupTestDir(dir) uses rm(dir, { recursive: true, force: true }) and ignores cleanup errors; mockFetch() casts simplified fetch mocks through unknown to Bun’s extended typeof fetch.test:unit suite runs only test/lib, test/commands, and test/types, excluding test/model-based, test/e2e, and test/isolated; one reported run had exactly 1998 passing and 0 failing tests.nightly, initially chosen for public downloads and stable-release isolation but later blocked by immutable-release tag reuse; 4. timestamped immutable prereleases with old-release cleanup, viable but noisier; 5. GHCR/OCI artifacts via ORAS, supporting mutable tags and anonymous pulls after package-publication setup; 6. npm’s nightly dist-tag, practical for package-manager installs but not a generic raw-binary host.nightly, keep one release pointing at the newest main, and rely on /releases/latest ignoring prereleases so stable users remain unaffected.tag_name was used by an immutable release; even gh release delete nightly --yes --cleanup-tag did not make the nightly tag reusable immediately./home/byk/Code/getsentry/cli/install script was 134 lines before nightly changes and supported --version, --no-modify-path, --no-completions, and SENTRY_INSTALL_DIR; it detects darwin, linux, or windows and x64 or arm64, with Windows limited to x64 and using .exe.https://api.github.com/repos/getsentry/cli/releases/latest, extracts tag_name, strips a leading v, and downloads https://github.com/getsentry/cli/releases/download/${version}/sentry-${os}-${arch}${suffix}, trying .gz through gunzip before falling back to the raw binary.cli setup --install --method curl, optionally adding --no-modify-path and --no-completions.requested_version == "nightly" sets channel="nightly", download_tag="nightly", and display version="nightly" without fetching version.json; the removed request was unnecessary because the functional download only needs the nightly tag.--channel $channel to cli setup, persisting the release channel for future sentry cli upgrade calls.src/commands/cli/setup.ts gained optional channel?: ReleaseChannel in SetupFlags and imports parseReleaseChannel, ReleaseChannel, and setReleaseChannel from ../../lib/db/release-channel.js.src/commands/cli/upgrade.ts uses SetupOptions with binaryPath, method: InstallationMethod, channel: ReleaseChannel, install, and optional installDir; runSetupOnNewBinary(opts) spawns the new binary with cli setup --method <method> --channel <channel> --no-modify-path, adds --install for curl placement, and sets SENTRY_INSTALL_DIR when pinning the install directory.src/lib/upgrade.ts defines InstallationMethod as "curl" | "brew" | "npm" | "pnpm" | "bun" | "yarn" | "unknown" and package managers as "npm" | "pnpm" | "bun" | "yarn"; release APIs use https://api.github.com/repos/getsentry/cli/releases and https://registry.npmjs.org/sentry.getCurlInstallPaths() first uses stored curl install metadata, then checks whether process.execPath starts with a known curl directory, and otherwise falls back to join(homedir(), ".sentry", "bin", getBinaryFilename()).downloadBinaryToTemp() acquires the binary lock, removes an interrupted temp file if present, downloads gzip first with streaming decompression and raw binary as fallback, and deliberately keeps the lock on success for the download→spawn→install pipeline; the caller must release it after the child exits.process.ppid matches the existing lock PID to rewrite the lock with its own PID; a live unrelated holder throws UpgradeError("execution_failed", "Another upgrade is already in progress"), while a dead-process lock is removed and acquisition retried recursively.nightly-version job before build-binary, a publish-nightly job on direct pushes to main, and injected a -dev.<unix_seconds> package version into binaries.build-binary and publish-nightly independently computed Math.floor(Date.now() / 1000), causing binary version 0.x.y-dev.T1 and advertised version.json version 0.x.y-dev.T2; this produced perpetual “new nightly available” notices, repeated downloads of the same binary, and potentially different versions across matrix platforms.github.event.head_commit.timestamp through COMMIT_TIMESTAMP, ensuring all platform binaries and version.json use one commit-derived version.build-binary need skipped nightly-version; this caused unexpected downstream skipping, including test-e2e, despite all 5 binary matrix jobs succeeding. The final inspected workflow removed nightly-version as a separate dependency and computes the commit-timestamp version inside relevant jobs.build-binary targets exactly 5 combinations: darwin-arm64, linux-x64, windows-x64, darwin-x64, and linux-arm64; the first 3 are native smoke-tested, while darwin-x64 and linux-arm64 are cross-compiled without smoke tests.test-e2e downloads the sentry-linux-x64 artifact, runs chmod +x dist-bin/sentry-linux-x64, sets SENTRY_CLI_BINARY to that path, and executes bun run test:e2e.gh release upload/creation expected artifacts/dist-bin/*.gz while downloaded merged artifacts were at another path; the corrected inspected release command used artifacts/*.gz plus version.json.gh release delete nightly --yes --cleanup-tag, followed by gh release create nightly --prerelease --title "Nightly" with notes containing version and commit and assets artifacts/*.gz plus version.json.git rm -r -f . before extracting the docs archive, so storing a persistent nightly/ binary directory on the same gh-pages branch would be wiped on every stable docs release unless nightly assets are merged into the docs artifact or restored afterward.oras push ghcr.io/getsentry/cli:nightly-test *.gz version.json works and pushing the same mutable tag again overwrites it; unchanged blobs are deduplicated and shown as Exists.packages: write/write:packages; the package is private by default and must be made public once through repository/organization administration for unauthenticated CLI downloads.oras pull works anonymously. Raw OCI HTTP download requires: 1. obtain an anonymous bearer token from https://ghcr.io/token?scope=repository:getsentry/cli:pull; 2. fetch https://ghcr.io/v2/getsentry/cli/manifests/nightly accepting application/vnd.oci.image.manifest.v1+json; 3. select the layer whose org.opencontainers.image.title matches the platform filename such as sentry-linux-x64.gz; 4. request the blob with authorization to obtain a 307 redirect; 5. download the signed pkg-containers.githubusercontent.com URL without forwarding the authorization header.Authorization: Bearer ... can yield 404; manually extracting %{redirect_url} and issuing a second unauthenticated curl request succeeded.version.json with {"version":"0.13.0-dev.9999999999","sha":"def456","date":"2026-02-26T02:00:00Z"} and an updated Linux payload updated-linux-binary-v2.--delete flag for deleting the test tag, so nightly-test was left for manual cleanup.fetchLatestNightlyVersion, fetchLatestVersion(..., "nightly"), Homebrew detection, nightly/stable resolveChannelAndVersion, nightly --check output and persistence, nightly labels in getUpdateNotification, clearVersionCheckCache, release-channel cache clearing, setup’s --channel, and stored/known getCurlInstallPaths branches.src/commands/cli/setup.ts 98.21% with only Windows-specific cleanup lines missing, src/commands/cli/upgrade.ts 75.00% in one local report, src/lib/upgrade.ts 81.48%, DB files 100%, and src/lib/version-check.ts 92.08%.src/lib/upgrade.ts at 63.05% with 126 missing patch lines and src/commands/cli/upgrade.ts at 52.94% with 120 missing patch lines, mainly subprocess/Bun spawning, runSetupOnNewBinary, migrateToStandaloneForNightly, and main download paths.test/isolated/brew-upgrade.test.ts mocks node:child_process before dynamically importing ../../src/lib/upgrade.js; it preserves real execFile, execFileSync, execSync, fork, and spawnSync, replaces spawn, and uses an EventEmitter fake process that emits close in a microtask.Bun.spawn was verified writable for additional isolated tests, but globally replacing it was considered risky because subprocess lifecycle simulation, shared module state, real file I/O, and curl lock handling could leak or destabilize tests.709cd50 was created with message fix: address review comments — case normalization, nightly versionExists, install script, cleanup; it changed 2 files with 20 insertions and 18 deletions.feat/nightly-release-channel, up to date with origin/feat/nightly-release-channel; recent commits included eb7bdd7 refactor(ci): address nightly workflow review comments, 709cd50 fix: address review comments — case normalization, nightly versionExists, install script, cleanup, 01bccc6 test: add Bun.spawn spy and expanded isolated tests for upgrade coverage, 6edc751 test: add detectInstallationMethod stored-info path and getCurlInstallPaths branch tests, and 6064cd6 test: add coverage for nightly channel, fetchLatestNightlyVersion, clearVersionCheckCache, and setup --channel.