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

feat: Django admin portal changes for plans and tiers #1097

Merged
merged 6 commits into from
Jan 16, 2025

Conversation

RulaKhaled
Copy link
Contributor

Purpose/Motivation

What is the feature? Why is this being done?
To make it easy to add plans.

Links to relevant tickets

What does this PR do?

Include a brief description of the changes in this PR. Bullet points are your friend.

  • Added new admin table for plans
  • Form validation for plans
  • New admin table for tiers
  • Tests

Notes to Reviewer

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

Screen.Recording.2025-01-15.at.10.57.38.AM.mov
Screenshot 2025-01-15 at 1 29 31 PM 1-8b3a-c128ee5da80c

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
Contributor

This PR includes changes to shared. Please review them here: codecov/shared@07b39b2...d5d7c20

@codecov-notifications
Copy link

codecov-notifications bot commented Jan 15, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2696 1 2695 7
View the top 1 failed tests by shortest run time
billing/tests/test_views.py::StripeWebhookHandlerTests::test_customer_subscription_deleted_deactivates_all_repos
Stack Traces | 0.052s run time
self = <billing.tests.test_views.StripeWebhookHandlerTests testMethod=test_customer_subscription_deleted_deactivates_all_repos>

    def test_customer_subscription_deleted_deactivates_all_repos(self):
        RepositoryFactory(author=self.owner, activated=True, active=True)
        RepositoryFactory(author=self.owner, activated=True, active=True)
        RepositoryFactory(author=self.owner, activated=True, active=True)
    
>       assert (
            self.owner.repository_set.filter(activated=True, active=True).count() == 3
        )
E       assert 2 == 3
E        +  where 2 = <bound method QuerySet.count of <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]>>()
E        +    where <bound method QuerySet.count of <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]>> = <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]>.count
E        +      where <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]> = <bound method QuerySet.filter of <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0>>(activated=True, active=True)
E        +        where <bound method QuerySet.filter of <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0>> = <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0>.filter
E        +          where <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0> = <Owner: Owner<github/steven04>>.repository_set
E        +            where <Owner: Owner<github/steven04>> = <billing.tests.test_views.StripeWebhookHandlerTests testMethod=test_customer_subscription_deleted_deactivates_all_repos>.owner

billing/tests/test_views.py:532: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link
Contributor

✅ All tests successful. No failed tests were found.

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

Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 97.72727% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.09%. Comparing base (020e7cf) to head (632a3d3).
Report is 1 commits behind head on main.

❌ We are unable to process any of the uploaded JUnit XML files. Please ensure your files are in the right format.

Files with missing lines Patch % Lines
utils/test_utils.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1097   +/-   ##
=======================================
  Coverage   96.08%   96.09%           
=======================================
  Files         832      832           
  Lines       19459    19501   +42     
=======================================
+ Hits        18698    18740   +42     
  Misses        761      761           
Flag Coverage Δ
unit 96.01% <97.72%> (+<0.01%) ⬆️
unit-latest-uploader 96.01% <97.72%> (+<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
Contributor

@JerrySentry JerrySentry left a comment

Choose a reason for hiding this comment

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

Approved. Just a small nit.

codecov_auth/admin.py Outdated Show resolved Hide resolved
codecov_auth/admin.py Outdated Show resolved Hide resolved
Copy link
Contributor

This PR includes changes to shared. Please review them here: codecov/shared@de4b37b...191837f

@RulaKhaled RulaKhaled enabled auto-merge January 16, 2025 11:02
@codecov-qa
Copy link

codecov-qa bot commented Jan 16, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2696 1 2695 7
View the top 1 failed tests by shortest run time
billing/tests/test_views.py::StripeWebhookHandlerTests::test_customer_subscription_deleted_deactivates_all_repos
Stack Traces | 0.052s run time
self = <billing.tests.test_views.StripeWebhookHandlerTests testMethod=test_customer_subscription_deleted_deactivates_all_repos>

    def test_customer_subscription_deleted_deactivates_all_repos(self):
        RepositoryFactory(author=self.owner, activated=True, active=True)
        RepositoryFactory(author=self.owner, activated=True, active=True)
        RepositoryFactory(author=self.owner, activated=True, active=True)
    
>       assert (
            self.owner.repository_set.filter(activated=True, active=True).count() == 3
        )
E       assert 2 == 3
E        +  where 2 = <bound method QuerySet.count of <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]>>()
E        +    where <bound method QuerySet.count of <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]>> = <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]>.count
E        +      where <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]> = <bound method QuerySet.filter of <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0>>(activated=True, active=True)
E        +        where <bound method QuerySet.filter of <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0>> = <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0>.filter
E        +          where <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0> = <Owner: Owner<github/steven04>>.repository_set
E        +            where <Owner: Owner<github/steven04>> = <billing.tests.test_views.StripeWebhookHandlerTests testMethod=test_customer_subscription_deleted_deactivates_all_repos>.owner

billing/tests/test_views.py:532: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2696 1 2695 6
View the top 1 failed tests by shortest run time
billing/tests/test_views.py::StripeWebhookHandlerTests::test_customer_subscription_deleted_deactivates_all_repos
Stack Traces | 0.052s run time
self = <billing.tests.test_views.StripeWebhookHandlerTests testMethod=test_customer_subscription_deleted_deactivates_all_repos>

    def test_customer_subscription_deleted_deactivates_all_repos(self):
        RepositoryFactory(author=self.owner, activated=True, active=True)
        RepositoryFactory(author=self.owner, activated=True, active=True)
        RepositoryFactory(author=self.owner, activated=True, active=True)
    
>       assert (
            self.owner.repository_set.filter(activated=True, active=True).count() == 3
        )
E       assert 2 == 3
E        +  where 2 = <bound method QuerySet.count of <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]>>()
E        +    where <bound method QuerySet.count of <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]>> = <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]>.count
E        +      where <RepositoryQuerySet [<Repository: Repo<Owner<github/steven04>/foreign>>, <Repository: Repo<Owner<github/steven04>/south>>]> = <bound method QuerySet.filter of <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0>>(activated=True, active=True)
E        +        where <bound method QuerySet.filter of <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0>> = <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0>.filter
E        +          where <django.db.models.fields.related_descriptors.create_reverse_many_to_one_manager.<locals>.RelatedManager object at 0x7f9b473ec6e0> = <Owner: Owner<github/steven04>>.repository_set
E        +            where <Owner: Owner<github/steven04>> = <billing.tests.test_views.StripeWebhookHandlerTests testMethod=test_customer_subscription_deleted_deactivates_all_repos>.owner

billing/tests/test_views.py:532: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@RulaKhaled RulaKhaled added this pull request to the merge queue Jan 16, 2025
Merged via the queue into main with commit 261ea42 Jan 16, 2025
17 of 18 checks passed
@RulaKhaled RulaKhaled deleted the django-admin-for-plans branch January 16, 2025 11:39
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.

3 participants