Skip to content

fix: 3 bug fixes — seer root cause extraction, release set-commits masking, issue selector hint#1023

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/sentry-cli-issues-5362
Draft

fix: 3 bug fixes — seer root cause extraction, release set-commits masking, issue selector hint#1023
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/sentry-cli-issues-5362

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 25, 2026

Overview

Three independent bug fixes, each in its own commit.


1. fix(seer): extractRootCauses empty causes array blocks agent artifact fallback

Root Cause: searchContainersForRootCauses() in src/types/seer.ts returned early when a legacy container had causes: [] (empty array), because [] is truthy in JavaScript. This prevented fallthrough to the agent artifact format (searchBlocksForAgentRootCause).

Trigger: Seer API returns a block with key: "root_cause_analysis" and causes: [] (legacy format, empty) alongside agent artifacts with key: "root_cause" and valid data. issue explain reports "no root causes found" even though agent data exists.

Fix: Added container.causes.length > 0 check so empty arrays fall through to the agent artifact format. Added regression test.

Related: #958


2. fix(release): set-commits default mode masks unrelated 400 errors as missing repo integration

Root Cause: setCommitsDefault() in src/commands/release/set-commits.ts caught any ApiError with status 400 from setCommitsAuto() and treated it as "no repository integration". However, setCommitsAuto() internally calls setCommitsWithRefs() which can return HTTP 400 for unrelated reasons (invalid commit refs, bad release state).

Trigger: Run sentry release set-commits <version> (default mode, no flags) when the repo integration exists but the refs are invalid. The real error is silently swallowed, a false 1-hour negative cache is created, and the command falls back to local git.

Fix: Narrowed the catch to only match the specific "No repository integrations" error message from setCommitsAuto's client-side check. Unrelated 400 errors now propagate to the user. Added two regression tests.


3. fix(issue): selector error hint suggests misleading is:resolved query

Root Cause: In resolveSelector() in src/commands/issue/utils.ts, when @latest/@most_frequent found no unresolved issues, the error hint directed users to sentry issue list <org>/ -q "is:resolved". This was misleading because the selectors only work on unresolved issues and listing resolved issues doesn't help find the issue the user wanted.

Trigger: Run sentry issue view @latest when the organization has no unresolved issues.

Fix: Changed the hint to sentry issue list <org>/ (no filter) so users see all available issues. Updated the corresponding test assertion.

Open in Web View Automation 

cursoragent and others added 3 commits May 25, 2026 12:11
… fallback

searchContainersForRootCauses returned early when container.causes
was an empty array ([]) because [] is truthy in JavaScript. This
prevented fallthrough to the agent artifact format
(searchBlocksForAgentRootCause), causing 'no root causes found'
errors when the API returned empty legacy causes alongside valid
agent root_cause artifacts.

Added length check so empty arrays fall through to agent format.

Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
…missing repo integration

setCommitsDefault() caught any ApiError with status 400 from
setCommitsAuto() and treated it as 'no repository integration'.
However, setCommitsAuto() internally calls setCommitsWithRefs()
which can also return HTTP 400 for unrelated reasons (invalid
commit refs, bad release state, etc.). This caused:
1. A false 1-hour negative cache (cacheNoRepoIntegration)
2. Silent fallback to local git history
3. The real API error being hidden from the user

Narrowed the catch to only match the specific 'No repository
integrations' error message from setCommitsAuto's own check.
Unrelated 400 errors now propagate to the user.

Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
When @latest or @most_frequent found no unresolved issues, the
ResolutionError hint directed users to 'sentry issue list <org>/
-q "is:resolved"'. This was misleading because:
1. The selectors only work on unresolved issues
2. Listing resolved issues doesn't help find the issue they wanted
3. The suggested command can't be combined with the selector

Changed the hint to 'sentry issue list <org>/' (no filter) so
users see all available issues and can determine what to do next.

Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1023/

Built to branch gh-pages at 2026-05-25 12:18 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 4275 uncovered lines.


Generated by Codecov Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant