Skip to content

Commit b25a43a

Browse files
authored
ref(metric-issues): Remove workflow-engine-metric-issue-ui flag usage on frontend (#112422)
1 parent d193923 commit b25a43a

File tree

9 files changed

+88
-202
lines changed

9 files changed

+88
-202
lines changed

static/app/views/alerts/rules/metric/details/body.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,7 @@ export function MetricDetailsBody({
254254
/>
255255
<DetailWrapper>
256256
<Stack flex="1" width="100%">
257-
{organization.features.includes('workflow-engine-metric-issue-ui') && (
258-
<MetricAlertOngoingIssues project={project} rule={rule} />
259-
)}
257+
<MetricAlertOngoingIssues project={project} rule={rule} />
260258
<SectionHeading>{t('Alert History')}</SectionHeading>
261259
<MetricHistory incidents={incidents} />
262260
{[Dataset.METRICS, Dataset.SESSIONS, Dataset.ERRORS].includes(dataset) && (

static/app/views/alerts/rules/metric/details/index.spec.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ describe('MetricAlertDetails', () => {
5555
url: '/organizations/org-slug/issues/',
5656
body: [GroupFixture()],
5757
});
58+
MockApiClient.addMockResponse({
59+
url: '/organizations/org-slug/alert-rule-detector/',
60+
body: [],
61+
});
5862
});
5963

6064
afterEach(() => {

static/app/views/alerts/rules/metric/ruleForm.tsx

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,10 +1427,6 @@ class RuleFormContainer extends DeprecatedAsyncComponent<Props, State> {
14271427
dataset,
14281428
traceItemType
14291429
);
1430-
const showWorkflowEngineMetricIssueUi = organization.features.includes(
1431-
'workflow-engine-metric-issue-ui'
1432-
);
1433-
14341430
// Rendering the main form body
14351431
return (
14361432
<Main width="full">
@@ -1536,9 +1532,7 @@ class RuleFormContainer extends DeprecatedAsyncComponent<Props, State> {
15361532
{
15371533
<div>
15381534
<Flex align="center" gap="sm">
1539-
{showWorkflowEngineMetricIssueUi
1540-
? t('Set issue detection thresholds')
1541-
: t('Set thresholds')}
1535+
{t('Set issue detection thresholds')}
15421536

15431537
{showExtrapolationModeChangeWarning && (
15441538
<WarningIcon
@@ -1564,13 +1558,11 @@ class RuleFormContainer extends DeprecatedAsyncComponent<Props, State> {
15641558
}
15651559
</AlertListItem>
15661560
<Stack gap="lg">
1567-
{showWorkflowEngineMetricIssueUi && (
1568-
<Text>
1569-
{t(
1570-
'Metric alerts create metric issues and events. The thresholds below will determine: when the issue is created, resolved, and re-opened, as well as the issue priority.'
1571-
)}
1572-
</Text>
1573-
)}
1561+
<Text>
1562+
{t(
1563+
'Metric alerts create metric issues and events. The thresholds below will determine: when the issue is created, resolved, and re-opened, as well as the issue priority.'
1564+
)}
1565+
</Text>
15741566
{thresholdTypeForm(formDisabled)}
15751567
</Stack>
15761568
{showErrorMigrationWarning && (

static/app/views/alerts/wizard/index.spec.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ describe('AlertWizard', () => {
124124
});
125125

126126
await userEvent.click(screen.getByText('Throughput'));
127-
expect(
128-
screen.getByText(/Throughput is the total number of spans/)
129-
).toBeInTheDocument();
127+
expect(screen.getByText(/total number of spans/)).toBeInTheDocument();
130128
});
131129

132130
it('hides logs aggregate alerts according to feature flag', () => {
@@ -188,9 +186,7 @@ describe('AlertWizard', () => {
188186
});
189187

190188
await userEvent.click(screen.getByText('Throughput'));
191-
expect(
192-
screen.getByText(/Throughput is the total number of transactions/)
193-
).toBeInTheDocument();
189+
expect(screen.getByText(/total number of spans/)).toBeInTheDocument();
194190
});
195191

196192
it('hides custom metrics alerts when feature flag is disabled', () => {

static/app/views/alerts/wizard/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,7 @@ export default function AlertWizard() {
157157
);
158158
}
159159

160-
const hasMetricIssues = organization.features.includes(
161-
'workflow-engine-metric-issue-ui'
162-
);
163-
const panelContent = getAlertWizardPanelContent({hasMetricIssues})[alertOption];
160+
const panelContent = getAlertWizardPanelContent()[alertOption];
164161
return (
165162
<Stack flex={1}>
166163
<SentryDocumentTitle title={t('Alert Creation Wizard')} projectSlug={projectSlug} />

static/app/views/alerts/wizard/panelContent.tsx

Lines changed: 71 additions & 141 deletions
Large diffs are not rendered by default.

static/app/views/alerts/workflowEngineRedirects.spec.tsx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ describe('workflowEngineRedirects', () => {
132132
it('redirects metric issue notification links to issue details', async () => {
133133
const organization = OrganizationFixture({
134134
slug: 'org-slug',
135-
features: ['workflow-engine-metric-issue-ui'],
136135
});
137136

138137
MockApiClient.addMockResponse({
@@ -166,29 +165,6 @@ describe('workflowEngineRedirects', () => {
166165
notification_uuid: 'notification-uuid',
167166
});
168167
});
169-
170-
it('does not redirect without workflow-engine-metric-issue-ui flag', async () => {
171-
const organization = OrganizationFixture({
172-
slug: 'org-slug',
173-
features: [],
174-
});
175-
176-
const Wrapped = withMetricIssueRedirect(TestComponent);
177-
const initialRouterConfig: RouterConfig = {
178-
location: {
179-
pathname: `/organizations/${organization.slug}/alerts/`,
180-
query: {alert: 'alert-1', notification_uuid: 'notification-uuid'},
181-
},
182-
};
183-
184-
const {router} = render(<Wrapped />, {organization, initialRouterConfig});
185-
186-
// Path stays the same and we render the wrapped component
187-
await screen.findByText('Wrapped content');
188-
expect(router.location.pathname).toBe(
189-
`/organizations/${organization.slug}/alerts/`
190-
);
191-
});
192168
});
193169

194170
describe('withDetectorDetailsRedirect', () => {

static/app/views/alerts/workflowEngineRedirects.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,13 @@ export const withMetricIssueRedirect = <P extends Record<string, any>>(
176176
Component: React.ComponentType<P>
177177
) => {
178178
return function MetricIssueRedirectWrapper(props: P) {
179-
const organization = useOrganization();
180179
const location = useLocation();
181180
const alertId = location.query.alert as string | undefined;
182181
const notificationUuid = location.query.notification_uuid;
183182

184-
const hasWorkflowEngineMetricIssueUI = organization.features.includes(
185-
'workflow-engine-metric-issue-ui'
186-
);
187-
const hasMetricIssues = hasWorkflowEngineMetricIssueUI;
188-
const shouldRedirectToIssue = notificationUuid && alertId && hasMetricIssues;
183+
const shouldRedirectToIssue = notificationUuid && alertId;
189184

190-
// If the org has metric issues, we want notification links to redirect to the metric issue details page
185+
// We want notification links to redirect to the metric issue details page
191186
if (shouldRedirectToIssue) {
192187
return (
193188
<RedirectToIssue alertId={alertId}>

static/app/views/issueDetails/streamline/sidebar/detectorSection.spec.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,7 @@ describe('DetectorSection', () => {
200200
issueCategory: IssueCategory.METRIC,
201201
issueType: IssueType.METRIC_ISSUE,
202202
});
203-
const orgWithOnlyMetricIssues = OrganizationFixture({
204-
features: ['workflow-engine-metric-issue-ui'],
205-
});
203+
const orgWithOnlyMetricIssues = OrganizationFixture();
206204
const metricDetector = MetricDetectorFixture({
207205
id: detectorId,
208206
alertRuleId,

0 commit comments

Comments
 (0)