Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept case insensitive values in boolean settings #10663

Open
wants to merge 1 commit into
base: 4.20
Choose a base branch
from

Conversation

bernardodemarco
Copy link
Collaborator

Description

Currently, when updating boolean settings, the Management Server performs a case sensitive validation of the inserted values. Thus, only the true and false values are accepted.

This PR proposes to extend this validation to encompass case insensitive boolean values. Therefore, values such as True and FALSE will be accepted and will be properly normalized before being persisted in the database.

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

Screenshots (if appropriate):

How Has This Been Tested?

  • Verified that it was possible to update the quota.enable.service global setting to FaLsE.
updateConfiguration API execution
(acs-all-in-one) 🦌 > update configuration name="quota.enable.service" value="FaLsE"
{
  "configuration": {
    "category": "Advanced",
    "component": "QUOTA-PLUGIN",
    "defaultvalue": "false",
    "description": "Indicates whether Quota plugin is enabled or not.",
    "displaytext": "Quota enable service",
    "group": "Miscellaneous",
    "isdynamic": true,
    "name": "quota.enable.service",
    "subgroup": "Quota",
    "type": "Boolean",
    "value": "FaLsE"
  }
}
Persisted configuration value in the database
MariaDB [cloud]> select name,value from configuration where name = "quota.enable.service";
+----------------------+-------+
| name                 | value |
+----------------------+-------+
| quota.enable.service | false |
+----------------------+-------+
1 row in set (0.000 sec)
  • Verified that it was possible to update the setting value to TRUe:
updateConfiguration API execution
(acs-all-in-one) 🐓 > update configuration name="quota.enable.service" value="TRUe"
{
  "configuration": {
    "category": "Advanced",
    "component": "QUOTA-PLUGIN",
    "defaultvalue": "false",
    "description": "Indicates whether Quota plugin is enabled or not.",
    "displaytext": "Quota enable service",
    "group": "Miscellaneous",
    "isdynamic": true,
    "name": "quota.enable.service",
    "subgroup": "Quota",
    "type": "Boolean",
    "value": "TRUe"
  }
}
Persisted configuration value in the database
MariaDB [cloud]> select name,value from configuration where name = "quota.enable.service";
+----------------------+-------+
| name                 | value |
+----------------------+-------+
| quota.enable.service | true  |
+----------------------+-------+
1 row in set (0.000 sec)

@bernardodemarco
Copy link
Collaborator Author

@blueorangutan package

@bernardodemarco bernardodemarco added this to the 4.20.1 milestone Apr 4, 2025
@blueorangutan
Copy link

@bernardodemarco 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 Apr 4, 2025

Codecov Report

Attention: Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.

Project coverage is 16.02%. Comparing base (bc5728a) to head (908ed4e).

Files with missing lines Patch % Lines
.../cloud/configuration/ConfigurationManagerImpl.java 80.95% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #10663      +/-   ##
============================================
+ Coverage     16.01%   16.02%   +0.01%     
- Complexity    13111    13133      +22     
============================================
  Files          5651     5651              
  Lines        495858   495853       -5     
  Branches      60048    60047       -1     
============================================
+ Hits          79404    79457      +53     
+ Misses       407593   407535      -58     
  Partials       8861     8861              
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 16.86% <80.95%> (+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 ✔️ debian ✔️ suse15. SL-JID 12955

@winterhazel winterhazel self-requested a review April 5, 2025 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants