Skip to content

fix(replays): Withhold internal field choices from the public replay schema - #128639

Merged
BYK merged 1 commit into
masterfrom
fix/replays-withhold-internal-field-choices
Oct 23, 2026
Merged

BYK merged 1 commit into
masterfrom
fix/replays-withhold-internal-field-choices

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

ReplayDetailsResponse already leaves info_ids and warning_ids out of the public response schema ("Internal breadcrumb index used by the replay UI"). But ReplayValidator still offered both in the public field enum on the replay index and details endpoints. As a result, @sentry/api (generated via getsentry/sentry-api-schema) lists two field values the documented ListReplays response never contains.

This hides those two choices from the public schema using the same field.choice form as ReplayCountQueryParamsValidator. The runtime validator is unchanged, so the replay UI can still request them.

This is needed by the Sentry CLI in getsentry/toolkit, which wants to build its replay field list from @sentry/api instead of maintaining its own copy.

Not run locally: I don't have a Sentry dev environment here. The api-docs CI build runs the omission guard, which checks this change.

via BYK.

--

View Junior Session [Sentry]

…schema

ReplayDetailsResponse already omits info_ids and warning_ids from the public
response schema, but ReplayValidator still listed them in the public `field`
enum. Generated clients (@sentry/api) therefore advertised two fields that the
documented response never contains.

Withhold the two choices from the public schema too. They are still accepted
at runtime, so the replay UI is unaffected.

Co-Authored-By: Burak Yigit Kaya <burak.kaya@sentry.io>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 23, 2026 11:23
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

decision-model-linter

api

src/sentry/replays/validators.py

  • warn addsNewOmittedFields = TRUE (0.98): This withholds a field from the public API schema and every generated SDK, though clients can still use it. Withhold a field only if it must never be public, and make its reason say why. To fix a missing description, add help_text to the field instead.

decision-model-linter: 1 call on 1 file, 672 input tokens, $0.000028, model typesafe/jev-1.13-20260917

BYK added a commit to getsentry/toolkit that referenced this pull request Oct 23, 2026
…1617)

This is a follow-up to #1605. `sentry explore --dataset replays` checked
`--field` against a hand-written resolver table, plus a `switch` that
mapped each nested field to its API root. Every new replay field meant
another CLI change.

The field list now comes from `@sentry/api/valibot`:
- **API fields:** every dotted path in a `vListReplays` row whose root
appears in the `field=` enum of `vListOrganizationReplaysData`.
- **Request root:** the first segment of the path.
- **Value:** read from the replay row by path.

The CLI keeps only its own aliases and convenience columns: `url`,
`release`, `user`/`user.display`, `count_traces`, `screens`,
`seen_by_me`, and similar.

**Behavior changes**
- No longer accepted, because the published schema doesn't offer them:
- `device.model_id` was never in the response, so it always resolved to
empty.
- `info_id(s)` and `warning_id(s)` are withheld from the public response
as internal UI fields.
- Newly accepted: `user.display_name`, `clicks`, `segment_names`,
`tags`.
- `ota_updates.*` and `replay_type` become available once `@sentry/api`
moves past 0.356, where the index started accepting them. At that point,
flip the `replay_type` assertion in `test/lib/replay-search.test.ts` and
`test/commands/explore.test.ts`.

**Related:** getsentry/sentry#128639 removes `info_ids`/`warning_ids`
from the public `field` enum, so request and response agree. This PR
doesn't depend on it, because response paths are already filtered by the
enum.

**Checks**
- Pass: `pnpm run typecheck` and `pnpm run lint`.
- Pass: `vitest run` for `test/lib/replay-search.test.ts`,
`test/commands/explore.test.ts`, and `test/commands/replay`.
- The full `test/lib` + `test/commands` run had 7 failures in permission
and daemon tests unrelated to replays. The sandbox doesn't enforce
`chmod`, so those tests can't pass there.

<!-- junior-request-attribution:start -->
via **BYK**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC010884QHLG%3A1792754298.933159 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC010884QHLG%3A1792754298.933159)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC010884QHLG%3A1792754298.933159/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Burak Yigit Kaya <burak.kaya@sentry.io>
@BYK
BYK merged commit ff8e350 into master Oct 23, 2026
68 of 69 checks passed
@BYK
BYK deleted the fix/replays-withhold-internal-field-choices branch October 23, 2026 22:12
BYK added a commit to getsentry/toolkit that referenced this pull request Oct 23, 2026
Upgrades the CLI's `@sentry/api` dependency from `^0.399.0` (#1643) to
`^0.400.0`, the first release with getsentry/sentry#128639. That change
withholds `info_ids` and `warning_ids` from the public replay `field`
enum. The 0.400.0 types differ from 0.399.0 only in that enum, on the
replay index and details endpoints.

The lockfile change only covers `@sentry/api`. `pnpm-workspace.yaml`
moves the `minimumReleaseAgeExclude` entry to 0.400.0, because it was
published today.

Since #1617, replay explore builds its fields from the schema. New
assertions in `test/lib/replay-search.test.ts` check that:
- `replay_type` and `ota_updates.channel` are supported.
- `info_ids` and `warning_ids` are neither supported fields nor
requestable roots.

Verification: typecheck and lint pass, and a frozen-lockfile install
passes. The replay, explore, and issue-app-links tests pass (149 tests).
I didn't rerun the full suite, because the schema change is limited to
that enum.

<!-- junior-request-attribution:start -->
via **BYK**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC010884QHLG%3A1792754298.933159 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC010884QHLG%3A1792754298.933159)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC010884QHLG%3A1792754298.933159/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <burak.kaya@sentry.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants