-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Change the value
parameter of the updateConfiguration
API to be required
#10790
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
base: main
Are you sure you want to change the base?
Change the value
parameter of the updateConfiguration
API to be required
#10790
Conversation
@blueorangutan package |
@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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10790 +/- ##
=========================================
Coverage 16.42% 16.42%
- Complexity 13549 13554 +5
=========================================
Files 5673 5673
Lines 500080 500086 +6
Branches 60506 60510 +4
=========================================
+ Hits 82153 82157 +4
- Misses 408794 408795 +1
- Partials 9133 9134 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13217 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
@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? |
@DaanHoogland, yes, it is possible. This change only encompass scenarios in which the (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 (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 |
@DaanHoogland, I've just committed this one 01d7c6e Now, operators are able to clean up configuration values (i.e. set its value to
|
@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 However, when the 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) |
eae9d7b
to
a66ebe4
Compare
@bernardodemarco +1 on separate issue. |
@bernardodemarco addressing it separately seems better for me. |
fine by me |
Description
Currently, the
value
parameter of theupdateConfiguration
API is not required. Thus, when the API is executed and thevalue
parameter is not specified, the attributes of the configuration set by thename
parameter are returned.updateConfiguration
API call without specifying thevalue
parameterAs 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 theupdateConfiguration
API to be required.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
updateConfiguration
API through Cloudmonkey, without specifying thevalue
parameter, and the following API response was returned:account.cleanup.interval
configuration to a blank value and verified that a semantic error message was returned: