chore(deps): upgrade @sentry/api 0.94.0 -> 0.113.0 + type cleanup#803
Merged
chore(deps): upgrade @sentry/api 0.94.0 -> 0.113.0 + type cleanup#803
Conversation
c7e06b8 to
7624760
Compare
Contributor
|
Contributor
Codecov Results 📊✅ 138 passed | Total: 138 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 96.97%. Project has 1753 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.64% 95.64% —%
==========================================
Files 280 280 —
Lines 40273 40228 -45
Branches 0 0 —
==========================================
+ Hits 38518 38475 -43
- Misses 1755 1753 -2
- Partials 0 0 —Generated by Codecov Action |
Upgrades the SDK 19 minor versions (all schema-update releases, no breaking changes to any function or type we import) and lands three refactors the upgrade makes ripe: - Adopt SDK's parseSentryLinkHeader via a thin alias, removing ~80 lines of duplicate Link-header parsing from infrastructure.ts. Keep unwrapResult / unwrapPaginatedResult CLI-owned — the SDK's versions throw plain Error and drop AuthError/ApiError class, breaking the 'all errors are CliError subclasses' invariant. - Add SentryRelease and SentryDeploy wrappers in src/types/sentry.ts (Partial<Sdk> & RequiredCore pattern) and migrate src/lib/api/ releases.ts + all seven src/commands/release/*.ts off direct @sentry/api type imports. Release was the last domain violating the 'commands never import from @sentry/api' invariant. - Adapt SentryTeam to Partial<BaseTeam> & { id, slug, name } (schema stays as --fields doc source), tighten ISSUE_STATUSES with 'satisfies readonly NonNullable<SdkIssueDetail["status"]>[]' for SDK-drift detection, and delete dead Release / ReleaseSchema (zero importers). Also fixes three test files (finalize/create/deploy.test.ts) that referenced OrgReleaseResponse/DeployResponse without importing them, which TS silently typed as 'any'. Regenerated src/generated/api-schema.json from the 0.113.0 OpenAPI spec (218 endpoints).
7624760 to
44bd15c
Compare
5 tasks
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
Upgrades
@sentry/apifrom^0.94.0to^0.113.0(19 minor versions, all schema-update releases with no breaking changes to any function the CLI imports) and lands three refactors the upgrade makes ripe:parseSentryLinkHeadervia a thin alias, removing ~80 lines of duplicate Link-header parsing fromsrc/lib/api/infrastructure.ts. We keepunwrapResult/unwrapPaginatedResultCLI-owned — the SDK's versions throw plainErrorand drop theAuthError/ApiErrorclass, which would break the "all errors areCliErrorsubclasses" invariant across ~28 call sites.SentryReleaseandSentryDeploywrappers insrc/types/sentry.tsusing the establishedPartial<Sdk> & RequiredCorepattern, and migratesrc/lib/api/releases.tsplus all sevensrc/commands/release/*.tsfiles off direct@sentry/apitype imports. Release was the last domain violating the "commands never import from@sentry/api" invariant. Body-shape casts (Parameters<typeof sdkFn>[0]["body"]) remain local to the API layer since some mutation payloads are narrower thanOrgReleaseResponse(e.g., the 201 response on create) and theas unknownshape-widening stays contained.SentryTeamtoPartial<BaseTeam> & { id, slug, name }matching theSentryOrganizationpattern (the Zod schema stays as the--fields/ SKILL.md doc source), tightenISSUE_STATUSESwith a bidirectional drift check (satisfiescatches removals/renames; a companion_IssueStatusParityconditional catches additions), and delete deadRelease/ReleaseSchema(zero importers, never re-exported).Also fixes three latent bugs in
test/commands/release/{finalize,create,deploy}.test.tswhere fixtures referencedOrgReleaseResponse/DeployResponsewithout importing them — TS silently typed the fixtures asany. They're now properly typed against the newSentryRelease/SentryDeploy.src/generated/api-schema.jsonis gitignored and auto-regenerates from the@sentry/apiversion tag on the nextbun run generate:schema(which fires fromdev/build/typecheck).Why now
The upgrade is low-risk on its own (zero SDK function additions/removals between 0.94 and 0.113 for anything the CLI imports; all types we read have unchanged shape at the fields we touch), but the three companion refactors have been waiting because they become cleanest when paired with a schema refresh. Landing them together keeps SDK-boundary churn in a single PR.
Explicitly out of scope
unwrapResult/unwrapPaginatedResult— they destroy the typed-error contract enforced atapp.ts(lore019d0804).paginateAll— most list commands use cursor-stack / fair-distribution pagination thatpaginateAllcan't express, and it doesn't honor our env-overridableMAX_PAGINATION_PAGEScap.SentryRepository/SentryRepositorySchema— SDKRepositoryis a 2-field token-regen response, not the repo object.SentryIssueSchema,IssueEventSchema, etc.) — they back--fieldshelp and SKILL.md field tables and either have no SDK counterpart (list vs detail endpoints) or are intentionally narrower.Verification
bunx tsc --noEmitcleanbun run lintclean (only a pre-existing unrelated warning inmarkdown.ts)bun run test:unit— 5,507 passbun run test:isolated— 138 passbun run test:e2e— 123 pass (7 skip)ISSUE_STATUSESparity check catches both directions (adding to the SDK union AND removing from the tuple each trigger a type error).sentry schemaworks against the regenerated 0.113.0 index (218 endpoints).