Open
Conversation
Member
Author
|
@blueorangutan package |
|
@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12961 +/- ##
============================================
+ Coverage 18.00% 18.01% +0.01%
- Complexity 16455 16469 +14
============================================
Files 5976 5977 +1
Lines 537582 537552 -30
Branches 66006 65993 -13
============================================
+ Hits 96784 96864 +80
+ Misses 429885 429769 -116
- Partials 10913 10919 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17356 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, the
quotaBalanceAPI receives thestartdateandenddateparameters, and returns what an account's balance was only at the starting and end dates, alongside with some information about the credits added during that period. It is not possible to view how an account's balance changed through multiple days with a single API call, even though balance entries exist in the database containing this information. Also, returning the credits addition history is redundant, asquotaCreditsListalready exists and returns a more complete response, and inconsistent with the API's purpose (simply viewing an account's balance).Hence, this PR proposes changing the behavior of
quotaBalanceto allow seeing the complete history of an account/project's balance for the specified period, making it easier to address the 2nd suggestion of #11805. In addition, the credits addition history was removed from the API's response. UI changes will be done in a separate PR.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
I tested the API by fuzzing its parameters (
account,accountid,domainid,enddate,projectid,startdate) for root admin, domain admin, and user accounts. In the tests, I validated that the API returned the expected response while performing correct permission checking.Environment configuration
My environment had two domains:
ROOTandd1.Each domain had a domain admin (
drforROOTandd1ford1) and a user account (urforROOTandu1ford1).ROOTalso had a project and the root admin.Test 1 (user accounts)
No parameters: returns only the user account's last balance statement.
account: allows listing their own balance statements, but not the balance statements of other accounts.accountid: allows listing their own balance statements, but not the balance statements of other accounts.domainid: only lists their own balance statements. Returns an error when attempting to obtain the balance of another account. Unable to be used alone.startdateandenddate: filters balance statements correctly, only returning the calling account's own statements.enddatebeforestartdate: returns an error.(u1) 🐱 > quota balance startdate=2026-03-02 enddate=2026-03-01 🙈 Error: (HTTP 431, error code 4350) The start date cannot be after the end date.projectid: user accounts can only obtain balance statements for projects they belong to.projectidcombined withaccountid: returns an error since these parameters cannot be specified together.(ur) 🐱 > quota balance projectid=c1ce41c4-7b01-4386-8264-479db5ace0bc accountid=b029e8b8-e539-4d1a-906d-3d4f2fb36b82 🙈 Error: (HTTP 431, error code 9999) Project and account can not be specified together.Test 2 (domain admins)
No parameters: returns their last balance statement.
account: allows listing balance statements of accounts belonging to their domain, but not accounts from other domains.accountid: allows listing balance statements of accounts belonging to their domain, but not accounts from other domains.domainid: allows listing balance statements of accounts in their domain, but returns an error for accounts outside it.startdateandenddate: filters balance statements correctly.projectid: allows listing balance statements for projects belonging to their domain, but returns an error for projects outside it.projectidcombined withaccountid: returns an error.(dr) 🐱 > quota balance projectid=c1ce41c4-7b01-4386-8264-479db5ace0bc accountid=aaba75a0-a575-41be-80e1-dbea14c10e51 🙈 Error: (HTTP 431, error code 9999) Project and account can not be specified together.Test 3 (root admins)
No parameters: returns their last balance statement.
account: allows listing balance statements of all accounts.accountid: allows listing balance statements of all accounts.domainid: allows listing balance statements for accounts in all domains.startdateandenddate: filters balance statements correctly.projectid: allows listing balance statements for all projects in the environment.