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
Draft
fix: 3 bug fixes — seer root cause extraction, release set-commits masking, issue selector hint#1023cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
… 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>
Contributor
|
Contributor
Codecov Results 📊✅ Patch coverage is 100.00%. Project has 4275 uncovered lines. Generated by Codecov Action |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Three independent bug fixes, each in its own commit.
1. fix(seer): extractRootCauses empty causes array blocks agent artifact fallback
Root Cause:
searchContainersForRootCauses()insrc/types/seer.tsreturned early when a legacy container hadcauses: [](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"andcauses: [](legacy format, empty) alongside agent artifacts withkey: "root_cause"and valid data.issue explainreports "no root causes found" even though agent data exists.Fix: Added
container.causes.length > 0check 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()insrc/commands/release/set-commits.tscaught anyApiErrorwith status 400 fromsetCommitsAuto()and treated it as "no repository integration". However,setCommitsAuto()internally callssetCommitsWithRefs()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()insrc/commands/issue/utils.ts, when@latest/@most_frequentfound no unresolved issues, the error hint directed users tosentry 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 @latestwhen 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.