Skip to content

Ignore projectid=-1 on Quota summary#13658

Merged
winterhazel merged 3 commits into
apache:mainfrom
winterhazel:ignore-projectid-on-quotasummary
Jul 22, 2026
Merged

Ignore projectid=-1 on Quota summary#13658
winterhazel merged 3 commits into
apache:mainfrom
winterhazel:ignore-projectid-on-quotasummary

Conversation

@winterhazel

Copy link
Copy Markdown
Member

Description

This fixes a minor bug in the Quota UI.

Enabling the projects toggle on any page makes the UI send projectid=-1 to APIs; however, this parameter makes the Quota summary page display an error. This is because a special handling for projectid=-1 was never implemented on quotaSummary, since it already returns entries for the accessible projects ever since it was introduced.

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Without the patch, I verified that enabling the projects toggle and switching to the Quota summary page would display an error.

Error when accessing the Quota summary page image

Applying these changes allows the Quota summary page to load as intended when repeating the same steps.

Quota summary page loaded successfully image

@winterhazel

Copy link
Copy Markdown
Member Author

@blueorangutan ui

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.64%. Comparing base (fc83241) to head (958551b).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...apache/cloudstack/api/command/QuotaSummaryCmd.java 40.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13658      +/-   ##
============================================
- Coverage     19.64%   19.64%   -0.01%     
+ Complexity    19789    19788       -1     
============================================
  Files          6368     6368              
  Lines        575109   575112       +3     
  Branches      70371    70372       +1     
============================================
- Hits         112994   112990       -4     
- Misses       449829   449835       +6     
- Partials      12286    12287       +1     
Flag Coverage Δ
uitests 3.41% <ø> (ø)
unittests 20.92% <40.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@winterhazel , would it make sense to have the quota summary page not show the project toggle instead?

Also, unknown parameters should be gracefully ignored in the API layer, can you show the logging for the call?

@GaOrtiga

Copy link
Copy Markdown
Collaborator

@winterhazel , would it make sense to have the quota summary page not show the project toggle instead?

Also, unknown parameters should be gracefully ignored in the API layer, can you show the logging for the call?

+1 on the second part
@winterhazel is there a reason to not add the handling directly on the API?

@winterhazel

Copy link
Copy Markdown
Member Author

@DaanHoogland and @GaOrtiga

@winterhazel , would it make sense to have the quota summary page not show the project toggle instead?

The project toggle is not shown in the Quota summary page. What happens is that toggling it in other pages and then switching to Quota summary makes the UI send projectid=-1 to the quotaSummary API.

Also, unknown parameters should be gracefully ignored in the API layer, can you show the logging for the call?

The API returns a Unable to find project with the specified ID because it tries to find a project with ID -1, as there is no special handling for projectid=-1.

@winterhazel is there a reason to not add the handling directly on the API?

Ever since the API was introduced, it already returns entries for the accessible projects by default. We did not add this handling in #10505 because there was no reason to, as the default response was not changed.


Btw, I am fine with both approaches. I will submit a new commit that turns providing projectid=-1 into a null operation. Please let me know which one you all prefer.

@winterhazel winterhazel changed the title ui: Do not send projectid=-1 on the Quota summary page Ignore projectid=-1 on Quota summary Jul 21, 2026
@winterhazel winterhazel added this to the 4.23.0 milestone Jul 21, 2026
@winterhazel

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@winterhazel
winterhazel force-pushed the ignore-projectid-on-quotasummary branch from a818b17 to 958551b Compare July 22, 2026 00:23
@blueorangutan

Copy link
Copy Markdown

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

@winterhazel

Copy link
Copy Markdown
Member Author

@blueorangutan package

@GaOrtiga GaOrtiga left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@winterhazel thank you for the explanation. I do prefer the latest approach (handling it in the API). Also CLTM

@bernardodemarco

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

@bernardodemarco

Copy link
Copy Markdown
Member

@winterhazel, just to document it here, I've just tested the PR and verified that the Quota summary page loads successfully now

@winterhazel
winterhazel merged commit 8148c53 into apache:main Jul 22, 2026
26 of 27 checks passed
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.

5 participants