config cleanup - #13884
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13884 +/- ##
=========================================
Coverage 19.78% 19.79%
- Complexity 19995 20018 +23
=========================================
Files 6371 6387 +16
Lines 575907 575888 -19
Branches 70496 70474 -22
=========================================
+ Hits 113956 114000 +44
+ Misses 449520 449453 -67
- Partials 12431 12435 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.69% |
| Branch coverage | 18.92% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
…nfig enum to services
…ecated Config enum to services
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Copilot reviewed 166 out of 166 changed files in this pull request and generated 2 comments.
Suppressed comments (5)
server/src/test/java/com/cloud/api/response/ApiResponseSerializerTest.java:1
- This test mutates the static
ConfigKeydefault value via reflection but does not restore the previous value, which can leak into other tests and create ordering-dependent failures. Capture the original_defaultValuebefore overriding and restore it in@After(or in a try/finally around each override) to keep the test suite isolated.
server/src/test/java/com/cloud/resource/DiscovererBaseTest.java:1 - Like other new tests in this PR, this test mutates
ConfigKey._defaultValuevia reflection without restoring it afterward. To avoid cross-test pollution, store the original values and restore them in an@Aftermethod (or use a try/finally around the overrides).
plugins/storage/image/s3/src/main/java/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java:1 - After switching to typed
ConfigKeyaccess (.value()), this code no longer parses a string, soNumberFormatExceptioncannot be thrown here. The try/catch is now dead code and can be removed; if you still need a fallback, handle null/invalid values at theConfigKeylevel (defaults) or explicitly guard for null.
server/src/main/java/com/cloud/storage/download/DownloadMonitorImpl.java:1 - With typed config (
MaxUploadVolumeSize.value()), there is no string parsing anymore, soNumberFormatExceptionwill never be thrown and these try/catch blocks are redundant. Simplify by removing the try/catch; ifvalue()can ever be null in your config framework, explicitly handle null to avoid returningnullonly on an exception that can’t occur.
plugins/network-elements/elastic-loadbalancer/src/main/java/com/cloud/network/lb/ElasticLoadBalancerManager.java:1 - The defaults and comments are internally inconsistent:
DEFAULT_ELB_VM_RAMSIZEis 128 but commented as 512 MB, while the newElasticLoadBalancerVmMemorydefault is 512; similarly CPU constant is 256 but the config default is 128. This can lead to unintended behavior changes during the config migration. Align the constants, comments, andConfigKeydefaults to the intended historical defaults (and consider removing/deriving the constants if theConfigKeyis now the single source of truth).
| ConfigKey<String> NetworkLBHaproxyStatsAuth = new ConfigKey<>("Secure", String.class, | ||
| "network.loadbalancer.haproxy.stats.auth", "admin1:AdMiN123", | ||
| "Load Balancer(haproxy) authentication string in the format username:password", true); |
| boolean _sslCopy = false; | ||
| String sslCfg = _configDao.getValue(Config.SecStorageEncryptCopy.toString()); | ||
| boolean _sslCopy = SecondaryStorageVmManager.SecStorageEncryptCopy.value(); | ||
| String _ssvmUrlDomain = _configDao.getValue("secstorage.ssl.cert.domain"); |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19150 |
|




Description
This PR tries to get rid of the Config enum or the old mechanism to define configuration items, which is long overdue. The change should be transparent, but is huge so good regression testing is required. And merg early in the release cycle is recommended.
Commits are being done in batches for review convenience. They could have been done in separate PRs but in the end the changes are rather trivial.
Fixes: #10752
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?