Skip to content

Fix Quota plugin state on QuotaSummaryResponse#7257

Merged
DaanHoogland merged 2 commits intoapache:mainfrom
scclouds:fix-pr-6690
Feb 22, 2023
Merged

Fix Quota plugin state on QuotaSummaryResponse#7257
DaanHoogland merged 2 commits intoapache:mainfrom
scclouds:fix-pr-6690

Conversation

@BryanMLima
Copy link
Copy Markdown
Contributor

Description

This PR aims to fix a feature introduced in PR#6690. It was added the parameter quotaenabled to the response of the Quota Summary API. However, this parameter was not set, and thus, always returned false. This PR fix this behavior, returning the correct value according to the configuration value.

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

This was tested in a local lab with user dom01 with the Quota plugin enabled and with user dom02 with the plugin disabled. The image below presents the correct behavior for Quota summary response.

image

@BryanMLima
Copy link
Copy Markdown
Contributor Author

Hey @DaanHoogland, this is the one line PR fix mentioned in the mailing list.

@DaanHoogland DaanHoogland added this to the 4.18.0.0 milestone Feb 17, 2023
@DaanHoogland
Copy link
Copy Markdown
Contributor

Looks trivial @BryanMLima . Is this covered by an existing test? Or can we add a trivial test or assert somewhere?

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 17, 2023

Codecov Report

Merging #7257 (ab7a8a8) into main (597a803) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #7257      +/-   ##
============================================
+ Coverage     12.67%   12.69%   +0.01%     
- Complexity     8639     8655      +16     
============================================
  Files          2716     2716              
  Lines        256112   256112              
  Branches      39926    39926              
============================================
+ Hits          32456    32503      +47     
+ Misses       219528   219477      -51     
- Partials       4128     4132       +4     
Impacted Files Coverage Δ
...udstack/api/response/QuotaResponseBuilderImpl.java 39.05% <100.00%> (+5.22%) ⬆️
...ervisor/kvm/resource/LibvirtComputingResource.java 18.30% <0.00%> (-0.04%) ⬇️
...com/cloud/agent/manager/ConnectedAgentAttache.java 37.50% <0.00%> (+12.50%) ⬆️
.../cloudstack/api/response/QuotaSummaryResponse.java 67.56% <0.00%> (+67.56%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Copy Markdown
Contributor

@stephankruggg stephankruggg left a comment

Choose a reason for hiding this comment

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

CLGTM, not manually tested

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Feb 20, 2023

Didn't check/test this, but clgtm

@DaanHoogland
Copy link
Copy Markdown
Contributor

@BryanMLima , I'd love to add this but at this stage I really want some prove included

Looks trivial @BryanMLima . Is this covered by an existing test? Or can we add a trivial test or assert somewhere?

@BryanMLima
Copy link
Copy Markdown
Contributor Author

@BryanMLima , I'd love to add this but at this stage I really want some prove included

Looks trivial @BryanMLima . Is this covered by an existing test? Or can we add a trivial test or assert somewhere?

Sorry for the delay, I am taking a look in to this. I will probably add a integration test in test_quota.py.

@DaanHoogland
Copy link
Copy Markdown
Contributor

@BryanMLima , I'd love to add this but at this stage I really want some prove included

Looks trivial @BryanMLima . Is this covered by an existing test? Or can we add a trivial test or assert somewhere?

Sorry for the delay, I am taking a look in to this. I will probably add a integration test in test_quota.py.

seems like overkill for this @BryanMLima . As only a response field is added it would suffice to assert its presence in an existing test.

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a 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
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5627

@DaanHoogland DaanHoogland merged commit c8ee0e7 into apache:main Feb 22, 2023
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