Skip to content

Conversation

hsato03
Copy link
Collaborator

@hsato03 hsato03 commented Sep 19, 2025

Description

This PR aims to add two new preset variables for Network type Quota tariffs: value.resourceCounting.runningVms and value.resourceCounting.stoppedVms.

They represent the number of user instances that have a NIC on the network being processed. The preset variable value.resourceCounting.runningVms refers to the number of running instances, and value.resourceCounting.stoppedVms refers to the number of stopped instances.

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

I created 3 VMs on the same guest network (2 of them in running state and 1 in stopped state), then I created a Network Quota tariff with the following activation rule:

if (value.resourceCounting.runningVms == 2 && value.resourceCounting.stoppedVms == 1) {
300
} else {
0
}

I called the quotaUpdate API via CMK and verified that the value 300 was being returned when executing the activation rule.

How did you try to break this feature and the system with this change?

@hsato03
Copy link
Collaborator Author

hsato03 commented Sep 19, 2025

@blueorangutan package

@blueorangutan
Copy link

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

Copy link

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 2.94118% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.39%. Comparing base (e6c7a71) to head (e44b6d9).
⚠️ Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
...tivationrule/presetvariables/ResourceCounting.java 0.00% 16 Missing ⚠️
...tionrule/presetvariables/PresetVariableHelper.java 0.00% 10 Missing ⚠️
...ck/quota/activationrule/presetvariables/Value.java 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11689      +/-   ##
============================================
- Coverage     17.39%   17.39%   -0.01%     
  Complexity    15283    15283              
============================================
  Files          5889     5890       +1     
  Lines        526184   526217      +33     
  Branches      64242    64242              
============================================
  Hits          91542    91542              
- Misses       424298   424331      +33     
  Partials      10344    10344              
Flag Coverage Δ
uitests 3.62% <ø> (ø)
unittests 18.44% <2.94%> (-0.01%) ⬇️

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.

@blueorangutan
Copy link

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

Copy link
Member

@bernardodemarco bernardodemarco left a comment

Choose a reason for hiding this comment

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

code lgtm, did not test it

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.

3 participants