Skip to content

ref(rule): Remove name field from all rule.data #54915

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 4 commits into from
Aug 29, 2023

Conversation

ceorourke
Copy link
Member

@ceorourke ceorourke commented Aug 17, 2023

This is a follow up to #54739 and #54746 to normalize the issue alert rule data to not have the unnecessary "name" field.

We have 1,413,825 rows to check so I'm marking it as dangerous.

Closes #55115

@ceorourke ceorourke requested a review from a team as a code owner August 17, 2023 00:52
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 17, 2023
@github-actions
Copy link
Contributor

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

--
-- MIGRATION NOW PERFORMS OPERATION THAT CANNOT BE WRITTEN AS SQL:
-- Raw Python operation
--

@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #54915 (ba11288) into master (c68286b) will increase coverage by 0.00%.
Report is 3 commits behind head on master.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #54915   +/-   ##
=======================================
  Coverage   80.01%   80.01%           
=======================================
  Files        5042     5042           
  Lines      214964   214964           
  Branches    36500    36500           
=======================================
+ Hits       171994   172005   +11     
+ Misses      37689    37678   -11     
  Partials     5281     5281           

Comment on lines 14 to 19
if action.get("name"):
del action["name"]

for condition in rule.data.get("conditions", []):
if condition.get("name"):
del condition["name"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you care if empty string, 0, or None are left behind?

@ceorourke ceorourke force-pushed the ceorourke/rule-data-migration-rm-name branch from b3f694a to ba11288 Compare August 29, 2023 19:06
@github-actions
Copy link
Contributor

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

--
-- MIGRATION NOW PERFORMS OPERATION THAT CANNOT BE WRITTEN AS SQL:
-- Raw Python operation
--

@ceorourke ceorourke merged commit 427037d into master Aug 29, 2023
@ceorourke ceorourke deleted the ceorourke/rule-data-migration-rm-name branch August 29, 2023 20:31
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2023
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.

Migrate Rule data for consistency
2 participants