chore(deps): bump @sentry/api to 0.253.0 and adopt token operationIds - #1194
Conversation
|
Bumps @sentry/api ^0.180.0 -> ^0.253.0 and migrates every SDK call site from the old normalizer-derived names (retrieveAnOrganization, listAnOrganization_sIssues, queryExploreEventsInTableFormat, ...) to the clean token names produced by the operationId migration (getOrganization, listOrganizationIssues, listOrganizationEvents, ...). A few new tokens collide with the CLI's own wrapper functions of the same name, so those SDK imports are aliased (e.g. getOrganization as sdkGetOrganization), following the existing sdk* aliasing convention already used in the codebase. No behavior change. tsc clean; API-lib, command, and type tests green.
bbbfeec to
dab1ca7
Compare
MathurAditya724
left a comment
There was a problem hiding this comment.
Reviewed the full diff. This is a clean, mechanical rename + version bump. Verified:
- All 32 renamed symbols exist in
@sentry/api@0.253.0— every function (getOrganization,listOrganizationIssues,listOrganizationEvents,createTeamProject, etc.), thezGetOrganizationIssueResponsezod export, and theGetOrganizationIssueResponse/ListOrganizationIssuesData/GetProjectDatatype exports all resolve in the installed package. - Collision aliasing is correct. Every new token that shadows a local wrapper (
getOrganization,getProject,deleteProject,listProjectEnvironments,listProjectTeams) is importedas sdk*and the wrapper calls the aliased SDK fn — no accidental self-recursion. Matches the existingsdk*convention. - No behavior change.
createANewProject→createTeamProjectis still the team-scoped endpoint (path.team_id_or_slugunchanged); the rest are pure operationId renames with identical path/query/body shapes. - Lockfile is consistent with the
0.180.0→0.253.0bump.
Minor: stale references to old SDK names in comments (non-blocking)
Three doc/comment strings still reference the pre-rename names:
src/lib/sentry-client.ts:713— JSDoc example useslistYourOrganizations(...)(nowlistOrganizations)test/commands/project/list.test.ts:688— commentgetProject (SDK retrieveAProject)(nowgetProject)test/lib/api-client.coverage.test.ts:1912— comment// resolveAnEventId(nowresolveOrganizationEventId)
Worth updating for grep-ability, but these don't affect correctness.
Note: I couldn't run tsc/tests locally — the generate:sdk prestep fails in my sandbox on an unrelated Node/tsx require-shim ESM hook incompatibility (with { type: "file" } import attributes), which happens before compilation. Trusting the PR's reported green CI for the type/test gate.
Three doc/comment strings still referenced the pre-rename SDK names left over from the operationId migration: - src/lib/sentry-client.ts: JSDoc example used listYourOrganizations - test/commands/project/list.test.ts: comment referenced retrieveAProject - test/lib/api-client.coverage.test.ts: comment referenced resolveAnEventId Comment-only changes for grep-ability; no behavior change. Co-Authored-By: Aditya Mathur <aditya.mathur@sentry.io>
|
Pushed 63d3eff fixing the three stale SDK-name comments I flagged ( |
Codecov Results 📊❌ Patch coverage is 77.78%. Project has 5325 uncovered lines. Files with missing lines (4)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 81.80% 81.81% +0.01%
==========================================
Files 423 423 —
Lines 29282 29282 —
Branches 19051 19051 —
==========================================
+ Hits 23953 23957 +4
- Misses 5329 5325 -4
- Partials 1983 1981 -2Generated by Codecov Action |
Follow-up to the @sentry/api bump (#1194): a bounded testbed that uses the SDK as intended for the projects domain and establishes the overlay convention the remaining domains will follow. - Convert createProjectWithAutoTeam from a raw apiRequestToRegion POST to the SDK createOrganizationProject function; keep team_slug as a documented typed overlay (returned by the API but absent from the OpenAPI spec). - Collapse getProject's double-cast to a single localized `query as never` cast for the undocumented collapse=organization param. - Annotate findProjectByDsnKey's internal ?query=dsn: filter as an intentional escape hatch and backend @extend_schema candidate. - Codify the overlay convention on SentryProject: the SDK type carries every documented field; overlays add only undocumented-but-returned fields. No behavior change. tsc clean, biome clean, project/team/api-client tests pass. Co-Authored-By: Claude <noreply@anthropic.com>
## What A small, bounded **testbed** for the CLI type-cleanup effort — the follow-up to the `@sentry/api` bump (#1194, which renamed call sites but reduced no code). This slice uses the SDK *as intended* for the **projects** domain and establishes the overlay convention the remaining domains will follow. It intentionally does **not** touch all the types. Projects was chosen because it exercises every realistic case in one cohesive, low-blast-radius slice (all imports flow through the `types/index.ts` barrel): clean SDK adoption, an undocumented-field overlay, the `?collapse` response variant, and a genuine escape hatch. ## Changes - **Convert `createProjectWithAutoTeam`** from a raw `apiRequestToRegion` POST to the SDK **`createOrganizationProject`** function (same `getOrgSdkConfig` + `unwrapResult` pattern as the rest of the file). `team_slug` (returned by the API but absent from the OpenAPI spec) is kept as a documented typed overlay. - **Simplify `getProject`**: collapse the whole-argument + result double-cast to a single localized `query: { collapse: 'organization' } as never`. The `collapse` param is server-supported but not in the spec; the trimmed `organization` payload is modeled by the `SentryProject.organization` overlay. - **Annotate `findProjectByDsnKey`**: its internal `?query=dsn:` filter is not in the public API, so it stays a raw call — now clearly documented as an intentional escape hatch and a backend `@extend_schema` promotion candidate (rather than a silent cast). - **Codify the overlay convention** on `SentryProject`: the SDK type carries every *documented* field; an overlay adds **only** fields the API returns but the spec omits (`organization`, `status`, `team_slug`), each a backend `@extend_schema` candidate. ## Why not remove more types Full removal is blocked by four things, none of them CLI-side: loosely-typed endpoints (SDK type thinner than hand-written), undocumented-but-returned fields, `expand`/`collapse` response variants, and private endpoints. These are captured as a backend unlock worklist and are out of scope here. ## Test plan - `tsc --noEmit`: clean - `biome check`: clean - Unit tests: api/types/commands (2738) + api-client coverage / create-sentry-project / project-create (151) — all green. `createProjectWithAutoTeam` coverage asserts the POST target + `team_slug` return, unchanged. - **Live** (branch source, org `bete-dev`): `project view` returns the project with both the `status` and `organization` overlays intact — behavior unchanged. No behavior change. Co-authored-by: Claude <noreply@anthropic.com>
What
Bumps
@sentry/api^0.180.0→^0.253.0and migrates every SDK call site from the old normalizer-derived names to the clean tokenoperationIds produced by the operationId migration.Examples of the rename (34 symbols across 12 files):
retrieveAnOrganization→getOrganizationlistAnOrganization_sIssues→listOrganizationIssuesqueryExploreEventsInTableFormat→listOrganizationEventsretrieveAnOrganization_sRelease→getOrganizationReleasecreateANewProject→createTeamProject,listAProject_sClientKeys→listProjectKeys, etc.Aliasing for name collisions
A few new tokens (
getOrganization,getProject,deleteProject,listProjectEnvironments,listProjectTeams) collide with the CLI's own wrapper functions of the same name — the old verbose names never did. Those SDK imports are aliased (getOrganization as sdkGetOrganization, …), following thesdk*aliasing convention already used elsewhere in the codebase.Notes
generate:sdkis unaffected (it generates the CLI's own command SDK, not from@sentry/api).Test plan
tsc --noEmit: clean