getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.23k stars 4.21k forks source link

chore(alerts): Remove excluded projects trigger exclusion #81020

Open ceorourke opened 2 days ago

ceorourke commented 2 days ago

A follow up to https://github.com/getsentry/sentry/pull/79700 and a step towards removing the AlertRuleExcludedProjects and AlertRuleTriggerExclusion models.

This sets the foreign keys' db_constraint to False and removes any lingering code that references the tables or usage of the columns. I removed references to the AlertRule excluded_projects and include_all_projects fields from the serializer as well since they're unused.

The only place that still references them is in the backup tests that can't be removed until we're removing the table in the next step.

github-actions[bot] commented 1 day ago

This PR has a migration; here is the generated SQL for src/sentry/migrations/0793_remove_db_constraint_alert_rule_exclusion.py ()

--
-- Alter field alert_rule on alertruleexcludedprojects
--
SET CONSTRAINTS "sentry_alertruleexcl_alert_rule_id_7611518a_fk_sentry_al" IMMEDIATE; ALTER TABLE "sentry_alertruleexcludedprojects" DROP CONSTRAINT "sentry_alertruleexcl_alert_rule_id_7611518a_fk_sentry_al";
--
-- Alter field alert_rule_trigger on alertruletriggerexclusion
--
SET CONSTRAINTS "sentry_alertruletrig_alert_rule_trigger_i_82ac5b81_fk_sentry_al" IMMEDIATE; ALTER TABLE "sentry_alertruletriggerexclusion" DROP CONSTRAINT "sentry_alertruletrig_alert_rule_trigger_i_82ac5b81_fk_sentry_al";
--
-- Alter field query_subscription on alertruletriggerexclusion
--
SET CONSTRAINTS "sentry_alertruletrig_query_subscription_i_244687c4_fk_sentry_qu" IMMEDIATE; ALTER TABLE "sentry_alertruletriggerexclusion" DROP CONSTRAINT "sentry_alertruletrig_query_subscription_i_244687c4_fk_sentry_qu";
codecov[bot] commented 1 day ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:white_check_mark: All tests successful. No failed tests found.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #81020 +/- ## =========================================== + Coverage 56.66% 78.48% +21.82% =========================================== Files 7198 7214 +16 Lines 318962 319617 +655 Branches 43919 43996 +77 =========================================== + Hits 180735 250856 +70121 + Misses 133791 62364 -71427 - Partials 4436 6397 +1961 ```