fix(issue): conditionally collapse lifetime to preserve count/userCount/firstSeen/lastSeen#985
Merged
Merged
Conversation
Contributor
|
Contributor
Codecov Results 📊✅ 7018 passed | Total: 7018 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 82.14%. Project has 14185 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 77.11% 77.12% +0.01%
==========================================
Files 321 321 —
Lines 61993 62010 +17
Branches 0 0 —
==========================================
+ Hits 47808 47825 +17
- Misses 14185 14185 —
- Partials 0 0 —Generated by Codecov Action |
…nt/firstSeen/lastSeen (#969) `collapse=lifetime` on the issues list endpoint strips top-level `count`, `userCount`, `firstSeen`, and `lastSeen` fields from the response. The CLI was always sending this collapse parameter, causing `--json --fields count,firstSeen,...` to return empty values and the human table to show `EVENTS: ?`, `SEEN: —`, `USERS: 0`. Now `lifetime` is only collapsed in JSON mode when explicit `--fields` are provided and none of them are lifetime-dependent. Human output and JSON without `--fields` always get the full data. Closes #969
a87f1e0 to
1e4b1ce
Compare
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
Fixes #969 —
sentry issue list --json --fields count,firstSeen,lastSeen,userCountwas silently omitting those fields becausecollapse=lifetimewas always sent to the Sentry API.Root Cause
buildIssueListCollapse()always included"lifetime"in the collapse array. Despite the JSDoc claiming top-levelcount/userCount/firstSeen/lastSeenare unaffected by collapsing,collapse=lifetimeactually strips these fields from the list endpoint response. This caused:EVENTS: ?in human output (countundefined)SEEN: —/AGE: —(lastSeen/firstSeenundefined)USERS: 0(userCountundefined)--json --fieldsoutputFix
Makes the
lifetimecollapse conditional via a newshouldCollapseLifetimeparameter onbuildIssueListCollapse()(defaults tofalse).Lifetime is NOT collapsed (fields available) when:
--fields— all fields returned--fieldsthat include any of:count,userCount,firstSeen,lastSeenLifetime IS collapsed (perf optimization) when:
--fieldsthat don't include any lifetime-dependent fieldChanges
src/lib/api/issues.ts— AddedshouldCollapseLifetimeoption tobuildIssueListCollapse(), fixed misleading JSDoc commentssrc/commands/issue/list.ts— AddedLIFETIME_FIELDSset, updatedbuildListApiOptions()to compute lifetime collapse condition fromflags.fieldstest/lib/issue-collapse.property.test.ts— Updated property tests for new parameter (11 tests, 407 expect calls)test/commands/issue/list.test.ts— Added 4 integration tests covering all lifetime collapse scenarios