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

chore: Move worker billing functionality to shared #436

Merged
merged 6 commits into from
Nov 26, 2024

Conversation

RulaKhaled
Copy link
Contributor

As part of adding the new plan work, we are moving billing and plan stuff to shared.
This file can be found in https://github.com/codecov/worker/blob/main/services/billing.py

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.

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.81%. Comparing base (f96b72f) to head (f6f251b).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #436      +/-   ##
==========================================
- Coverage   90.56%   89.81%   -0.75%     
==========================================
  Files         390      324      -66     
  Lines       11768     9379    -2389     
  Branches     1974     1677     -297     
==========================================
- Hits        10658     8424    -2234     
+ Misses       1026      891     -135     
+ Partials       84       64      -20     
Flag Coverage Δ
shared-docker-uploader ?

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.

dbsession.add(owner)
dbsession.flush()

encrypted_license = "wxWEJyYgIcFpi6nBSyKQZQeaQ9Eqpo3SXyUomAqQOzOFjdYB3A8fFM1rm+kOt2ehy9w95AzrQqrqfxi9HJIb2zLOMOB9tSy52OykVCzFtKPBNsXU/y5pQKOfV7iI3w9CHFh3tDwSwgjg8UsMXwQPOhrpvl2GdHpwEhFdaM2O3vY7iElFgZfk5D9E7qEnp+WysQwHKxDeKLI7jWCnBCBJLDjBJRSz0H7AfU55RQDqtTrnR+rsLDHOzJ80/VxwVYhb"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are used in API, if they pose a security issue it would've been flagged.

Swatinem
Swatinem previously approved these changes Nov 26, 2024
Comment on lines 8 to 12
class TestBillingServiceTestCase(object):
@override_settings(IS_ENTERPRISE=True)
@pytest.fixture
def dbsession(self, db):
return db
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer these to remain fn-based tests rather than class-based tests in general.
Also this specific fixture seems to only be responsible for renaming the magic fn argument?

I believe it would be clearer to just use the existing fixture, or to add the dbsession fixture globally so all tests can use it. I would also clean up the used fixtures a bit, though it might not be quite clear which ones are used, as pytest fixtures are often just triggering sideeffects :-(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the parts that required the tests to be class-based when I cleaned up the API tests, so function-based tests now make more sense

@RulaKhaled RulaKhaled added this pull request to the merge queue Nov 26, 2024
Merged via the queue into main with commit d318691 Nov 26, 2024
6 checks passed
@RulaKhaled RulaKhaled deleted the move-billing-stuff-to-worker branch November 26, 2024 14:18
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.

2 participants