Skip to content

chore(deps): bump @sentry/api to 0.253.0 and adopt token operationIds - #1194

Merged
betegon merged 2 commits into
mainfrom
chore/bump-sentry-api-tokens
Jul 6, 2026
Merged

betegon merged 2 commits into
mainfrom
chore/bump-sentry-api-tokens

Conversation

@betegon

@betegon betegon commented Jul 3, 2026

Copy link
Copy Markdown
Member

What

Bumps @sentry/api ^0.180.0 → ^0.253.0 and migrates every SDK call site from the old normalizer-derived names to the clean token operationIds produced by the operationId migration.

Examples of the rename (34 symbols across 12 files):

  • retrieveAnOrganization → getOrganization
  • listAnOrganization_sIssues → listOrganizationIssues
  • queryExploreEventsInTableFormat → listOrganizationEvents
  • retrieveAnOrganization_sRelease → getOrganizationRelease
  • createANewProject → 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 the sdk* aliasing convention already used elsewhere in the codebase.

Notes

  • No behavior change — pure rename + version bump. The response/param shapes the CLI uses are unchanged across 0.180→0.253 (the earlier 0.180 bump already handled downstream type/shape adaptations).
  • generate:sdk is unaffected (it generates the CLI's own command SDK, not from @sentry/api).

Test plan

  • tsc --noEmit: clean
  • unit tests: API-lib (223), types + commands (2250) — all green

@github-actions

github-actions Bot commented Jul 3, 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-1194/

Built to branch gh-pages at 2026-07-06 13:31 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.
@betegon
betegon force-pushed the chore/bump-sentry-api-tokens branch from bbbfeec to dab1ca7 Compare July 6, 2026 10:22
@betegon
betegon marked this pull request as ready for review July 6, 2026 10:26
@betegon
betegon requested a review from MathurAditya724 July 6, 2026 10:26

@MathurAditya724 MathurAditya724 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.), the zGetOrganizationIssueResponse zod export, and the GetOrganizationIssueResponse / ListOrganizationIssuesData / GetProjectData type 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 imported as sdk* and the wrapper calls the aliased SDK fn — no accidental self-recursion. Matches the existing sdk* convention.
  • No behavior change. createANewProject → createTeamProject is still the team-scoped endpoint (path.team_id_or_slug unchanged); the rest are pure operationId renames with identical path/query/body shapes.
  • Lockfile is consistent with the 0.180.0 → 0.253.0 bump.

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 uses listYourOrganizations(...) (now listOrganizations)
  • test/commands/project/list.test.ts:688 — comment getProject (SDK retrieveAProject) (now getProject)
  • test/lib/api-client.coverage.test.ts:1912 — comment // resolveAnEventId (now resolveOrganizationEventId)

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>
@MathurAditya724

Copy link
Copy Markdown
Member

Pushed 63d3eff fixing the three stale SDK-name comments I flagged (listYourOrganizations → listOrganizations, retrieveAProject → getProject, resolveAnEventId → resolveOrganizationEventId). Comment-only, no behavior change.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

❌ Patch coverage is 77.78%. Project has 5325 uncovered lines.
✅ Project coverage is 81.81%. Comparing base (base) to head (head).

Files with missing lines (4)
File Patch % Lines
src/lib/api/dashboards.ts 0.00% ⚠️ 4 Missing
src/lib/api/monitors.ts 0.00% ⚠️ 2 Missing
src/lib/api/projects.ts 83.33% ⚠️ 1 Missing
src/lib/api/releases.ts 87.50% ⚠️ 1 Missing
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        -2

Generated by Codecov Action

@betegon
betegon merged commit 66add76 into main Jul 6, 2026
31 checks passed
@betegon
betegon deleted the chore/bump-sentry-api-tokens branch July 6, 2026 14:11
jared-outpost Bot pushed a commit that referenced this pull request Aug 1, 2026
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>
jared-outpost Bot pushed a commit that referenced this pull request Aug 1, 2026
## 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>
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.

2 participants