Skip to content

Commit 2fe3d93

Browse files
authored
chore(alerts): Remove lingering activated alerts code (#83342)
Remove what I think is the last of the front end activated alerts code.
1 parent cff6e78 commit 2fe3d93

File tree

11 files changed

+4
-356
lines changed

11 files changed

+4
-356
lines changed

Diff for: static/app/components/devtoolbar/components/alerts/alertsPanel.tsx

+1-13
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import TextOverflow from 'sentry/components/textOverflow';
88
import TimeSince from 'sentry/components/timeSince';
99
import type {Actor} from 'sentry/types/core';
1010
import type {Organization} from 'sentry/types/organization';
11-
import ActivatedMetricAlertRuleStatus from 'sentry/views/alerts/list/rules/activatedMetricAlertRuleStatus';
12-
import type {Incident, MetricAlert} from 'sentry/views/alerts/types';
13-
import {CombinedAlertType} from 'sentry/views/alerts/types';
11+
import type {Incident} from 'sentry/views/alerts/types';
1412
import {alertDetailsLink} from 'sentry/views/alerts/utils';
1513

1614
import useConfiguration from '../../hooks/useConfiguration';
@@ -86,12 +84,6 @@ function AlertListItem({item}: {item: Incident}) {
8684
? {type: 'team' as Actor['type'], id: ownerId, name: ownerTeam?.name ?? ''}
8785
: null;
8886

89-
const rule: MetricAlert = {
90-
type: CombinedAlertType.METRIC,
91-
...item.alertRule,
92-
latestIncident: item,
93-
};
94-
9587
return (
9688
<div
9789
css={[
@@ -127,10 +119,6 @@ function AlertListItem({item}: {item: Incident}) {
127119
</TextOverflow>
128120
</AnalyticsProvider>
129121

130-
<div css={[smallCss, {gridArea: 'message', '> div': {flexDirection: 'row'}}]}>
131-
<ActivatedMetricAlertRuleStatus rule={rule} />
132-
</div>
133-
134122
{teamActor ? (
135123
<div
136124
css={[

Diff for: static/app/types/alerts.tsx

-34
Original file line numberDiff line numberDiff line change
@@ -310,37 +310,3 @@ export enum RuleActionsCategories {
310310
SOME_DEFAULT = 'some_default',
311311
NO_DEFAULT = 'no_default',
312312
}
313-
314-
export enum MonitorType {
315-
CONTINUOUS = 0,
316-
ACTIVATED = 1,
317-
}
318-
319-
export enum ActivationConditionType {
320-
RELEASE_CREATION = 0,
321-
DEPLOY_CREATION = 1,
322-
}
323-
324-
export type AlertRuleActivation = {
325-
activator: string;
326-
alertRuleId: string;
327-
conditionType: string;
328-
dateCreated: string;
329-
finishedAt: string;
330-
id: string;
331-
isComplete: boolean;
332-
querySubscriptionId: string;
333-
metricValue?: number;
334-
};
335-
336-
export enum ActivationTrigger {
337-
ACTIVATED = 'activated',
338-
FINISHED = 'finished',
339-
}
340-
341-
export type ActivationTriggerActivity = {
342-
activator: string;
343-
conditionType: string;
344-
dateCreated: string;
345-
type: ActivationTrigger;
346-
};

Diff for: static/app/views/alerts/list/rules/activatedMetricAlertRuleStatus.tsx

-96
This file was deleted.

Diff for: static/app/views/alerts/list/rules/alertLastIncidentActivationInfo.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function LastIssueTrigger({rule}: {rule: IssueAlert}) {
4141
}
4242

4343
/**
44-
* Displays the last activation for activated alert rules or the last incident for continuous alerts
44+
* Displays the last incident for continuous alerts
4545
*/
4646
function LastMetricAlertIncident({rule}: {rule: MetricAlert}) {
4747
if (!rule.latestIncident) {

Diff for: static/app/views/alerts/list/rules/combinedAlertBadge.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const UptimeStatusText: Record<
3232
};
3333

3434
/**
35-
* Takes in an alert rule (activated metric, metric, issue) and renders the
35+
* Takes in an alert rule (metric or issue) and renders the
3636
* appropriate tooltip and AlertBadge
3737
*/
3838
export default function CombinedAlertBadge({rule}: Props) {

Diff for: static/app/views/alerts/rules/metric/details/metricActivity.tsx

-187
This file was deleted.

Diff for: static/app/views/alerts/rules/metric/ruleConditionsForm.spec.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ describe('RuleConditionsForm', () => {
2525
isEditing: true,
2626
onComparisonDeltaChange: () => {},
2727
onFilterSearch: mockSearch,
28-
onMonitorTypeSelect: () => {},
2928
onTimeWindowChange: () => {},
3029
project: projects[0]!,
3130
thresholdChart: <div>chart</div>,

Diff for: static/app/views/alerts/rules/metric/types.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {t} from 'sentry/locale';
2-
import type {AlertRuleActivation} from 'sentry/types/alerts';
32
import type {MEPAlertsQueryType} from 'sentry/views/alerts/wizard/options';
43
import type {SchemaFormConfig} from 'sentry/views/settings/organizationIntegrations/sentryAppExternalForm';
54

@@ -125,7 +124,6 @@ export type UnsavedMetricRule = {
125124

126125
// Form values for updating a metric alert rule
127126
export interface SavedMetricRule extends UnsavedMetricRule {
128-
activations: AlertRuleActivation[];
129127
dateCreated: string;
130128
dateModified: string;
131129
id: string;

0 commit comments

Comments
 (0)