Skip to content

Conversation

@bernardodemarco
Copy link
Member

@bernardodemarco bernardodemarco commented Apr 29, 2025

Description

Currently, the value parameter of the updateConfiguration API is not required. Thus, when the API is executed and the value parameter is not specified, the attributes of the configuration set by the name parameter are returned.

updateConfiguration API call without specifying the value parameter
> update configuration name="quota.enable.service"
{
  "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"
  }
}

As a consequence of that, when managing global configuration through the UI, for instance, when a configuration value is cleared and updated with a blank value, the UI sends the API call without the value parameter. Since the UI receives a successful response from the backend, it notifies the user that the setting was successfully updated, which does not actually happens.

Additionally, since that the updateConfiguration API is an API to update a resource, it should not be used to list resource details. Currently, however, it is possible to achieve such action through the API.

Therefore, aiming to improve UX, avoid possible inconsistent behaviors and maintain a semantic consistency between the API name and its actual behavior, this PR proposes to change the value parameter of the updateConfiguration API to be required.

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?

  • Executed the updateConfiguration API through Cloudmonkey, without specifying the value parameter, and the following API response was returned:
> update configuration name="quota.enable.service"
Missing required parameters:  value
  • Accessed the global settings page, updated the account.cleanup.interval configuration to a blank value and verified that a semantic error message was returned:

image

@bernardodemarco
Copy link
Member Author

@blueorangutan package

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

@codecov
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.56%. Comparing base (3d6cafe) to head (fb158ea).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
.../cloud/configuration/ConfigurationManagerImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #10790   +/-   ##
=========================================
  Coverage     17.56%   17.56%           
- Complexity    15543    15544    +1     
=========================================
  Files          5909     5909           
  Lines        529056   529056           
  Branches      64617    64617           
=========================================
+ Hits          92941    92947    +6     
+ Misses       425661   425655    -6     
  Partials      10454    10454           
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.63% <0.00%> (+<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 13217

Copy link
Contributor

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

@DaanHoogland
Copy link
Contributor

@bernardodemarco , this means that no configuration value can be set to be empty anymore. I can think of some instances an operator would want to do such a think (like a default ldap setting (basedn or so). Is this still possible with your change?

@bernardodemarco
Copy link
Member Author

@DaanHoogland, yes, it is possible. This change only encompass scenarios in which the value parameter is not included in the API request. For instance:

(all-in-one) 🐱 > update configuration name='alert.email.addresses'

Currently, the Management Server handles this situation by only returning the configuration details:

(all-in-one) 🐱 > update configuration name='alert.email.addresses'
{
  "configuration": {
    "category": "Alert",
    "component": "management-server",
    "description": "Comma separated list of email addresses which are going to receive alert emails.",
    "displaytext": "Alert email addresses",
    "group": "Management Server",
    "isdynamic": false,
    "name": "alert.email.addresses",
    "subgroup": "Alerts",
    "type": "CSV"
  }
}

When performing such API calls, the value of the configuration is not changed. To set its value to be empty, the operator needs to explicitly set the value parameter to an empty string:

(all-in-one) 🐱 > update configuration name='alert.email.addresses' value=''
{
  "configuration": {
    "category": "Alert",
    "component": "management-server",
    "description": "Comma separated list of email addresses which are going to receive alert emails.",
    "displaytext": "Alert email addresses",
    "group": "Management Server",
    "isdynamic": false,
    "name": "alert.email.addresses",
    "subgroup": "Alerts",
    "type": "CSV",
    "value": ""
  }
}

However, I've just realized that, through the UI, it is indeed a little bit awkward for the operator to clear a configuration value. It's required to clear the input field, add an empty space and submit the changes. I'll apply some UI adjustments to enhance UX there

@bernardodemarco
Copy link
Member Author

@DaanHoogland, I've just committed this one 01d7c6e

Now, operators are able to clean up configuration values (i.e. set its value to NULL on the DB) for the configurations with type equal to CSV, Order, WhitespaceSeparatedListWithOptions and String.

  • String configuration type:

    2025-04-30.11-36-41.mp4
  • Order configuration type:

    2025-04-30.11-38-33.mp4
  • CSV configuration type:

    2025-04-30.11-39-27.mp4
  • WhitespaceSeparatedListWithOptions configuration type:

    2025-04-30.11-41-21.mp4

@bernardodemarco
Copy link
Member Author

@DaanHoogland, I’ve identified a possible inconsistency with configurations that accept lists of values (such as those of type CSV). Their default value is an empty string, so when the resetConfiguration API is called, the value is reset to an empty string, as expected.

However, when the updateConfiguration API is used with the value parameter set to an empty string, the Management Server currently stores NULL for the configuration in the database. I believe this could lead to bugs down the line, such as potential NPEs.

I suggest opening a separate issue and PR to address this behavior, as it's not directly related to the scope of this PR. What do you guys think? (cc. @winterhazel, @JoaoJandre, @sureshanaparti)

@bernardodemarco bernardodemarco force-pushed the make-value-param-required-update-configuration branch from eae9d7b to a66ebe4 Compare April 30, 2025 16:43
@JoaoJandre
Copy link
Contributor

@bernardodemarco +1 on separate issue.

@winterhazel
Copy link
Member

I suggest opening a separate issue and PR to address this behavior, as it's not directly related to the scope of this PR. What do you guys think? (cc. @winterhazel, @JoaoJandre, @sureshanaparti)

@bernardodemarco addressing it separately seems better for me.

@DaanHoogland
Copy link
Contributor

fine by me

@bernardodemarco
Copy link
Member Author

Okay, I've just mapped that in a separate issue, vide #10823

@JoaoJandre
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@JoaoJandre 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

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

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-13235)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 52210 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10790-t13235-kvm-ol8.zip
Smoke tests completed. 138 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_UpdateConfigParamWithScope Error 0.09 test_global_settings.py
test_01_deploy_vm_with_extraconfig_throws_exception_kvm Error 0.07 test_deploy_vm_extra_config_data.py
test_02_deploy_vm_with_extraconfig_kvm Error 69.54 test_deploy_vm_extra_config_data.py
test_03_update_vm_with_extraconfig_kvm Error 143.61 test_deploy_vm_extra_config_data.py
test_01_migrate_vm_strict_tags_success Error 0.07 test_vm_strict_host_tags.py
test_02_migrate_vm_strict_tags_failure Error 0.06 test_vm_strict_host_tags.py
ContextSuite context=TestMigrateVMStrictTags>:teardown Error 0.13 test_vm_strict_host_tags.py
test_01_restore_vm_strict_tags_success Error 0.05 test_vm_strict_host_tags.py
test_02_restore_vm_strict_tags_failure Error 0.05 test_vm_strict_host_tags.py
ContextSuite context=TestRestoreVMStrictTags>:teardown Error 0.09 test_vm_strict_host_tags.py
test_01_scale_vm_strict_tags_success Error 0.06 test_vm_strict_host_tags.py
test_02_scale_vm_strict_tags_failure Error 0.06 test_vm_strict_host_tags.py
ContextSuite context=TestScaleVMStrictTags>:teardown Error 0.10 test_vm_strict_host_tags.py
test_01_deploy_vm_on_specific_host_without_strict_tags Error 0.06 test_vm_strict_host_tags.py
test_02_deploy_vm_on_any_host_without_strict_tags Error 0.07 test_vm_strict_host_tags.py
test_03_deploy_vm_on_specific_host_with_strict_tags_success Error 0.06 test_vm_strict_host_tags.py
test_04_deploy_vm_on_any_host_with_strict_tags_success Error 0.05 test_vm_strict_host_tags.py
test_05_deploy_vm_on_specific_host_with_strict_tags_failure Error 0.05 test_vm_strict_host_tags.py
test_06_deploy_vm_on_any_host_with_strict_tags_failure Error 0.05 test_vm_strict_host_tags.py
ContextSuite context=TestVMDeploymentPlannerStrictTags>:teardown Error 0.10 test_vm_strict_host_tags.py

@DaanHoogland
Copy link
Contributor

[SF] Trillian test result (tid-13235) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 52210 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10790-t13235-kvm-ol8.zip Smoke tests completed. 138 look OK, 3 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_UpdateConfigParamWithScope Error 0.09 test_global_settings.py
test_01_deploy_vm_with_extraconfig_throws_exception_kvm Error 0.07 test_deploy_vm_extra_config_data.py
test_02_deploy_vm_with_extraconfig_kvm Error 69.54 test_deploy_vm_extra_config_data.py
test_03_update_vm_with_extraconfig_kvm Error 143.61 test_deploy_vm_extra_config_data.py
test_01_migrate_vm_strict_tags_success Error 0.07 test_vm_strict_host_tags.py
test_02_migrate_vm_strict_tags_failure Error 0.06 test_vm_strict_host_tags.py
ContextSuite context=TestMigrateVMStrictTags>:teardown Error 0.13 test_vm_strict_host_tags.py
test_01_restore_vm_strict_tags_success Error 0.05 test_vm_strict_host_tags.py
test_02_restore_vm_strict_tags_failure Error 0.05 test_vm_strict_host_tags.py
ContextSuite context=TestRestoreVMStrictTags>:teardown Error 0.09 test_vm_strict_host_tags.py
test_01_scale_vm_strict_tags_success Error 0.06 test_vm_strict_host_tags.py
test_02_scale_vm_strict_tags_failure Error 0.06 test_vm_strict_host_tags.py
ContextSuite context=TestScaleVMStrictTags>:teardown Error 0.10 test_vm_strict_host_tags.py
test_01_deploy_vm_on_specific_host_without_strict_tags Error 0.06 test_vm_strict_host_tags.py
test_02_deploy_vm_on_any_host_without_strict_tags Error 0.07 test_vm_strict_host_tags.py
test_03_deploy_vm_on_specific_host_with_strict_tags_success Error 0.06 test_vm_strict_host_tags.py
test_04_deploy_vm_on_any_host_with_strict_tags_success Error 0.05 test_vm_strict_host_tags.py
test_05_deploy_vm_on_specific_host_with_strict_tags_failure Error 0.05 test_vm_strict_host_tags.py
test_06_deploy_vm_on_any_host_with_strict_tags_failure Error 0.05 test_vm_strict_host_tags.py
ContextSuite context=TestVMDeploymentPlannerStrictTags>:teardown Error 0.10 test_vm_strict_host_tags.py

@bernardodemarco , I think these errors are somewhat related. I restarted the test suite, but can you have a look?

@bernardodemarco
Copy link
Member Author

@bernardodemarco , I think these errors are somewhat related. I restarted the test suite, but can you have a look?

@DaanHoogland, yes, I also think so... I'll mark it as a draft while I dig into it

@bernardodemarco bernardodemarco marked this pull request as draft May 9, 2025 11:47
@bernardodemarco bernardodemarco changed the title Change the value parameter of the updateConfiguration API to be required draft: Change the value parameter of the updateConfiguration API to be required May 9, 2025
@bernardodemarco
Copy link
Member Author

@blueorangutan package

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

@DaanHoogland
Copy link
Contributor

I like this approach better @bernardodemarco , but we still have the same issue; the use of configuration keys is so ubiquitous that we might run into issues somewhere else in the system.

I’ll rerun the tests.

In the future I think we should introduce a field that contains permissible values, like a pattern or so.

@blueorangutan
Copy link

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

@bernardodemarco
Copy link
Member Author

but we still have the same issue; the use of configuration keys is so ubiquitous that we might run into issues somewhere else in the system.

@DaanHoogland, the current PR is only proposing to change the updateConfiguration API response when the value parameter is not specified (update configuration name="alert.email.addresses", for instance). Currently, it returns a success message, with the configuration attributes. Instead of that, it is proposed to return a self-explanatory error message for the operators (see APIs calls examples in #10790 (comment)).

Thus, I do not see how we might run into issues somewhere else

@DaanHoogland
Copy link
Contributor

but we still have the same issue; the use of configuration keys is so ubiquitous that we might run into issues somewhere else in the system.

@DaanHoogland, the current PR is only proposing to change the updateConfiguration API response when the value parameter is not specified (update configuration name="alert.email.addresses", for instance). Currently, it returns a success message, with the configuration attributes. Instead of that, it is proposed to return a self-explanatory error message for the operators (see APIs calls examples in #10790 (comment)).

Thus, I do not see how we might run into issues somewhere else

the difference between value= and value=“” is significant. I was wondering about that, but maybe seeing bears on the road. Let’s continue as there is an obvious workaround when my problem is real (edit DB)

@DaanHoogland
Copy link
Contributor

(edit DB)

which I will always advise against of course.

@bernardodemarco
Copy link
Member Author

the difference between value= and value=“” is significant

@DaanHoogland, actually, CloudMonkey sets value to be an empty string in both cases:

  • update configuration name="alert.email.addresses" value=:
2025-11-03 15:59:14,070 DEBUG [c.c.a.ApiServlet] (qtp170949260-21:[ctx-2538236c]) (logid:f10b3836) ===START===  192.168.100.1 -- GET  command=updateConfiguration&name=alert.email.addresses&response=json&&value=
2025-11-03 15:59:14,085 DEBUG [c.c.a.ApiServlet] (qtp170949260-21:[ctx-2538236c, ctx-da261c77]) (logid:f10b3836) ===END===  192.168.100.1 -- GET  command=updateConfiguration&name=alert.email.addresses&response=json&&value=
  • update configuration name="alert.email.addresses" value="":
2025-11-03 16:00:01,386 DEBUG [c.c.a.ApiServlet] (qtp170949260-26:[ctx-a1d04265]) (logid:29fb27ab) ===START===  192.168.100.1 -- GET  command=updateConfiguration&name=alert.email.addresses&response=json&&value=
2025-11-03 16:00:01,407 DEBUG [c.c.a.ApiServlet] (qtp170949260-26:[ctx-a1d04265, ctx-d82e8c2b]) (logid:29fb27ab) ===END===  192.168.100.1 -- GET  command=updateConfiguration&name=alert.email.addresses&response=json&&value=

Thus, both API calls are valid and can be used to clear configuration values

@DaanHoogland
Copy link
Contributor

DaanHoogland commented Nov 4, 2025

let’s continue @bernardodemarco, my concern is that they work the same and are not distinct (a “” and a <null>). But I don’t see any issue now and we can deal with it later.

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-14769)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 59040 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10790-t14769-kvm-ol8.zip
Smoke tests completed. 145 look OK, 2 have errors, 2 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_enableHumanReadableLogs Error 0.28 test_human_readable_logs.py
test_01_vpc_site2site_vpn_multiple_options Failure 471.36 test_vpc_vpn.py
all_test_image_store_object_migration Skipped --- test_image_store_object_migration.py
all_test_import_unmanage_volumes Skipped --- test_import_unmanage_volumes.py

…gerImpl.java

Co-authored-by: dahn <daan.hoogland@gmail.com>
@DaanHoogland
Copy link
Contributor

I don’t think this needs more testing but one last regression swoop to be sure.

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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

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

@bernardodemarco
Copy link
Member Author

@DaanHoogland, I've successfully built the current PR here. I'll trigger @blueorangutan's package workflow once again. Maybe, there's the chance that the error was related with the build environment, let's see

@bernardodemarco
Copy link
Member Author

@blueorangutan package

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

@blueorangutan
Copy link

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

@DaanHoogland
Copy link
Contributor

@DaanHoogland, I've successfully built the current PR here. I'll trigger @blueorangutan's package workflow once again. Maybe, there's the chance that the error was related with the build environment, let's see

ah, only the debian build failed and I already checked it would build, but all good anyway.

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@DaanHoogland DaanHoogland changed the base branch from main to 4.22 November 6, 2025 15:07
@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@DaanHoogland DaanHoogland modified the milestones: 4.22.0, 4.22.1 Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

10 participants