Skip to content

techdebt: parameterise map typed API parameters - #14580

Open
DaanHoogland wants to merge 2 commits into
mainfrom
ghi3360-parameterisedParameters
Open

DaanHoogland wants to merge 2 commits into
mainfrom
ghi3360-parameterisedParameters

Conversation

@DaanHoogland

@DaanHoogland DaanHoogland commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Addresses the parameterised-types part of #3360.

Raw Map fields on API commands are replaced with
Map<Integer, Map<String, String>>. This matches what
ParamUnpackWorker actually builds for param[i].key=value input, for
sync and async commands alike. Getters and setters are typed to match:

  • getters that return the first entry return Map<String, String>
  • setters used by internal callers (e.g. the Veeam adapter, image
    store migration) take the indexed map

Response classes get typed details maps. NetworkOffering, BgpPeer
and VolumeForImport use their enum Detail keys; Gson serialises
those by name, so the output is the same.

No API behaviour changes: listApis still reports these parameters and
response fields as map. That leaves the apidocs, CloudMonkey and
Marvin's generated client unchanged.

Fixes: #3360

Types of changes

  • Cleanup (Code refactoring and cleanup, that may add test cases)

How Has This Been Tested?

  • Compiled api, server, framework/extensions, oauth2, kubernetes-service,
    veeam-control-service, metrics and the external hypervisor plugin.
  • Unit tests pass for api (190), framework/extensions (91), oauth2 (1)
    and server (459, including UserVmManagerImplTest,
    AutoScaleManagerImplTest, VnfTemplateManagerImplTest and
    ConfigurationManagerTest).
  • pre-commit passes on the changed files.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings November 4, 2026 17: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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 27.27273% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.77%. Comparing base (fb60564) to head (764d597).

Files with missing lines Patch % Lines
...g/apache/cloudstack/api/response/HostResponse.java 50.00% 3 Missing ⚠️
...che/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java 0.00% 2 Missing ⚠️
...ck/api/command/admin/account/UpdateAccountCmd.java 0.00% 2 Missing ⚠️
...pi/command/admin/storage/UpdateStoragePoolCmd.java 0.00% 2 Missing ⚠️
...k/api/command/user/template/CreateTemplateCmd.java 0.00% 2 Missing ⚠️
...d/user/template/GetUploadParamsForTemplateCmd.java 0.00% 2 Missing ⚠️
...api/command/user/template/RegisterTemplateCmd.java 0.00% 2 Missing ⚠️
...apache/cloudstack/api/response/UserVmResponse.java 0.00% 2 Missing ⚠️
...k/oauth2/api/command/RegisterOAuthProviderCmd.java 0.00% 2 Missing ⚠️
...udstack/api/command/admin/guest/AddGuestOsCmd.java 0.00% 1 Missing ⚠️
... and 12 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14580      +/-   ##
============================================
- Coverage     20.78%   20.77%   -0.01%     
+ Complexity    21931    21927       -4     
============================================
  Files          6496     6496              
  Lines        591657   591643      -14     
  Branches      72592    72592              
============================================
- Hits         122966   122927      -39     
- Misses       455346   455377      +31     
+ Partials      13345    13339       -6     
Flag Coverage Δ
uitests 3.88% <ø> (ø)
unittests 22.08% <27.27%> (-0.01%) ⬇️

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.

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

@DaanHoogland
DaanHoogland force-pushed the ghi3360-parameterisedParameters branch from ee65ee9 to 764d597 Compare November 6, 2026 16:16
Copilot AI balanced review requested due to automatic review settings November 6, 2026 16:16

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
27.3% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube Cloud

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 25.88%
Branch coverage 20.22%

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

@blueorangutan

Copy link
Copy Markdown

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

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

None yet

Development

Successfully merging this pull request may close these issues.

use only parameterised types for details parameters

3 participants