diff --git a/src/sentry/models/organizationonboardingtask.py b/src/sentry/models/organizationonboardingtask.py index cab7c950158994..46c94a7ce8acf9 100644 --- a/src/sentry/models/organizationonboardingtask.py +++ b/src/sentry/models/organizationonboardingtask.py @@ -20,6 +20,8 @@ from sentry.db.models.manager.base import BaseManager +# NOTE: There are gaps in the numberation because a +# few tasks were removed as they are no longer used in the quick start sidebar class OnboardingTask: FIRST_PROJECT = 1 FIRST_EVENT = 2 @@ -32,7 +34,6 @@ class OnboardingTask: ISSUE_TRACKER = 9 ALERT_RULE = 10 FIRST_TRANSACTION = 11 - METRIC_ALERT = 12 INTEGRATIONS = 13 SESSION_REPLAY = 14 REAL_TIME_NOTIFICATIONS = 15 @@ -134,7 +135,6 @@ class OrganizationOnboardingTask(AbstractOnboardingTask): (OnboardingTask.ISSUE_TRACKER, "setup_issue_tracker"), (OnboardingTask.ALERT_RULE, "setup_alert_rules"), (OnboardingTask.FIRST_TRANSACTION, "setup_transactions"), - (OnboardingTask.METRIC_ALERT, "setup_metric_alert_rules"), (OnboardingTask.INTEGRATIONS, "setup_integrations"), (OnboardingTask.SESSION_REPLAY, "setup_session_replay"), (OnboardingTask.REAL_TIME_NOTIFICATIONS, "setup_real_time_notifications"), diff --git a/src/sentry/receivers/onboarding.py b/src/sentry/receivers/onboarding.py index 02e20d1b0b213a..d5ded21671808c 100644 --- a/src/sentry/receivers/onboarding.py +++ b/src/sentry/receivers/onboarding.py @@ -654,10 +654,13 @@ def record_plugin_enabled(plugin, project, user, **kwargs): @alert_rule_created.connect(weak=False) def record_alert_rule_created(user, project: Project, rule_type: str, **kwargs): - task = OnboardingTask.METRIC_ALERT if rule_type == "metric" else OnboardingTask.ALERT_RULE + # The quick start now only has a task for issue alert rules. + # Please see https://github.com/getsentry/sentry/blob/c06a3aa5fb104406f2a44994d32983e99bc2a479/static/app/components/onboardingWizard/taskConfig.tsx#L351-L352 + if rule_type == "metric": + return rows_affected, created = OrganizationOnboardingTask.objects.create_or_update( organization_id=project.organization_id, - task=task, + task=OnboardingTask.ALERT_RULE, values={ "status": OnboardingTaskStatus.COMPLETE, "user_id": user.id if user else None,