Skip to content

chore(alerts): Remove lingering activated alerts code #83342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import TextOverflow from 'sentry/components/textOverflow';
import TimeSince from 'sentry/components/timeSince';
import type {Actor} from 'sentry/types/core';
import type {Organization} from 'sentry/types/organization';
import ActivatedMetricAlertRuleStatus from 'sentry/views/alerts/list/rules/activatedMetricAlertRuleStatus';
import type {Incident, MetricAlert} from 'sentry/views/alerts/types';
import {CombinedAlertType} from 'sentry/views/alerts/types';
import type {Incident} from 'sentry/views/alerts/types';
import {alertDetailsLink} from 'sentry/views/alerts/utils';

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

const rule: MetricAlert = {
type: CombinedAlertType.METRIC,
...item.alertRule,
latestIncident: item,
};

return (
<div
css={[
Expand Down Expand Up @@ -127,10 +119,6 @@ function AlertListItem({item}: {item: Incident}) {
</TextOverflow>
</AnalyticsProvider>

<div css={[smallCss, {gridArea: 'message', '> div': {flexDirection: 'row'}}]}>
<ActivatedMetricAlertRuleStatus rule={rule} />
</div>

{teamActor ? (
<div
css={[
Expand Down
34 changes: 0 additions & 34 deletions static/app/types/alerts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,37 +310,3 @@ export enum RuleActionsCategories {
SOME_DEFAULT = 'some_default',
NO_DEFAULT = 'no_default',
}

export enum MonitorType {
CONTINUOUS = 0,
ACTIVATED = 1,
}

export enum ActivationConditionType {
RELEASE_CREATION = 0,
DEPLOY_CREATION = 1,
}

export type AlertRuleActivation = {
activator: string;
alertRuleId: string;
conditionType: string;
dateCreated: string;
finishedAt: string;
id: string;
isComplete: boolean;
querySubscriptionId: string;
metricValue?: number;
};

export enum ActivationTrigger {
ACTIVATED = 'activated',
FINISHED = 'finished',
}

export type ActivationTriggerActivity = {
activator: string;
conditionType: string;
dateCreated: string;
type: ActivationTrigger;
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function LastIssueTrigger({rule}: {rule: IssueAlert}) {
}

/**
* Displays the last activation for activated alert rules or the last incident for continuous alerts
* Displays the last incident for continuous alerts
*/
function LastMetricAlertIncident({rule}: {rule: MetricAlert}) {
if (!rule.latestIncident) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const UptimeStatusText: Record<
};

/**
* Takes in an alert rule (activated metric, metric, issue) and renders the
* Takes in an alert rule (metric or issue) and renders the
* appropriate tooltip and AlertBadge
*/
export default function CombinedAlertBadge({rule}: Props) {
Expand Down
187 changes: 0 additions & 187 deletions static/app/views/alerts/rules/metric/details/metricActivity.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('RuleConditionsForm', () => {
isEditing: true,
onComparisonDeltaChange: () => {},
onFilterSearch: mockSearch,
onMonitorTypeSelect: () => {},
onTimeWindowChange: () => {},
project: projects[0]!,
thresholdChart: <div>chart</div>,
Expand Down
2 changes: 0 additions & 2 deletions static/app/views/alerts/rules/metric/types.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {t} from 'sentry/locale';
import type {AlertRuleActivation} from 'sentry/types/alerts';
import type {MEPAlertsQueryType} from 'sentry/views/alerts/wizard/options';
import type {SchemaFormConfig} from 'sentry/views/settings/organizationIntegrations/sentryAppExternalForm';

Expand Down Expand Up @@ -125,7 +124,6 @@ export type UnsavedMetricRule = {

// Form values for updating a metric alert rule
export interface SavedMetricRule extends UnsavedMetricRule {
activations: AlertRuleActivation[];
dateCreated: string;
dateModified: string;
id: string;
Expand Down
Loading
Loading