From 017425aa8663033bf1c83173c0ff85ed80a8e553 Mon Sep 17 00:00:00 2001 From: Colleen O'Rourke Date: Fri, 31 Jul 2026 13:22:06 -0700 Subject: [PATCH] Remove workflow-engine-ui flag from command palette, detector sidebar, and metric detector limit --- .../ui/commandPaletteGlobalActions.tsx | 171 ++++++++---------- .../sidebar/detectorSection.spec.tsx | 46 +---- .../issueDetails/sidebar/detectorSection.tsx | 51 +----- .../overrides/useMetricDetectorLimit.tsx | 24 +-- 4 files changed, 80 insertions(+), 212 deletions(-) diff --git a/static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx b/static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx index b48fa2b4e449..00f7b3f914cc 100644 --- a/static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx +++ b/static/app/components/commandPalette/ui/commandPaletteGlobalActions.tsx @@ -324,7 +324,6 @@ export function GlobalCommandPaletteActions() { const hasInsightsRollout = organization.features.includes( 'insights-to-dashboards-ui-rollout' ); - const hasWorkflowEngineUI = organization.features.includes('workflow-engine-ui'); const hasPrebuiltDashboards = organization.features.includes( 'dashboards-prebuilt-insights-dashboards' ); @@ -494,111 +493,89 @@ export function GlobalCommandPaletteActions() { - {/* Hide the entire Insights section only when both migrations are active. - During partial rollout, individual items are gated: domain links - (Frontend, Backend, etc.) by insights-to-dashboards-ui-rollout, - and Crons/Uptime by workflow-engine-ui. */} - {organization.features.includes('performance-view') && - !(hasInsightsRollout && hasWorkflowEngineUI) && ( - , - }} - limit={4} - > - {!hasInsightsRollout && ( - - )} - {!hasInsightsRollout && ( - - )} - {!hasInsightsRollout && ( - - )} - {!hasInsightsRollout && ( - - )} - {!hasInsightsRollout && ( - - )} - {!hasWorkflowEngineUI && ( - - )} - {organization.features.includes('uptime') && !hasWorkflowEngineUI && ( - - )} - {!hasInsightsRollout && ( - - )} - - )} - - {hasWorkflowEngineUI && ( - }} limit={4}> - - - - - - {organization.features.includes('uptime') && ( + {/* Hide the Insights section once the insights-to-dashboards migration + is active; Crons and Uptime now live under the Monitors section. */} + {organization.features.includes('performance-view') && !hasInsightsRollout && ( + , + }} + limit={4} + > + {!hasInsightsRollout && ( )} - {organization.features.includes('preprod-size-monitors-frontend') && ( + {!hasInsightsRollout && ( + )} + {!hasInsightsRollout && ( + + )} + {!hasInsightsRollout && ( + + )} + {!hasInsightsRollout && ( + + )} + {!hasInsightsRollout && ( + )} - )} + }} limit={4}> + + + + + + {organization.features.includes('uptime') && ( + + )} + {organization.features.includes('preprod-size-monitors-frontend') && ( + + )} + + + }} limit={4}> {visibleOrgSettingsNavItems.map(item => ( { const detectorId = '123'; - const organization = OrganizationFixture({features: ['workflow-engine-ui']}); + const organization = OrganizationFixture(); const project = ProjectFixture(); const issueDetailsContext = { sectionData: {}, @@ -185,48 +185,4 @@ describe('DetectorSection', () => { screen.getByText('This issue was created by an uptime monitoring alert rule.') ).toBeInTheDocument(); }); - - it('links to metric alert rule details when workflow engine UI is disabled', async () => { - const alertRuleId = 456; - const event = EventFixture({ - occurrence: { - evidenceData: { - detectorId, - }, - type: 8001, - }, - }); - const group = GroupFixture({ - issueCategory: IssueCategory.METRIC, - issueType: IssueType.METRIC_ISSUE, - }); - const orgWithOnlyMetricIssues = OrganizationFixture(); - const metricDetector = MetricDetectorFixture({ - id: detectorId, - alertRuleId, - }); - const detectorDetails = getDetectorDetails({ - event, - organization: orgWithOnlyMetricIssues, - project, - }); - - MockApiClient.addMockResponse({ - url: `/organizations/${orgWithOnlyMetricIssues.slug}/detectors/${detectorId}/`, - body: metricDetector, - }); - - render( - - - , - {organization: orgWithOnlyMetricIssues} - ); - - const link = await screen.findByRole('button', {name: 'View metric alert details'}); - expect(link).toHaveAttribute( - 'href', - `/organizations/${orgWithOnlyMetricIssues.slug}/issues/alerts/rules/details/${alertRuleId}/` - ); - }); }); diff --git a/static/app/views/issueDetails/sidebar/detectorSection.tsx b/static/app/views/issueDetails/sidebar/detectorSection.tsx index e039947b3a5c..b4fbec66efe6 100644 --- a/static/app/views/issueDetails/sidebar/detectorSection.tsx +++ b/static/app/views/issueDetails/sidebar/detectorSection.tsx @@ -2,18 +2,13 @@ import styled from '@emotion/styled'; import {LinkButton} from '@sentry/scraps/button'; -import {LoadingError} from 'sentry/components/loadingError'; import {t} from 'sentry/locale'; import type {Event} from 'sentry/types/event'; import type {Group} from 'sentry/types/group'; import type {Organization} from 'sentry/types/organization'; import type {Project} from 'sentry/types/project'; -import type {MetricDetector} from 'sentry/types/workflowEngine/detectors'; -import {defined} from 'sentry/utils/defined'; import {getConfigForIssueType} from 'sentry/utils/issueTypeConfig'; -import {useOrganization} from 'sentry/utils/useOrganization'; import {makeAlertsPathname} from 'sentry/views/alerts/pathnames'; -import {useDetectorQuery} from 'sentry/views/detectors/hooks'; import {makeMonitorDetailsPathname} from 'sentry/views/detectors/pathnames'; import {useIssueDetails} from 'sentry/views/issueDetails/context'; import type {DetectorDetails} from 'sentry/views/issueDetails/sidebar/detectorDetails'; @@ -100,19 +95,11 @@ export function getDetectorDetails({ export function DetectorSection({group, project}: {group: Group; project: Project}) { const issueConfig = getConfigForIssueType(group, project); - const organization = useOrganization(); const {detectorDetails} = useIssueDetails(); - const {detectorPath, description, detectorId, detectorType} = detectorDetails; + const {detectorPath, description} = detectorDetails; const detectorCtaText = issueConfig.detector.ctaText ?? t('View detector details'); const title = issueConfig.detector.title ?? t('Detector'); - const hasWorkflowEngineUi = organization.features.includes('workflow-engine-ui'); - const shouldUseMetricRuleLink = detectorType === 'metric_alert' && !hasWorkflowEngineUi; - - if (shouldUseMetricRuleLink) { - return ; - } - return ( ( - detectorId ?? '', - { - enabled: Boolean(detectorId), - } - ); - const metricRuleId = metricDetector?.alertRuleId - ? String(metricDetector.alertRuleId) - : null; - const metricRulePath = metricRuleId - ? makeAlertsPathname({ - path: `/rules/details/${metricRuleId}/`, - organization, - }) - : undefined; - - if (!defined(detectorId) || (!isLoading && !metricDetector?.alertRuleId)) { - return ; - } - - return ( - - ); -} - function DetectorSectionContent({ ctaText, description, diff --git a/static/gsApp/overrides/useMetricDetectorLimit.tsx b/static/gsApp/overrides/useMetricDetectorLimit.tsx index eff28069d93e..973062473386 100644 --- a/static/gsApp/overrides/useMetricDetectorLimit.tsx +++ b/static/gsApp/overrides/useMetricDetectorLimit.tsx @@ -1,6 +1,5 @@ import {useQuery} from '@tanstack/react-query'; -import {apiOptions} from 'sentry/utils/api/apiOptions'; import {useOrganization} from 'sentry/utils/useOrganization'; import {detectorListApiOptions} from 'sentry/views/detectors/hooks/index'; @@ -22,7 +21,6 @@ export function useMetricDetectorLimit(): MetricDetectorLimitResponse { const subscription = useSubscription(); const detectorLimit = subscription?.planDetails?.metricDetectorLimit ?? UNLIMITED_QUOTA; - const isWorkflowEngine = organization.features.includes('workflow-engine-ui'); const hasFlag = organization.features.includes('workflow-engine-metric-detector-limit'); const { @@ -34,28 +32,14 @@ export function useMetricDetectorLimit(): MetricDetectorLimitResponse { query: 'type:metric', limit: 1, }), - enabled: hasFlag && isWorkflowEngine && detectorLimit !== UNLIMITED_QUOTA, + enabled: hasFlag && detectorLimit !== UNLIMITED_QUOTA, staleTime: 5 * 1000, // Set stale time to 5 sec to avoid unnecessary re-fetching select: data => data.headers['X-Hits'], }); - const { - data: alertRulesXHits = NO_COUNT, - isLoading: isMetricRulesLoading, - isError: isMetricRulesError, - } = useQuery({ - ...apiOptions.as()('/organizations/$organizationIdOrSlug/alert-rules/', { - path: {organizationIdOrSlug: organization.slug}, - staleTime: 5 * 1000, // Set stale time to 5 sec to avoid unnecessary re-fetching - query: {limit: 1}, - }), - enabled: hasFlag && !isWorkflowEngine && detectorLimit !== UNLIMITED_QUOTA, - select: data => data.headers['X-Hits'], - }); - - const isLoading = isWorkflowEngine ? isDetectorsLoading : isMetricRulesLoading; - const isError = isWorkflowEngine ? isDetectorsError : isMetricRulesError; - const detectorCount = isWorkflowEngine ? detectorXHits : alertRulesXHits; + const isLoading = isDetectorsLoading; + const isError = isDetectorsError; + const detectorCount = detectorXHits; if (!hasFlag || detectorLimit === UNLIMITED_QUOTA) { return {