Skip to content

ref(dashboards): Update generate dashboard endpoint permission check#111803

Merged
edwardgou-sentry merged 4 commits into
masterfrom
egou/ref/generate-dashboard-endpoint-permission
Mar 30, 2026
Merged

ref(dashboards): Update generate dashboard endpoint permission check#111803
edwardgou-sentry merged 4 commits into
masterfrom
egou/ref/generate-dashboard-endpoint-permission

Conversation

@edwardgou-sentry
Copy link
Copy Markdown
Contributor

Update permission check to look for gen-ai-features, instead of using has_seer_explorer_access_with_detail which checks for seer-explorer flags.

@edwardgou-sentry edwardgou-sentry requested a review from a team as a code owner March 30, 2026 17:54
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 30, 2026
Copy link
Copy Markdown
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.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Test patches nonexistent function after rename
    • Updated the @patch decorator in test_post_without_seer_access_returns_403 to use the renamed function has_seer_access_with_detail instead of the old name has_seer_explorer_access_with_detail.

Create PR

Or push these changes by commenting:

@cursor push 8969617cd9
Preview (8969617cd9)
diff --git a/tests/sentry/dashboards/endpoints/test_organization_dashboard_generate.py b/tests/sentry/dashboards/endpoints/test_organization_dashboard_generate.py
--- a/tests/sentry/dashboards/endpoints/test_organization_dashboard_generate.py
+++ b/tests/sentry/dashboards/endpoints/test_organization_dashboard_generate.py
@@ -64,7 +64,7 @@
         assert response.status_code == 403
 
     @patch(
-        "sentry.dashboards.endpoints.organization_dashboard_generate.has_seer_explorer_access_with_detail"
+        "sentry.dashboards.endpoints.organization_dashboard_generate.has_seer_access_with_detail"
     )
     def test_post_without_seer_access_returns_403(self, mock_has_access: MagicMock) -> None:
         mock_has_access.return_value = (False, "AI features are disabled for this organization.")

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread src/sentry/dashboards/endpoints/organization_dashboard_generate.py
Copy link
Copy Markdown
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 2c28de8 into master Mar 30, 2026
64 of 65 checks passed
@edwardgou-sentry edwardgou-sentry deleted the egou/ref/generate-dashboard-endpoint-permission branch March 30, 2026 18:32
NicoHinderling added a commit that referenced this pull request Apr 1, 2026
…t response (#111976)

Adds the ability for users to approve snapshot comparison results via a
new API endpoint, and surfaces approval status in the snapshot details
response.

**Approve endpoint** (`POST /preprodartifacts/{id}/approve/`):
- Accepts a `feature_type` (`snapshots` or `size`) and creates an
`APPROVED` record for the requesting user
- Cleans up any existing `NEEDS_APPROVAL` records for that
artifact/feature
- Re-triggers the relevant status check task so the VCS commit status
updates immediately

**Snapshot response changes**:
- Adds `approval_info` to the snapshot details response containing the
current approval status (`approved` or `requires_approval`) and a list
of approvers
- Supports both Sentry users and GitHub users (via `extras` on the
approval record) with avatar URLs

Stacked on #111803
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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