-
Notifications
You must be signed in to change notification settings - Fork 10
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 plan_activated_users count for an installation #132
Conversation
Codecov Report
@@ Coverage Diff @@
## main #132 +/- ##
=======================================
Coverage 98.40% 98.40%
=======================================
Files 373 373
Lines 27692 27717 +25
=======================================
+ Hits 27251 27276 +25
Misses 441 441
Flags with carried forward coverage won't be shown. Click here to find out more.
This change has been scanned for critical changes. Learn more |
Codecov Report
@@ Coverage Diff @@
## main #132 +/- ##
=======================================
Coverage ? 93.25%
=======================================
Files ? 346
Lines ? 26910
Branches ? 0
=======================================
Hits ? 25096
Misses ? 1814
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #132 +/- ##
=======================================
Coverage 98.44% 98.44%
=======================================
Files 347 347
Lines 27196 27221 +25
=======================================
+ Hits 26774 26799 +25
Misses 422 422
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov Report
@@ Coverage Diff @@
## main #132 +/- ##
=======================================
Coverage 98.44% 98.44%
=======================================
Files 347 347
Lines 27196 27221 +25
=======================================
+ Hits 26774 26799 +25
Misses 422 422
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix looks fine from the ticket description. I'm having a hard time understanding how the test relates. Asked some clarifying questions (thanks for indulging me 😅)
dbsession.add(org_second) | ||
dbsession.flush() | ||
|
||
encrypted_license = "wxWEJyYgIcFpi6nBSyKQZQeaQ9Eqpo3SXyUomAqQOzOFjdYB3A8fFM1rm+kOt2ehy9w95AzrQqrqfxi9HJIb2zLOMOB9tSy52OykVCzFtKPBNsXU/y5pQKOfV7iI3w9CHFh3tDwSwgjg8UsMXwQPOhrpvl2GdHpwEhFdaM2O3vY7iElFgZfk5D9E7qEnp+WysQwHKxDeKLI7jWCnBCBJLDjBJRSz0H7AfU55RQDqtTrnR+rsLDHOzJ80/VxwVYhb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How many seats does this license allows for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a comment to the code
@@ -89,11 +88,57 @@ def test_activate_user_success_for_enterprise_pr_billing( | |||
dbsession.commit() | |||
assert user.ownerid in org.plan_activated_users | |||
|
|||
def test_activate_user_success_user_org_overlap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this test case.
I looks like you are creating 2 orgs with 5 seats taken each. Idk how many total seats this installation (self-hosted) can have. But it seems that all owners of the 2 orgs are distinct (e.g. with different IDs)
So the total count of seats used is 10, and you create a new owner to prove that we can extend that.
Is that the idea?
(assuming I'm correct - which I might very well not be)
What I'd like to see:
- Call
get_installation_plan_activated_users
explicitly to see what users are activated (before and after creating the new user) - Have some overlap on the plan_activated_users across the orgs (cause that was the original problem, right?)
69aa03b
to
15c90b5
Compare
Signed-off-by: joseph-sentry <[email protected]>
… in multiple orgs Signed-off-by: joseph-sentry <[email protected]>
Signed-off-by: joseph-sentry <[email protected]>
Signed-off-by: joseph-sentry <[email protected]>
15c90b5
to
6c00d0f
Compare
this PR changes the behaviour of
get_installation_plan_activated_users
to no longer count one user in multiple orgs as multiple users to match the behaviour in the APIFixes: #121