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 branch.refresh_from_db from branch serializer #368

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

joseph-sentry
Copy link
Contributor

Purpose/Motivation

using refresh_from_db on a branch object causes a similar issue as trying to update a branch object and saving using the django orm due to the primary key of the django model only being part of the actual composite primary key of the postgres table

Links to relevant tickets

Relevant ticket

What does this PR do?

  • remove call to branch.refresh_from_db
  • replace by using value of branch head returned by get_or_update_branch_head

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
@codecov-staging
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (daacd21) 96.08% compared to head (8f48b36) 96.08%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #368      +/-   ##
==========================================
- Coverage   96.08%   96.08%   -0.01%     
==========================================
  Files         632      632              
  Lines       16410    16409       -1     
==========================================
- Hits        15767    15766       -1     
  Misses        643      643              
Flag Coverage Δ
unit 96.08% <100.00%> (-0.01%) ⬇️
unit-latest-uploader 96.08% <100.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Codecov Report

Merging #368 (8f48b36) into main (daacd21) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #368      +/-   ##
==========================================
- Coverage   96.08%   96.08%   -0.01%     
==========================================
  Files         632      632              
  Lines       16410    16409       -1     
==========================================
- Hits        15767    15766       -1     
  Misses        643      643              
Flag Coverage Δ
unit 96.08% <100.00%> (-0.01%) ⬇️
unit-latest-uploader 96.08% <100.00%> (-0.01%) ⬇️

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

Files Coverage Δ
api/public/v2/branch/serializers.py 100.00% <100.00%> (ø)

Impacted file tree graph

@joseph-sentry joseph-sentry merged commit 2e76d3b into main Jan 30, 2024
20 checks passed
@joseph-sentry joseph-sentry deleted the joseph/remove-refresh-from-db branch January 30, 2024 14:34
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