Skip to content

feat(dashboards): Adds validation completion hook to generate dashboards endpoint#110903

Merged
edwardgou-sentry merged 7 commits intomasterfrom
egou/feat/generate-dashboard-completion-hook
Mar 18, 2026
Merged

feat(dashboards): Adds validation completion hook to generate dashboards endpoint#110903
edwardgou-sentry merged 7 commits intomasterfrom
egou/feat/generate-dashboard-completion-hook

Conversation

@edwardgou-sentry
Copy link
Contributor

@edwardgou-sentry edwardgou-sentry commented Mar 17, 2026

Right now, the validators on the dashboard artifacts are not actually used (they're run in post, but we don't use the validation result).

Adds a completion hook to OrganizationDashboardGenerateEndpoint. Whenever a seer run for generating a dashboard is complete, checks the result dashboard artifact for any validation errors detected. If errors are detected, re request dashboard generation.

This dashboard generation re request only happens up to 3 times (determined by MAX_VALIDATION_RETRIES) on consecutive failures.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 17, 2026
@github-actions
Copy link
Contributor

Backend Test Failures

Failures on ca81cdb in this run:

tests/sentry/dashboards/endpoints/test_organization_dashboard_generate.py::OrganizationDashboardGenerateEndpointTest::test_post_starts_run_and_returns_run_idlog
tests/sentry/dashboards/endpoints/test_organization_dashboard_generate.py:44: in test_post_starts_run_and_returns_run_id
    mock_client_class.assert_called_once_with(self.organization, ANY)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/unittest/mock.py:989: in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/unittest/mock.py:977: in assert_called_with
    raise AssertionError(_error_message()) from cause
E   AssertionError: expected call not found.
E   Expected: SeerExplorerClient(<Organization at 0x7f98ed60b390: id=4557809478926336, owner_id=None, name='baz', slug='baz'>, <ANY>)
E     Actual: SeerExplorerClient(<Organization at 0x7f98ed0cdb30: id=4557809478926336, owner_id=None, name='baz', slug='baz'>, <SimpleLazyObject: RpcUser(id=8, pk=8, name='', email='admin@localhost', username='admin@localhost', actor_id=None, display_name='admin@localhost', label='admin@localhost', is_superuser=True, is_authenticated=True, is_anonymous=False, is_active=True, is_staff=True, is_unclaimed=False, last_active=datetime.datetime(2026, 3, 17, 19, 18, 10, 505388, tzinfo=datetime.timezone.utc), is_sentry_app=False, password_usable=True, is_password_expired=False, roles=frozenset(), permissions=frozenset(), avatar=None, emails=frozenset({'admin@localhost'}), useremails=[RpcUserEmail(id=8, email='admin@localhost', is_verified=True)], authenticators=[])>, on_completion_hook=<class 'sentry.dashboards.on_completion_hook.DashboardOnCompletionHook'>)

@edwardgou-sentry edwardgou-sentry marked this pull request as ready for review March 17, 2026 20:42
@edwardgou-sentry edwardgou-sentry requested a review from a team as a code owner March 17, 2026 20:42
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@edwardgou-sentry edwardgou-sentry merged commit f7d2a37 into master Mar 18, 2026
59 checks passed
@edwardgou-sentry edwardgou-sentry deleted the egou/feat/generate-dashboard-completion-hook branch March 18, 2026 14:30
JonasBa pushed a commit that referenced this pull request Mar 18, 2026
…rds endpoint (#110903)

Right now, the validators on the dashboard artifacts are not actually
used (they're run in post, but we don't use the validation result).

Adds a completion hook to `OrganizationDashboardGenerateEndpoint`.
Whenever a seer run for generating a dashboard is complete, checks the
result dashboard artifact for any validation errors detected. If errors
are detected, re request dashboard generation.

This dashboard generation re request only happens up to 3 times
(determined by `MAX_VALIDATION_RETRIES`) on consecutive failures.
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