Skip to content

Conversation

@julien-vaz
Copy link
Contributor

@julien-vaz julien-vaz commented Mar 5, 2025

Description

The quotaSummary API has abstract behaviors and codes, as well as return values not aligned with its purposes. Furthermore, when the account is a project, no information is returned.

Also, in the UI, when opening the Quota Summary details for accounts who owned removed domains, the CloudStack launches an error to the user.

Therefore, this PR:

  • improves the API's behavior and return values;
  • adds information for project accounts (through parameter listall=true);
  • adds information for accounts/domains which have been already removed and a filter for accounts in the UI;

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 I called quotaSummary API and checked the return value:

  • only relevant information about the summaries is being displayed;
  • accounts and domains which have been removed are especified in the summary;
  • project accounts are also being considered by the API.

On the UI, the filter for removed accounts is working properly.

@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 12665

@codecov
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.63%. Comparing base (3a28a87) to head (ba99ec8).
⚠️ Report is 675 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (3a28a87) and HEAD (ba99ec8). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (3a28a87) HEAD (ba99ec8)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               main   #10505       +/-   ##
=============================================
- Coverage     16.15%    3.63%   -12.53%     
=============================================
  Files          5666      441     -5225     
  Lines        498081    37019   -461062     
  Branches      60267     6785    -53482     
=============================================
- Hits          80475     1345    -79130     
+ Misses       408593    35513   -373080     
+ Partials       9013      161     -8852     
Flag Coverage Δ
uitests 3.63% <ø> (-0.37%) ⬇️
unittests ?

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 12690

@julien-vaz
Copy link
Contributor Author

julien-vaz commented Mar 11, 2025

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 12739

@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 12743

…/command/QuotaSummaryCmd.java

Co-authored-by: Fabricio Duarte <[email protected]>
@bernardodemarco bernardodemarco self-requested a review June 4, 2025 17:39
@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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.

@julien-vaz
Copy link
Contributor Author

I still need to work on projectid behavior, but accountid and domainid are working properly.

@DaanHoogland DaanHoogland modified the milestones: 4.21.0, 4.22.0 Aug 8, 2025
@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 14583

@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 14755

@DaanHoogland
Copy link
Contributor

@julien-vaz :

17:48:34 [ERROR] /jenkins/workspace/acs-centos8-pkg-builder/dist/rpmbuild/BUILD/cloudstack-4.22.0.0-SNAPSHOT/plugins/database/quota/src/test/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImplTest.java:72:8: Unused import - org.apache.commons.compress.utils.Sets. [UnusedImports]

@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 14821

@harikrishna-patnala
Copy link
Contributor

@julien-vaz There is still failure in the build, can you please fix it and suggest how far this PR is ready, has this been tested recently ?

Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

Thanks @julien-vaz, some comments from my review

}
}

return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Possibly also add a StringUtils.isBlank(value) check and return null in that case before the for loop?

sc.setParameters("id", parentId, childId);

List<DomainVO> domainPair = listBy(sc);
List<DomainVO> domainPair = listIncludingRemovedBy(sc);
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I'm not clear why should removed domains should be considered?

QuotaService quotaService;

@ACL
@Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, description = "ID of the account for which balance will be listed. Can not be specified with projectId.", since = "4.21.0")
Copy link
Contributor

Choose a reason for hiding this comment

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

Since parameter needs updating :)

super();
}
@ACL
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "Project Id for which balance will be listed. Can not be specified with accountId.", since = "4.21.0")
Copy link
Contributor

Choose a reason for hiding this comment

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

Also here

private Long projectId;

@Override
public void execute() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this method include some pre-checks for accountId vs projectId parameters?

* Returns the Id of the account that will be used when provided with either accountId, projectId or accountName and domainId.
*/
@Override
public Long finalizeAccountId(Long accountId, String accountName, Long domainId, Long projectId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this logic could be extracted into submethods

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

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.

9 participants