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

Improve Quota Statement #10506

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

julien-vaz
Copy link
Contributor

Description

In the current version, the quotaStatement API is returning the internal ID for account and domain, which is not useful for users, since all APIs use/return the UUID. Also, when the usage_type parameter is informed, the API shows dummy records.

To address those problems:

  • the API was modified so it returns the resources' UUID;
  • the dummy records bug was fixed;
  • a new parameter showresources was added to display more information to the user about each usage type;
  • a new quotaStatementDetails API was created to list more details about each usage type;

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

On CloudMonkey the quotaStatement API was called and:

  • the resources' UUID was returned instead of the internal ID;
  • when specified a usage_type no dummy records were showed;
  • the showresources parameter is properly working;

The quotaStatementDetails API was called successfully as well.

@julien-vaz
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@julien-vaz a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12669

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 18.96104% with 312 lines in your changes missing coverage. Please review.

Project coverage is 16.27%. Comparing base (69cf299) to head (0a996dc).
Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
...udstack/api/response/QuotaResponseBuilderImpl.java 20.15% 102 Missing and 1 partial ⚠️
...g/apache/cloudstack/quota/vo/QuotaUsageJoinVO.java 35.41% 62 Missing ⚠️
...he/cloudstack/quota/dao/QuotaUsageJoinDaoImpl.java 0.00% 37 Missing ⚠️
...apache/cloudstack/quota/vo/QuotaUsageDetailVO.java 0.00% 31 Missing ⚠️
...ache/cloudstack/quota/vo/QuotaUsageResourceVO.java 0.00% 27 Missing ⚠️
.../cloudstack/quota/dao/QuotaUsageDetailDaoImpl.java 0.00% 15 Missing ⚠️
...i/response/QuotaStatementItemResourceResponse.java 0.00% 13 Missing ⚠️
...loudstack/api/response/QuotaStatementResponse.java 22.22% 7 Missing ⚠️
...ache/cloudstack/api/command/QuotaStatementCmd.java 40.00% 6 Missing ⚠️
...c/main/java/com/cloud/user/dao/AccountDaoImpl.java 0.00% 5 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10506      +/-   ##
============================================
+ Coverage     16.15%   16.27%   +0.11%     
- Complexity    13273    13400     +127     
============================================
  Files          5666     5680      +14     
  Lines        498081   499211    +1130     
  Branches      60267    60359      +92     
============================================
+ Hits          80475    81251     +776     
- Misses       408593   408923     +330     
- Partials       9013     9037      +24     
Flag Coverage Δ
uitests 3.99% <ø> (-0.01%) ⬇️
unittests 17.13% <18.96%> (+0.12%) ⬆️

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.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@winterhazel winterhazel self-requested a review March 6, 2025 13:06
@julien-vaz
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@julien-vaz a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12689

@julien-vaz
Copy link
Contributor Author

I've just successfully builded the packages locally with -Dnoredist. Therefore, I'm requesting the package building again

@julien-vaz
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@julien-vaz a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12742

@Inject
private QuotaResponseBuilder _responseBuilder;
protected QuotaResponseBuilder responseBuilder;
Copy link
Contributor

Choose a reason for hiding this comment

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

default scope seems more apropriate for injected objects, Why is it protected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But the default scope is protected indeed... It's the same thing as not having the scope definition

Copy link
Contributor

Choose a reason for hiding this comment

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

no, protected can go outside the package , default is package scope.

Copy link
Contributor

Choose a reason for hiding this comment

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

meaning btw that default allows a test class in the same package to reach it, but not a child class from another package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants