From 416654e7b61cb33c177790fcd5b31e2e84ff76d9 Mon Sep 17 00:00:00 2001 From: Richard Roggenkemper <46740234+roggenkemper@users.noreply.github.com> Date: Mon, 6 Apr 2026 10:02:51 -0400 Subject: [PATCH 1/2] chore(code-mappings): Move code mapping CODEOWNERS to coding-workflows (#111939) Move code mapping related paths from @getsentry/issue-detection-backend to @getsentry/coding-workflows-sentry-backend since code mappings fall under coding workflows, not issue detection. --- .github/CODEOWNERS | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 408881367d3a1e..914e8088f3e55e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -462,11 +462,11 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get /src/sentry/identity/ @getsentry/enterprise /src/sentry/integrations/ @getsentry/product-owners-settings-integrations @getsentry/ecosystem -/src/sentry/integrations/api/endpoints/organization_code_mapping*.py @getsentry/issue-detection-backend +/src/sentry/integrations/api/endpoints/organization_code_mapping*.py @getsentry/coding-workflows-sentry-backend /src/sentry/integrations/api/endpoints/organization_coding_agents.py @getsentry/machine-learning-ai /src/sentry/integrations/coding_agent/ @getsentry/machine-learning-ai /src/sentry/integrations/utils/codecov.py @getsentry/codecov -/src/sentry/integrations/utils/stacktrace_link.py @getsentry/issue-detection-backend +/src/sentry/integrations/utils/stacktrace_link.py @getsentry/coding-workflows-sentry-backend /src/sentry/mail/ @getsentry/alerts-notifications /src/sentry/notifications/ @getsentry/alerts-notifications @getsentry/ecosystem @@ -651,7 +651,7 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get /src/sentry/event_manager.py @getsentry/issue-detection-backend /src/sentry/eventstore/models.py @getsentry/issue-detection-backend /src/sentry/grouping/ @getsentry/issue-detection-backend -/src/sentry/issues/auto_source_code_config/ @getsentry/issue-detection-backend +/src/sentry/issues/auto_source_code_config/ @getsentry/coding-workflows-sentry-backend /src/sentry/issues/endpoints/related_issues.py @getsentry/issue-detection-backend /src/sentry/issues/ingest.py @getsentry/issue-detection-backend /src/sentry/issues/issue_occurrence.py @getsentry/issue-detection-backend @@ -671,16 +671,16 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get /src/sentry/tasks/auto_ongoing_issues.py @getsentry/issue-detection-backend /src/sentry/tasks/auto_remove_inbox.py @getsentry/issue-detection-backend /src/sentry/tasks/auto_resolve_issues.py @getsentry/issue-detection-backend -/src/sentry/tasks/auto_source_code_config.py @getsentry/issue-detection-backend +/src/sentry/tasks/auto_source_code_config.py @getsentry/coding-workflows-sentry-backend /src/sentry/tasks/check_new_issue_threshold_met.py @getsentry/issue-detection-backend /src/sentry/tasks/clear_expired_resolutions.py @getsentry/issue-detection-backend /src/sentry/tasks/clear_expired_rulesnoozes.py @getsentry/issue-detection-backend /src/sentry/tasks/clear_expired_snoozes.py @getsentry/issue-detection-backend -/src/sentry/tasks/codeowners/ @getsentry/issue-detection-backend -/src/sentry/tasks/commit_context.py @getsentry/issue-detection-backend +/src/sentry/tasks/codeowners/ @getsentry/coding-workflows-sentry-backend +/src/sentry/tasks/commit_context.py @getsentry/coding-workflows-sentry-backend /src/sentry/tasks/seer/delete_seer_grouping_records.py @getsentry/issue-detection-backend /src/sentry/tasks/embeddings_grouping/ @getsentry/issue-detection-backend -/src/sentry/tasks/groupowner.py @getsentry/issue-detection-backend +/src/sentry/tasks/groupowner.py @getsentry/coding-workflows-sentry-backend /src/sentry/tasks/merge.py @getsentry/issue-detection-backend /src/sentry/tasks/unmerge.py @getsentry/issue-detection-backend /src/sentry/tasks/weekly_escalating_forecast.py @getsentry/issue-detection-backend @@ -703,7 +703,7 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get /tests/sentry/deletions/test_group.py @getsentry/issue-detection-backend /tests/sentry/event_manager/ @getsentry/issue-detection-backend /tests/sentry/grouping/ @getsentry/issue-detection-backend -/tests/sentry/issues/auto_source_code_config/ @getsentry/issue-detection-backend +/tests/sentry/issues/auto_source_code_config/ @getsentry/coding-workflows-sentry-backend /tests/sentry/issues/endpoints/ @getsentry/issue-workflow /tests/sentry/issues/endpoints/test_related_issues.py @getsentry/issue-detection-backend /tests/sentry/issues/test_ingest.py @getsentry/issue-detection-backend @@ -726,9 +726,9 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get /tests/sentry/tasks/test_clear_expired_resolutions.py @getsentry/issue-detection-backend /tests/sentry/tasks/test_clear_expired_rulesnoozes.py @getsentry/issue-detection-backend /tests/sentry/tasks/test_clear_expired_snoozes.py @getsentry/issue-detection-backend -/tests/sentry/tasks/test_code_owners.py @getsentry/issue-detection-backend -/tests/sentry/tasks/test_commit_context.py @getsentry/issue-detection-backend -/tests/sentry/tasks/test_groupowner.py @getsentry/issue-detection-backend +/tests/sentry/tasks/test_code_owners.py @getsentry/coding-workflows-sentry-backend +/tests/sentry/tasks/test_commit_context.py @getsentry/coding-workflows-sentry-backend +/tests/sentry/tasks/test_groupowner.py @getsentry/coding-workflows-sentry-backend /tests/sentry/tasks/test_merge.py @getsentry/issue-detection-backend /tests/sentry/tasks/test_post_process.py @getsentry/issue-detection-backend /tests/sentry/tasks/test_weekly_escalating_forecast.py @getsentry/issue-detection-backend From 3a2050ca6bcdefd8c82a201307a711a86bcd550c Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 6 Apr 2026 08:32:37 -0700 Subject: [PATCH 2/2] feat(cmdk): Add admin actions group for staff users (#112244) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a new 'Admin' group to the command palette, visible only to Sentry staff (`user.isStaff`). The group appears after the 'Go to...' section and contains: - **Open _admin** — opens `/_admin/` in a new tab - **Open `` in _admin** — opens the org's admin page in a new tab - **Exit Superuser** — only shown when a superuser session is active (`isActiveSuperuser()`); calls `DELETE /auth/superuser/` via `useMutation` and reloads the page Co-authored-by: Claude Sonnet 4 --- .../useGlobalCommandPaletteActions.tsx | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/static/app/components/commandPalette/useGlobalCommandPaletteActions.tsx b/static/app/components/commandPalette/useGlobalCommandPaletteActions.tsx index ac5d3a5406334a..838375531c0ca5 100644 --- a/static/app/components/commandPalette/useGlobalCommandPaletteActions.tsx +++ b/static/app/components/commandPalette/useGlobalCommandPaletteActions.tsx @@ -37,10 +37,12 @@ import { } from 'sentry/icons'; import {t} from 'sentry/locale'; import {apiOptions} from 'sentry/utils/api/apiOptions'; -import {queryOptions} from 'sentry/utils/queryClient'; +import {isActiveSuperuser} from 'sentry/utils/isActiveSuperuser'; +import {QUERY_API_CLIENT, queryOptions, useMutation} from 'sentry/utils/queryClient'; import {useMutateUserOptions} from 'sentry/utils/useMutateUserOptions'; import {useOrganization} from 'sentry/utils/useOrganization'; import {useProjects} from 'sentry/utils/useProjects'; +import {useUser} from 'sentry/utils/useUser'; import {useGetStarredDashboards} from 'sentry/views/dashboards/hooks/useGetStarredDashboards'; import {AGENTS_LANDING_SUB_PATH} from 'sentry/views/insights/pages/agents/settings'; import {BACKEND_LANDING_SUB_PATH} from 'sentry/views/insights/pages/backend/settings'; @@ -320,6 +322,12 @@ function useNavigationToggleCollapsed(): CommandPaletteAction { */ export function useGlobalCommandPaletteActions() { const organization = useOrganization(); + const user = useUser(); + const {mutate: exitSuperuser} = useMutation({ + mutationFn: () => + QUERY_API_CLIENT.requestPromise('/auth/superuser/', {method: 'DELETE'}), + onSuccess: () => window.location.reload(), + }); const hasDsnLookup = organization.features.includes('cmd-k-dsn-lookup'); const {projects} = useProjects(); const navigateActions = useNavigationActions(); @@ -330,8 +338,51 @@ export function useGlobalCommandPaletteActions() { const navPrefix = `/organizations/${organization.slug}`; + const adminActions: CommandPaletteAction[] = user.isStaff + ? [ + { + display: { + label: t('Admin'), + }, + actions: [ + { + display: { + label: t('Open _admin'), + icon: , + }, + onAction: () => window.open('/_admin/', '_blank', 'noreferrer'), + }, + { + display: { + label: t('Open %s in _admin', organization.name), + icon: , + }, + onAction: () => + window.open( + `/_admin/organizations/${organization.slug}/`, + '_blank', + 'noreferrer' + ), + }, + ...(isActiveSuperuser() + ? [ + { + display: { + label: t('Exit Superuser'), + icon: , + }, + onAction: () => exitSuperuser(), + }, + ] + : []), + ], + }, + ] + : []; + useCommandPaletteActionsRegister([ ...navigateActions, + ...adminActions, // BEGIN ADD ACTIONS { display: {