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

fix: Remove duplicate values in owners.admins and fix adding dupes in… #147

Merged
merged 3 commits into from
Sep 26, 2023

Conversation

JerrySentry
Copy link
Contributor

Purpose/Motivation

There is a bug when the membership list is loaded in the app by an admin of the org, their ownerid will be added to the admins column regardless if it was already there. On the admin page, it will show hundreds of the same admins for an org.

This fix will remove all duplicate ownerids in owners.admins column for every row. Should lead to improved DB disk usage and API query speed as well.

Note that the migration script runs the "risky" check, which means it doesn't run in CI when building/deploying the app in production. Need to run it manually by dev-ops after the release is deployed.

Links to relevant tickets

codecov/engineering-team#193

What does this PR do?

Fix bug in django
Provide a django migration script to remove existing duplicates

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@codecov-public-qa
Copy link

codecov-public-qa bot commented Sep 19, 2023

Codecov Report

Merging #147 (3e62911) into main (d8acb8b) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
+ Coverage   95.45%   95.54%   +0.09%     
==========================================
  Files         595      596       +1     
  Lines       14821    14825       +4     
==========================================
+ Hits        14147    14165      +18     
+ Misses        674      660      -14     
Flag Coverage Δ
unit 95.54% <100.00%> (+0.09%) ⬆️
unit-latest-uploader 95.54% <100.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
.../owner/interactors/get_is_current_user_an_admin.py 96.87% <100.00%> (-0.10%) ⬇️
..._auth/migrations/0046_dedupe_owner_admin_values.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Impacted file tree graph

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #147 (3e62911) into main (d8acb8b) will not change coverage.
The diff coverage is 100.00%.

@@          Coverage Diff          @@
##            main    #147   +/-   ##
=====================================
  Coverage   95.45   95.45           
=====================================
  Files        710     711    +1     
  Lines      15222   15226    +4     
=====================================
+ Hits       14529   14533    +4     
  Misses       693     693           
Flag Coverage Δ
unit 95.61% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 95.61% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../owner/interactors/get_is_current_user_an_admin.py 96.87% <100.00%> (-0.10%) ⬇️
..._auth/migrations/0046_dedupe_owner_admin_values.py 100.00% <100.00%> (ø)

@codecov-staging
Copy link

Codecov Report

All modified lines are covered by tests ✅

📢 Thoughts on this report? Let us know!.

@JerrySentry JerrySentry merged commit 32a8b0e into main Sep 26, 2023
22 of 23 checks passed
@JerrySentry JerrySentry deleted the api_193_new branch September 26, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants