Skip to content

[WIP] Configuration settings validation improvements - #10998

Draft
sureshanaparti wants to merge 1 commit into
apache:4.19from
shapeblue:configs-update
Draft

sureshanaparti wants to merge 1 commit into
apache:4.19from
shapeblue:configs-update

Conversation

@sureshanaparti

@sureshanaparti sureshanaparti commented Jun 10, 2025 •

Copy link
Copy Markdown
Contributor

Description

This PR improves configuration settings validation and some code refactoring.

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?

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

@sureshanaparti

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Jun 10, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.02564% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.17%. Comparing base (a208db5) to head (dfab15b).

Files with missing lines Patch % Lines
.../cloud/configuration/ConfigurationManagerImpl.java 35.29% 20 Missing and 2 partials ⚠️
...om/cloud/network/firewall/FirewallManagerImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              4.19   #10998       +/-   ##
============================================
+ Coverage     4.28%   15.17%   +10.89%     
- Complexity       0    11367    +11367     
============================================
  Files          372     5416     +5044     
  Lines        29745   476105   +446360     
  Branches      5229    58134    +52905     
============================================
+ Hits          1275    72270    +70995     
- Misses       28324   395744   +367420     
- Partials       146     8091     +7945     
Flag Coverage Δ
uitests 4.28% <ø> (ø)
unittests 15.90% <41.02%> (?)

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.

@blueorangutan

Copy link
Copy Markdown

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

@sureshanaparti
sureshanaparti requested a review from Copilot June 10, 2025 12:03

Copilot AI 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.

Pull Request Overview

This PR enhances configuration settings validation and cleans up redundant configuration declarations, while refactoring related validation logic. Key changes include:

  • Removal of duplicate configuration keys and unused variables.
  • Improvements in type handling, especially for Boolean and Double values.
  • Refactoring of configuration value parsing by introducing a helper method for consistent error messaging.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
server/src/main/java/com/cloud/storage/ImageStoreServiceImpl.java Removed unused ConfigKey and variable declarations for image storage imbalance threshold.
server/src/main/java/com/cloud/network/firewall/FirewallManagerImpl.java Updated Boolean parsing to better handle null values.
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java Refactored configuration validation logic with a new helper method; added range checking for Double values.
server/src/main/java/com/cloud/configuration/Config.java Updated configuration type for load balancer enabled flag from String to Boolean.
plugins/database/quota/.../QuotaResponseBuilderImpl.java Adjusted config value handling to use Boolean directly.
framework/quota/.../QuotaConfig.java Updated types for quota configuration keys from String to Boolean.
engine/orchestration/.../StorageOrchestrator.java Removed redundant configuration key declaration.
engine/api/.../StorageOrchestrationService.java Centralized declaration of image store imbalance threshold via the interface.

if (type.equals(Double.class)) {
try {
final Double val = Double.parseDouble(value);
if (weightBasedParametersForValidation.contains(name) && (val < 0f || val > 1f)) {

Copilot AI Jun 10, 2025

Copy link

Choose a reason for hiding this comment

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

Consider using double literals (0.0 and 1.0) instead of float literals (0f and 1f) for clarity when comparing Double values.

Suggested change
if (weightBasedParametersForValidation.contains(name) && (val < 0f || val > 1f)) {
if (weightBasedParametersForValidation.contains(name) && (val < 0.0 || val > 1.0)) {

Copilot uses AI. Check for mistakes.
@sureshanaparti sureshanaparti changed the title Configuration settings validation improvements [WIP] Configuration settings validation improvements Sep 15, 2025
@DaanHoogland

Copy link
Copy Markdown
Contributor

@sureshanaparti do you still want to continue with this?

@weizhouapache weizhouapache added this to the 4.24.0 milestone Jun 29, 2026
@nvazquez

Copy link
Copy Markdown
Contributor

Hi @sureshanaparti is this PR still in progress?

@DaanHoogland DaanHoogland moved this from Backlog to conflict/waiting for author in CloudStack Testing Aug 31, 2026
@nvazquez nvazquez modified the milestones: 24.0, 25.0 Oct 27, 2026

This branch has not been deployed

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

Projects

Status: conflict/waiting

Development

Successfully merging this pull request may close these issues.

7 participants