Skip to content

feat(dashboards): Describe saved widget transformations - #2114

Draft
sentry-junior[bot] wants to merge 2 commits into
mainfrom
nickdeschenes/exp-1417-climcp-describe-saved-dashboard
Draft

sentry-junior[bot] wants to merge 2 commits into
mainfrom
nickdeschenes/exp-1417-climcp-describe-saved-dashboard

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Dashboard inspection in the CLI and MCP now shows each widget query's saved transformations by aggregate position, in the order Sentry applies them. Duplicate aggregates stay separate entries, and widgets without saved transformations keep their current output. This only inspects configuration. Live execution is #2110 (EXP-1410).

A shared helper in @sentry/toolkit-core/dashboard-transformations builds the entries for both products. It sorts positions numerically, keeps the transformation strings exactly as saved, keeps empty lists and positions that no longer match an aggregate, and writes a description such as count() (aggregate 2): smooth(asap,7) → fill(zero).

  • MCP get_dashboard_details: each query gets transformations: [{ aggregateIndex, aggregate, transformations, description }]. The field is left out when nothing is saved ({}), so current responses don't change. It is null when the server's response has no transformations field (servers from before EXP-1299).
  • CLI dashboard view: adds a "Saved transformations" section under the grid, grouped by widget and query.
  • CLI dashboard widget edit: lists the saved transformations. It also fixes a gap: the command used to report the request widget, which leaves out transformations so Sentry keeps them. Now it reports the saved widget from the PUT response, so --json includes them too.
  • CLI JSON keeps the raw transformations map, which is keyed by aggregate position. Its schema field now has a description.

I checked the contract against getsentry/sentry. DashboardWidgetQuerySerializer (in api/serializers/models/dashboard.py) always returns obj.transformations or {}. The write serializer only accepts canonical numeric indexes and checks organizations:explore-interpolation-and-smoothing on write.

Open question (feature-disabled): the GET serializer doesn't check the feature flag. So an org with the feature off still gets its saved transformations back, and inspection shows them as saved. This PR doesn't fetch org features to label that case. If we want an explicit "saved but feature disabled" marker, that means an extra org lookup. Happy to add it if reviewers think it's worth it.

Regression coverage uses the existing GET/PUT persistence mock (widget/preservation.test.ts), MCP handler tests against the dashboard fixture, and unit tests for the shared helper.

Refs EXP-1417

via Nick.

--

View Session [Sentry]

List each widget query's saved transformations by aggregate position in
the CLI and MCP dashboard inspection output. Duplicate aggregates stay
separate, and widgets without saved transformations keep their output.

- MCP get_dashboard_details returns per-aggregate entries with the
  verbatim ordered transformations and a description. The field is
  omitted when none are saved and null when the server does not report
  transformations.
- CLI dashboard view and dashboard widget edit describe the saved
  transformations. widget edit now reports the saved widget from Sentry's
  response, so its JSON keeps the transformations the request omits.

Refs EXP-1417

Co-Authored-By: Nicholas Deschenes <nicholas.deschenes@sentry.io>
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 9, 2026 6:12pm UTC

Request Review

@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

EXP-1417

@BYK BYK 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.

LGTM

Report unavailable settings when a server omits transformations. Show
explicitly saved empty transformation lists as none, and use transformation
terminology consistently in docs and tests.

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>

This branch was successfully deployed

1 active (outdated) and 1 inactive deployments
Preview — 0052c100 Deployed Nov 9, 2026 by vercel[bot]
Actions — 0794eb6e Deployed Nov 9, 2026 by sentry-junior[bot] via eval #1745
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