Skip to content

fix(deps): bump @sentry/api to 0.180.0 and fix downstream type errors#1066

Merged
betegon merged 7 commits into
mainfrom
fix/sentry-api-bump-0.180
Jun 4, 2026
Merged

fix(deps): bump @sentry/api to 0.180.0 and fix downstream type errors#1066
betegon merged 7 commits into
mainfrom
fix/sentry-api-bump-0.180

Conversation

@betegon

@betegon betegon commented Jun 4, 2026

Copy link
Copy Markdown
Member

Bumps `@sentry/api` from `0.141.0` to `0.180.0` (~39 releases) and fixes the type errors that surface when the SDK's stricter types catch things the old version silently accepted.

What changed in the SDK that affects us:

  • `issue_id` path param is now typed as `string` (not `number`) — our `events.ts` was wrapping it in `Number()`, which now fails. Removed the wrapper.
  • `lastSeen` / `firstSeen` on issues can be `string | null` in the SDK types; our sort comparators and formatters passed them directly to functions expecting `string | undefined`. Added `?? undefined` coercions.
  • The issue status union gained `resolvedInNextRelease` and `muted` — added both to `ISSUE_STATUSES`, `STATUS_COLORS`, `STATUS_ICONS`, and `STATUS_LABELS`.

What still has a cast:

`dashboard_id` path param is still typed as `number` in the SDK — the backend spec fix for that is in a separate Sentry PR. That cast stays until it ships.

Tested locally: `sentry issue list`, `sentry issue view`, `sentry event view` all work against a real org.

betegon and others added 2 commits June 4, 2026 16:11
SDK 0.180.0 tightened several types that the old version silently accepted:

- issue_id is now string (not number) — remove Number() wrappers in events.ts
- lastSeen/firstSeen can be null in SDK types — coerce to undefined at call sites
- Two new issue statuses: resolvedInNextRelease and muted — add to ISSUE_STATUSES,
  STATUS_COLORS, STATUS_ICONS, STATUS_LABELS

The reverse exhaustiveness check on ISSUE_STATUSES is removed: the SDK response
union now includes a variant with status: string (loose), making the check
always fail. The satisfies above still catches invalid values in our tuple.

dashboard_id is still typed as number in the path (backend spec fix pending).
@github-actions

github-actions Bot commented Jun 4, 2026

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-1066/

Built to branch gh-pages at 2026-06-04 15:11 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread src/lib/formatters/colors.ts
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 4417 uncovered lines.
✅ Project coverage is 81.85%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
src/commands/issue/list.ts 100.00% ⚠️ 3 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.85%    81.85%        —%
==========================================
  Files          341       341         —
  Lines        24339     24340        +1
  Branches     15911     15928       +17
==========================================
+ Hits         19922     19923        +1
- Misses        4417      4417         —
- Partials      1661      1664        +3

Generated by Codecov Action

statusColor was calling .toLowerCase() before the STATUS_COLORS lookup,
converting resolvedInNextRelease to resolvedinnextrelease which never
matched — always falling back to yellow instead of green.

Try exact match first, then lowercase fallback for unexpected casing
from older Sentry instances.
@betegon betegon marked this pull request as ready for review June 4, 2026 14:23
betegon added 4 commits June 4, 2026 16:25
…atuses

Add statusColor tests for the two new statuses and the unknown-status
fallback path. Add formatStatusIcon and formatStatusLabel tests covering
all new entries (resolvedInNextRelease, muted) to reach the 80% patch
coverage threshold.
Add getComparator tests for sort=new and the null lastSeen/firstSeen paths
— these were the 2 uncovered patch lines keeping coverage at 77.78%.
Also fixes biome formatting in human.test.ts.
- Add getComparator test for unknown sort value to hit the default: case
- Add getComparator test for sort=new with null firstSeen to cover the null ?? branch
- Fix the sort=date null test to call comparator (not just check no-throw)
- Add writeIssueTable test with null lastSeen/firstSeen to cover human.ts ?? null branches

These were the 2 missing lines and 2 partials causing 77.78% patch coverage.
@betegon betegon merged commit 9ff5d78 into main Jun 4, 2026
29 checks passed
@betegon betegon deleted the fix/sentry-api-bump-0.180 branch June 4, 2026 15:21
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