fix: resolve 3 bugs — missing issue stats, seer polling timeout, no-solution reason#973
Draft
cursor[bot] wants to merge 4 commits into
Draft
fix: resolve 3 bugs — missing issue stats, seer polling timeout, no-solution reason#973cursor[bot] wants to merge 4 commits into
cursor[bot] wants to merge 4 commits into
Conversation
…rstSeen are returned (#969) The buildIssueListCollapse function always included 'lifetime' in the collapse array, which tells the Sentry API to skip computing aggregate counts (count, userCount, firstSeen). This caused these fields to be missing from both human table output (showing '?' for EVENTS) and JSON output (omitting the fields entirely). Remove 'lifetime' from the collapse array since the CLI uses these fields in table rendering (EVENTS, USERS, AGE columns) and documents them as available JSON fields. Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
…nite polling
The normalizeAgentStatus function uses a fallback of status.toUpperCase()
for unmapped statuses. When the Seer API returns 'canceled' (US spelling),
it becomes 'CANCELED' which doesn't match TERMINAL_STATUSES ('CANCELLED'
with British spelling). This causes shouldStopPolling to never return true,
making the poll loop spin until the 6-minute timeout.
Add explicit mappings for 'canceled'/'cancelled' → 'CANCELLED' and
'need_more_information' → 'NEED_MORE_INFORMATION' to ensure all known
status values are correctly normalized.
Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
The Seer API returns solution data directly on steps with key='solution' rather than inside the artifacts array (which is always empty on the new API). extractNoSolutionReason only searched artifacts, so when Seer couldn't produce a solution, the description explaining why was missed and users got a generic 'No solution found' message. Add searchContainersForStepLevelNoSolutionReason that checks for steps where key='solution' with an empty/missing solution array and returns the description field. Step-level reasons are preferred over artifact- level (legacy fallback). Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
Contributor
|
Contributor
Codecov Results 📊✅ 6981 passed | Total: 6981 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 91.11%. Project has 14124 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 77.09% 77.10% +0.01%
==========================================
Files 320 320 —
Lines 61568 61685 +117
Branches 0 0 —
==========================================
+ Hits 47465 47561 +96
- Misses 14103 14124 +21
- Partials 0 0 —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.
Summary
This PR fixes three bugs discovered through code analysis:
1.
issue listomitscount,userCount,firstSeen,lastSeen(fixes #969)Root cause:
buildIssueListCollapse()always included"lifetime"in the collapse array, telling the Sentry API to skip computing lifetime aggregate counts on the list endpoint.Reproduction:
sentry issue list my-org/ --json --fields count,firstSeen,lastSeen,userCount— all four fields are missing from output. Human table showsEVENTS: ?andSEEN: —.Fix: Remove
"lifetime"frombuildIssueListCollapse(). The CLI needs these fields for table columns (EVENTS, USERS, AGE) and JSON output.2. Seer polling spins to timeout when API returns
"canceled"(US spelling)Root cause:
normalizeAgentStatus()falls through tostatus.toUpperCase()for unmapped values. When the Seer API returns"canceled"(US spelling), it becomes"CANCELED"— butTERMINAL_STATUSESuses"CANCELLED"(British).isTerminalStatus("CANCELED")returns false, so polling never terminates.Reproduction: Any
sentry issue explainorsentry issue plancall where the autofix run is cancelled — the CLI waits 6 minutes before timing out.Fix: Add explicit mappings for
"canceled"/"cancelled"→"CANCELLED"and"need_more_information"→"NEED_MORE_INFORMATION".3.
extractNoSolutionReasonmisses step-level description (partial fix for #958)Root cause: The Seer API now returns solution data directly on steps (
step.solution[]/step.description) rather than insidestep.artifacts[]. WhileextractSolutionwas already updated for this,extractNoSolutionReasonstill only searched artifacts — always finding nothing on the new API format.Reproduction:
sentry issue planon an issue where Seer cannot produce a fix → shows generic "No solution found" instead of the actual reason from the API.Fix: Add
searchContainersForStepLevelNoSolutionReason()that checks steps withkey === "solution"and empty/missingsolutionarray, returning theirdescriptionfield as the reason. Step-level is checked first (new API), artifact-level as fallback (legacy).