api: fix ProjectResponse.setVpcLimit assigning the network limit - #14022
Open
nagaboinaramgopal wants to merge 1 commit into
Open
api: fix ProjectResponse.setVpcLimit assigning the network limit#14022nagaboinaramgopal wants to merge 1 commit into
nagaboinaramgopal wants to merge 1 commit into
Conversation
setVpcLimit ignored its parameter and copied the networkLimit field into vpcLimit (this.vpcLimit = networkLimit), so a projects reported vpclimit always mirrored its networklimit instead of the real VPC limit (and would be null if setVpcLimit ran before setNetworkLimit). The sibling setters all assign their own parameter. Assign the vpcLimit parameter. Adds a regression test asserting setVpcLimit stores its own value and leaves networkLimit untouched.
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14022 +/- ##
=========================================
Coverage 19.73% 19.73%
- Complexity 19955 19959 +4
=========================================
Files 6371 6371
Lines 575784 575784
Branches 70478 70478
=========================================
+ Hits 113632 113657 +25
+ Misses 449805 449774 -31
- Partials 12347 12353 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
ProjectResponse.setVpcLimit(String vpcLimit)ignored its argument and assignedthe
networkLimitfield instead:Actual behaviour:
listProjectsreports a project'svpclimitequal to itsnetworklimit(andnullifsetVpcLimitruns beforesetNetworkLimit).Expected behaviour:
vpclimitreflects the project's real VPC limit,independent of the network limit.
Every sibling setter in the class assigns its own parameter; this one was a
copy-paste slip. Fix: assign the
vpcLimitparameter.Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
ProjectResponseTest) assertingsetVpcLimitstores its ownvalue and leaves
networkLimituntouched..debpackages and deployed a KVM advanced zone; confirmedlistProjectsreturns the correct, independentvpclimit.How did you try to break this feature and the system with this change?
Set different network and VPC limits on a project and verified via
listProjectsthat
vpclimitreflects the VPC limit — including when the VPC limit is setbefore the network limit.