You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(dashboard): Align revision schema with actual API response (#1000)
The `DashboardRevisionSchema` didn't match the actual Sentry API
response from `DashboardRevisionSerializer`, causing Zod validation
failures when running `sentry dashboard revisions`.
**Root cause:** The schema expected `{ id: number, version: number,
dashboardId: number }` but the API returns `{ id: string, title: string,
createdBy: object | null, source: string }`. The `version` and
`dashboardId` fields don't exist in the API response at all.
**Changes:**
- `src/types/dashboard.ts` — Rebuilt `DashboardRevisionSchema` to match
the actual serializer response: string `id`, `title`, nullable
`createdBy` (with nested user fields), and `source`
- `src/lib/api/dashboards.ts` — Changed `restoreDashboardRevision()` to
accept string revision IDs (with `encodeURIComponent`)
- `src/commands/dashboard/restore.ts` — `--revision` flag now accepts
string IDs instead of requiring positive integers
- `src/commands/dashboard/revisions.ts` — Replaced `VERSION` column with
`TITLE` and `AUTHOR` columns; fixed restore hint to include `--revision`
flag
- Tests updated to use the actual API response shape
**Verified:** All 20 dashboard revision/restore tests pass. 6
pre-existing failures in widget tests are unrelated (`importOriginal`
Bun/vitest compat issue).
Fixes#935
Action taken on behalf of Sergiy Dybskiy.
---
[View Session in
Sentry](https://sentry.sentry.io/traces/?project=4510944073809921&query=gen_ai.conversation.id%3A%22slack%3AC010884QHLG%3A1778261528.548639%22)
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Sergiy Dybskiy <sergiy.dybskiy@sentry.io>
Co-authored-by: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com>
0 commit comments