Skip to content
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

ref(escalating-issues): Remove GroupForecast model #47593

Merged
merged 2 commits into from
Apr 19, 2023

Conversation

jangjodi
Copy link
Member

@jangjodi jangjodi commented Apr 18, 2023

Step 2 of removing the GroupForecast table

See step 1: removing the foreign key constraint in the GroupForecast table here

WOR-2966

Step 2 of removing the GroupForecast table

WOR-2966
@jangjodi jangjodi requested a review from a team as a code owner April 18, 2023 21:17
@jangjodi jangjodi requested a review from a team April 18, 2023 21:17
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 18, 2023
@lobsterkatie
Copy link
Member

Step 2 of removing the GroupForecast table

Can you add into the description what step 1 was, and a link to the PR?

@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Merging #47593 (84ad3aa) into master (921f272) will increase coverage by 0.00%.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #47593   +/-   ##
=======================================
  Coverage   80.75%   80.75%           
=======================================
  Files        4762     4761    -1     
  Lines      201424   201412   -12     
  Branches    11618    11618           
=======================================
+ Hits       162654   162655    +1     
+ Misses      38514    38501   -13     
  Partials      256      256           
Impacted Files Coverage Δ
src/sentry/deletions/defaults/group.py 100.00% <ø> (ø)
src/sentry/models/__init__.py 100.00% <ø> (ø)

... and 7 files with indirect coverage changes

Comment on lines 25 to 29
operations = [
migrations.DeleteModel(
name="GroupForecast",
),
]
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be a state only operation for now. We just want to remove code references here, not the actual database table itself (that's step 3).

Even though this table is unused/empty, the problem here is that if you drop the table, then there's still code in production that thinks it exists. So if someone deletes a Group, then as part of that deletion django will attempt to query this table to see if there are any related rows that should be removed. Since the table doesn't exist, then we'll throw an exception and the deletion will fail.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you, I didn't notice it wasn't generated as state only

@github-actions
Copy link
Contributor

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

--
-- Custom state/database change combination
--

@jangjodi jangjodi merged commit c8788ff into master Apr 19, 2023
@jangjodi jangjodi deleted the jodi/wor-2966-remove-model branch April 19, 2023 20:05
@armenzg armenzg added this to the Escalating Issues V1 milestone Apr 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 11, 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.

4 participants