Skip to content

Conversation

@ceorourke
Copy link
Member

@ceorourke ceorourke commented Nov 19, 2024

A follow up to #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.

@ceorourke ceorourke requested review from a team as code owners November 19, 2024 22:34
@ceorourke ceorourke changed the title Ceorourke/remove excluded projects trigger exclusion chore(alerts): Remove excluded projects trigger exclusion Nov 19, 2024
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 19, 2024
@ceorourke ceorourke force-pushed the ceorourke/remove-excluded-projects-trigger-exclusion branch from 488dad4 to 9b50b44 Compare November 20, 2024 17:53
@github-actions
Copy link
Contributor

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
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #81020      +/-   ##
==========================================
- Coverage   80.34%   80.34%   -0.01%     
==========================================
  Files        7225     7225              
  Lines      320221   320199      -22     
  Branches    20781    20781              
==========================================
- Hits       257268   257249      -19     
+ Misses      62559    62556       -3     
  Partials      394      394              

@ceorourke ceorourke force-pushed the ceorourke/remove-excluded-projects-trigger-exclusion branch from 9b50b44 to b117474 Compare November 22, 2024 17:44
@ceorourke ceorourke merged commit 223c73d into master Nov 22, 2024
50 checks passed
@ceorourke ceorourke deleted the ceorourke/remove-excluded-projects-trigger-exclusion branch November 22, 2024 18:18
harshithadurai pushed a commit that referenced this pull request Nov 25, 2024
A follow up to #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](https://github.com/getsentry/sentry/blob/master/src/sentry/testutils/helpers/backups.py#L520)
that can't be removed until we're removing the table in the next step.
ceorourke added a commit that referenced this pull request Nov 25, 2024
In preparation for removing the `AlertRuleExcludedProjects` model (see
#81020) we need to first remove
the many to many `excluded_projects` column on the `AlertRule` model. We
can take the opportunity to remove the now unused `include_all_projects`
column. This PR uses the brand new `SafeRemoveField` option added in
#81098
evanh pushed a commit that referenced this pull request Nov 25, 2024
A follow up to #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](https://github.com/getsentry/sentry/blob/master/src/sentry/testutils/helpers/backups.py#L520)
that can't be removed until we're removing the table in the next step.
evanh pushed a commit that referenced this pull request Nov 25, 2024
In preparation for removing the `AlertRuleExcludedProjects` model (see
#81020) we need to first remove
the many to many `excluded_projects` column on the `AlertRule` model. We
can take the opportunity to remove the now unused `include_all_projects`
column. This PR uses the brand new `SafeRemoveField` option added in
#81098
ceorourke added a commit that referenced this pull request Nov 26, 2024
Follow up to #81020 (and a few
others) to remove the `AlertRuleExcludedProjects` and
`AlertRuleTriggerExclusion` models. There will be a final PR to fully
remove them and then they're finally gone!
ceorourke added a commit that referenced this pull request Nov 27, 2024
The final PR to remove the `AlertRuleExcludedProjects` and
`AlertRuleTriggerExclusion` models. The models were removed from code in
#81020.
andrewshie-sentry pushed a commit that referenced this pull request Dec 2, 2024
A follow up to #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](https://github.com/getsentry/sentry/blob/master/src/sentry/testutils/helpers/backups.py#L520)
that can't be removed until we're removing the table in the next step.
andrewshie-sentry pushed a commit that referenced this pull request Dec 2, 2024
In preparation for removing the `AlertRuleExcludedProjects` model (see
#81020) we need to first remove
the many to many `excluded_projects` column on the `AlertRule` model. We
can take the opportunity to remove the now unused `include_all_projects`
column. This PR uses the brand new `SafeRemoveField` option added in
#81098
andrewshie-sentry pushed a commit that referenced this pull request Dec 2, 2024
Follow up to #81020 (and a few
others) to remove the `AlertRuleExcludedProjects` and
`AlertRuleTriggerExclusion` models. There will be a final PR to fully
remove them and then they're finally gone!
andrewshie-sentry pushed a commit that referenced this pull request Dec 2, 2024
The final PR to remove the `AlertRuleExcludedProjects` and
`AlertRuleTriggerExclusion` models. The models were removed from code in
#81020.
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants