Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Conversation

@ajay-sentry
Copy link
Contributor

Purpose/Motivation

This PR aims to fix a Sentry issue that popped up after we launched ACH related to a customer trying to update their payment method while having multiple stripe subscription_ids tied to the customer_id in our DB. I noticed that for this customer both of the subscription_ids were the same, but wanted the code to accommodate cases where that wasn't necessarily the case; potentially someone who wants to spread Codecov across the many orgs their apart of ;)

Links to relevant tickets

Closes codecov/engineering-team#3323

Notes to Reviewer

Anything to note to the team? Any tips on how to review, or where to start?

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.

@sentry
Copy link

sentry bot commented Feb 7, 2025

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: billing/views.py

Function Unhandled Issue
_check_and_handle_delayed_notification_payment_methods Owner.MultipleObjectsReturned: get() returned more than one Owner -- it returned 2! ...
Event Count: 25
_check_and_handle_delayed_notification_payment_methods Owner.DoesNotExist: Owner matching query does not exist. /billing/stripe/...
Event Count: 9

Did you find this useful? React with a 👍 or 👎

@codecov-qa
Copy link

codecov-qa bot commented Feb 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.90%. Comparing base (4ed721d) to head (bc7dd08).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2025

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

@codecov-notifications
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@suejung-sentry suejung-sentry left a comment

Choose a reason for hiding this comment

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

Thanks for fixing that!

owner.stripe_subscription_id, default_payment_method=payment_method
# retrieve the number of owners to update
owners = Owner.objects.filter(
stripe_customer_id=customer_id, stripe_subscription_id__isnull=False
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, i like adding the filter for not null

@codecov
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.02%. Comparing base (4ed721d) to head (bc7dd08).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1146   +/-   ##
=======================================
  Coverage   96.02%   96.02%           
=======================================
  Files         837      837           
  Lines       19763    19766    +3     
=======================================
+ Hits        18978    18981    +3     
  Misses        785      785           
Flag Coverage Δ
unit 95.90% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 95.90% <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.

@ajay-sentry ajay-sentry added this pull request to the merge queue Feb 8, 2025
Merged via the queue into main with commit ea2d934 Feb 8, 2025
19 of 20 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/multiple-owner-stripe-checks branch February 8, 2025 01:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle when 2 owners have the same stripe_customer_id

3 participants