Skip to content

ref(dashboards): Remove dashboards-revisions feature flag (backend) - #116969

Merged
skaasten merged 1 commit into
masterfrom
shaunkaasten/dain-1702-remove-dashboard-revisions-feature-flag
Jun 5, 2026
Merged

skaasten merged 1 commit into
masterfrom
shaunkaasten/dain-1702-remove-dashboard-revisions-feature-flag

Conversation

@skaasten

@skaasten skaasten commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Dashboard revisions is rolled out to 100%, so this removes the organizations:dashboards-revisions feature flag on the backend and makes revision tracking, history, preview, and restore always-on.

Changes

  • Drop the flag registration from features/temporary.py.
  • Remove the REVISIONS_FEATURE gate (the features.has(...) → 404 guard) from the revisions, revision-details, and revision-restore endpoints.
  • Always take a dashboard snapshot on edit in the details endpoint (previously gated by the flag).
  • Update tests to drop the with self.feature(...) context manager and remove the now-obsolete flag-disabled cases.

Notes

The frontend gate removal is in a separate PR since frontend and backend are not atomically deployed. Either order is deploy-safe because the flag is already at 100%.

DAIN-1702

Dashboard revisions is rolled out to 100%, so remove the
organizations:dashboards-revisions flag and make revision tracking,
history, preview, and restore always-on.

- Drop the flag registration from features/temporary.py
- Remove the REVISIONS_FEATURE gate from the revisions, revision
  details, and revision restore endpoints
- Always take a dashboard snapshot on edit in the details endpoint
- Update tests to drop the feature context manager and remove the
  now-obsolete flag-disabled cases

DAIN-1702
@skaasten
skaasten requested a review from a team as a code owner June 5, 2026 14:40
@linear-code

linear-code Bot commented Jun 5, 2026

Copy link
Copy Markdown

DAIN-1702

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 5, 2026
skaasten added a commit that referenced this pull request Jun 5, 2026
…116971)

Dashboard revisions is rolled out to 100%, so this removes the
`dashboards-revisions` gate on the frontend. The revisions button now
renders whenever the user has dashboard edit access.

## Changes
- Drop the `<Feature features="dashboards-revisions">` wrapper around
`DashboardRevisionsButton` in `controls.tsx`.
- Drop the flag from the `dashboardRevisions.spec.tsx` org fixture.

## Notes
The backend flag removal is in a **separate PR** (#116969) since
frontend and backend are not atomically deployed. Either order is
deploy-safe because the flag is already at 100%.

DAIN-1702
@skaasten
skaasten merged commit f77fa3f into master Jun 5, 2026
86 checks passed
@skaasten
skaasten deleted the shaunkaasten/dain-1702-remove-dashboard-revisions-feature-flag branch June 5, 2026 15:45
BYK pushed a commit that referenced this pull request Nov 7, 2026
Publishes the two dashboard revision endpoints the Sentry CLI calls, so
they reach the public OpenAPI schema and the generated `@sentry/api`
client. Refs #130351, where the endpoints were proposed for publishing.
In the Slack thread that led to it, revisions were confirmed to be "here
to stay".

| Operation | Endpoint | operationId |
| --- | --- | --- |
| `GET /organizations/{org}/dashboards/{dashboard_id}/revisions/` |
`OrganizationDashboardRevisionsEndpoint` |
`listOrganizationDashboardRevisions` |
| `POST
/organizations/{org}/dashboards/{dashboard_id}/revisions/{revision_id}/restore/`
| `OrganizationDashboardRevisionRestoreEndpoint` |
`restoreOrganizationDashboardRevision` |

**Why now:** the list endpoint landed in #113084 (2026-04-17) and
restore in #113176 (2026-04-21). Both have been GA since the
`dashboards-revisions` flag was removed in #116969 (2026-06-05). Neither
endpoint has a feature gate.

**What changed**
- `publish_status` goes from `PRIVATE` to `PUBLIC`. Both already had
`owner = ApiOwner.DASHBOARDS`, so the ownership allowlist doesn't
change.
- `DashboardRevisionResponse` now has field descriptions, and its
`createdBy` uses a new `DashboardRevisionCreatedByResponse` TypedDict
instead of an untyped `dict`. The new type matches the five keys the
serializer builds: `id`, `name`, `email`, `avatarType`, `avatarUrl`.
- The list is documented as paginated (`OffsetPaginator`, so `cursor` +
`per_page`), newest first, and capped at 10 kept revisions
(`DashboardRevision.RETENTION_LIMIT`).
- Restore returns the dashboard details response
(`DashboardDetailsModelSerializer`, the same type as GET/PUT on the
dashboard). It is documented with 400 (unsupported snapshot version or
validation errors), 403 (no edit access, via
`check_object_permissions`), 404, and 409 (title conflict).
- Restore sets `idempotent_methods = frozenset()`. Each call records a
new `pre-restore` revision and an audit log entry, so it isn't safe to
resend.
- Return annotations now use `Response[T]` arms, as flake8 S022 requires
for published methods. The restore validation error path now goes
through `as_validation_errors`, with no runtime change.
- `test_organization_agent_token.py` builds its permission matrix from
every public operation. It now creates a dashboard revision for the new
`revision_id` placeholder.

**Schema check:** I ran `make build-api-docs` and diffed
`openapi-derefed.json` against master. The only path changes are these
two added operations, plus the new `DashboardRevisionListResponse`
component. The "(Optional) Shows the difference between the prod and dev
schema" check is expected to fail on a schema-changing PR.

**Tests run locally**
- `make build-api-docs` and `pnpm run validate-api-examples`: pass
- `pytest tests/apidocs` plus the revisions, restore and dashboard
details endpoint tests: 364 passed
- `pytest tests/sentry/seer/endpoints/test_organization_agent_token.py`:
321 passed, 23 xfailed (the restore row needed the new placeholder)
- `prek run` and mypy (`--stage pre-push`) on the changed files: pass

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

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Aad6dcaf84a4dd09a1ae97e392f4bf088 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Aad6dcaf84a4dd09a1ae97e392f4bf088)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Aad6dcaf84a4dd09a1ae97e392f4bf088/?project=4510944073809921)

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

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
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