Skip to content

api: fix ProjectResponse.setVpcLimit assigning the network limit - #14022

Open
nagaboinaramgopal wants to merge 1 commit into
apache:4.20from
nagaboinaramgopal:fix/projectresponse-vpclimit
Open

api: fix ProjectResponse.setVpcLimit assigning the network limit#14022
nagaboinaramgopal wants to merge 1 commit into
apache:4.20from
nagaboinaramgopal:fix/projectresponse-vpclimit

Conversation

@nagaboinaramgopal

Copy link
Copy Markdown

Description

ProjectResponse.setVpcLimit(String vpcLimit) ignored its argument and assigned
the networkLimit field instead:

public void setVpcLimit(String vpcLimit) {
    this.vpcLimit = networkLimit;   // should be vpcLimit
}

Actual behaviour: listProjects reports a project's vpclimit equal to its
networklimit (and null if setVpcLimit runs before setNetworkLimit).
Expected behaviour: vpclimit reflects 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 vpcLimit parameter.

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

  • Added a unit test (ProjectResponseTest) asserting setVpcLimit stores its own
    value and leaves networkLimit untouched.
  • Built standard .deb packages and deployed a KVM advanced zone; confirmed
    listProjects returns the correct, independent vpclimit.

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 listProjects
that vpclimit reflects the VPC limit — including when the VPC limit is set
before the network limit.

@boring-cyborg

boring-cyborg Bot commented Sep 1, 2026

Copy link
Copy Markdown

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)
Here are some useful points:

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clgtm

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 19.78%. Comparing base (2cd8c5e) to head (7f5229e).

Files with missing lines Patch % Lines
...pache/cloudstack/api/response/ProjectResponse.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #14022      +/-   ##
============================================
+ Coverage     16.34%   19.78%   +3.43%     
- Complexity    13574    19996    +6422     
============================================
  Files          5669     6371     +702     
  Lines        501368   575899   +74531     
  Branches      60903    70495    +9592     
============================================
+ Hits          81964   113944   +31980     
- Misses       410219   449536   +39317     
- Partials       9185    12419    +3234     
Flag Coverage Δ
uitests 3.53% <ø> (-0.62%) ⬇️
unittests 21.05% <0.00%> (+3.85%) ⬆️

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.

@shwstppr

shwstppr commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr 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 19085

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.
@nagaboinaramgopal
nagaboinaramgopal force-pushed the fix/projectresponse-vpclimit branch from f00e6b0 to 7f5229e Compare September 3, 2026 17:13
@nagaboinaramgopal
nagaboinaramgopal changed the base branch from main to 4.20 September 3, 2026 17:49
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

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

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

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

4 participants