Skip to content

ref(api): upgrade @sentry/api to 0.21.0, remove raw HTTP pagination workarounds#321

Merged
BYK merged 1 commit intomainfrom
ref/upgrade-sentry-api-0.21
Mar 3, 2026
Merged

ref(api): upgrade @sentry/api to 0.21.0, remove raw HTTP pagination workarounds#321
BYK merged 1 commit intomainfrom
ref/upgrade-sentry-api-0.21

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Mar 2, 2026

Summary

Upgrades @sentry/api from ^0.1.0 to ^0.21.0 and removes the raw-HTTP pagination workarounds we had in place for sentry-api-schema#59 and sentry-api-schema#60, both fixed by getsentry/sentry#109642.

What changed

5 functions migrated from raw HTTP to SDK calls:

Function Before After
listProjects orgScopedPaginateAll (raw HTTP loop) SDK loop via listAnOrganization_sProjects
listProjectsPaginated orgScopedRequestPaginated SDK + unwrapPaginatedResult
listRepositories apiRequestToRegion SDK + unwrapResult via listAnOrganization_sRepositories
listRepositoriesPaginated orgScopedRequestPaginated SDK + unwrapPaginatedResult
listTeamsPaginated orgScopedRequestPaginated SDK + unwrapPaginatedResult

~105 lines of dead infrastructure removed:

  • extractOrgSlugFromEndpoint + regex constants
  • orgScopedRequestPaginated
  • orgScopedPaginateAll

All list functions now follow the same consistent pattern: SDK call → unwrapResult / unwrapPaginatedResult.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (api) Add --data/-d flag and auto-detect JSON body in fields by BYK in #320
  • (formatters) Render all terminal output as markdown by BYK in #297
  • (issue-list) Global limit with fair distribution, compound cursor, and richer progress by BYK in #306

Bug Fixes 🐛

Api

  • Use numeric project ID to avoid "not actively selected" error by betegon in #312
  • Use limit param for issues endpoint page size by BYK in #309
  • Auto-correct ':' to '=' in --field values with a warning by BYK in #302

Formatters

  • Expand streaming table to fill terminal width by betegon in #314
  • Fix HTML entities and escaped underscores in table output by betegon in #313

Other

  • (ci) Generate JUnit XML to silence codecov-action warnings by BYK in #300
  • (nightly) Push to GHCR from artifacts dir so layer titles are bare filenames by BYK in #301
  • (test) Handle 0/-0 in getComparator anti-symmetry property test by BYK in #308

Internal Changes 🔧

Api

  • Upgrade @sentry/api to 0.21.0, remove raw HTTP pagination workarounds by BYK in #321
  • Wire listIssuesPaginated through @sentry/api SDK for type safety by BYK in #310

🤖 This preview updates automatically when you update the PR.

@BYK BYK marked this pull request as ready for review March 2, 2026 23:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

Codecov Results 📊

2340 passed | Total: 2340 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

❌ Patch coverage is 79.45%. Project has 3217 uncovered lines.
✅ Project coverage is 80.39%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
api-client.ts 73.13% ⚠️ 234 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    80.37%    80.39%    +0.02%
==========================================
  Files          120       120         —
  Lines        16426     16402       -24
  Branches         0         0         —
==========================================
+ Hits         13201     13185       -16
- Misses        3225      3217        -8
- Partials         0         0         —

Generated by Codecov Action

…ounds

The @sentry/api SDK now has cursor support for all paginated endpoints
(sentry-api-schema#59, #60 fixed via getsentry/sentry#109642).

Migrated 5 functions from raw HTTP (orgScopedRequestPaginated) to SDK:
- listProjects: SDK auto-pagination loop
- listProjectsPaginated: SDK + unwrapPaginatedResult
- listRepositories: SDK + unwrapResult (was apiRequestToRegion)
- listRepositoriesPaginated: SDK + unwrapPaginatedResult
- listTeamsPaginated: SDK + unwrapPaginatedResult

Removed dead infrastructure:
- extractOrgSlugFromEndpoint + regex constants
- orgScopedRequestPaginated
- orgScopedPaginateAll

All list functions now consistently use the SDK with our custom
unwrapResult/unwrapPaginatedResult for proper error type preservation.
@BYK BYK force-pushed the ref/upgrade-sentry-api-0.21 branch from 2e3467b to dfd672a Compare March 3, 2026 00:15
@BYK BYK merged commit 5779d64 into main Mar 3, 2026
20 checks passed
@BYK BYK deleted the ref/upgrade-sentry-api-0.21 branch March 3, 2026 00:24
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