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

update plan service to work with self-hosted and DEC #747

Merged
merged 1 commit into from
Aug 12, 2024
Merged

Conversation

nora-codecov
Copy link
Contributor

@nora-codecov nora-codecov commented Aug 12, 2024

Purpose/Motivation

In CodeCov, every Org has a plan, but if the customer is self-hosted or DEC, they also have a license.

When an Org has a license, the plan_user_count on their Org is not accurate - the seat count is held by the number_allowed_users field from the license.
Some self-hosted or DEC customers are getting a false positive on an alert that checks the seat count before allowing a user to view a repository, because the alert is using the plan_user_count field instead of the number_allowed_users field from their license.

Links to relevant tickets

https://github.com/codecov/internal-issues/issues/679

What does this PR do?

When checking plan_user_count in PlanService, check for a license, and if they have a license, return number_allowed_users as the value for plan_user_count. With this change, regular customers as well as self-hosted and DEC will get an accurate number back from PlanService - it will always return the paid seat count.

@nora-codecov nora-codecov requested a review from a team August 12, 2024 22:22
@nora-codecov nora-codecov requested a review from a team as a code owner August 12, 2024 22:22
@nora-codecov nora-codecov enabled auto-merge August 12, 2024 22:30
@nora-codecov nora-codecov added this pull request to the merge queue Aug 12, 2024
@codecov-notifications
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Aug 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.05%. Comparing base (d515dc3) to head (cf27007).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##               main       #747   +/-   ##
===========================================
  Coverage   96.05000   96.05000           
===========================================
  Files           814        814           
  Lines         18489      18493    +4     
===========================================
+ Hits          17760      17764    +4     
  Misses          729        729           
Flag Coverage Δ
unit 91.78% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.78% <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.

Merged via the queue into main with commit 163d8cb Aug 12, 2024
17 of 18 checks passed
@nora-codecov nora-codecov deleted the nora/bug branch August 12, 2024 22:42
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