Skip to content

StorageManager tech debt: raw types and unchecked casts - #14560

Open
DaanHoogland wants to merge 1 commit into
ghi12316-storage-exceptionsfrom
ghi12316-storage-rawtypes
Open

DaanHoogland wants to merge 1 commit into
ghi12316-storage-exceptionsfrom
ghi12316-storage-rawtypes

Conversation

@DaanHoogland

@DaanHoogland DaanHoogland commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #14559

Description

Removes all rawtypes and unchecked javac warnings in the touched storage files (13 + 11 on main, 0 after):

  • details MAP parameters in AddSecondaryStorageCmd, AddImageStoreCmd, CreateStoragePoolCmd and UpdateStoragePoolCmd are typed Map<String, ? extends Map<String, String>>, as CreateSecondaryStagingStoreCmd already does. That removes the casts in their accessors and in StorageManagerImpl.extractApiParamAsMap.
  • AddImageStoreCmd.setDetails declared Map<String, String> but is given the unpacked (nested) map, so its type is corrected. The unused UpdateStoragePoolCmd.setDetails is removed.
  • CollectionUtils/MapUtils switch to commons-collections4, whose typed intersection makes the (List<String>) casts unnecessary.
  • The one unavoidable cast (local storage config parsed into untyped maps) is now an explicit, commented @SuppressWarnings.

Part of #12316

Types of changes

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

🤖 Generated with Claude Code

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.14815% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.78%. Comparing base (74f97b9) to head (585204c).

Files with missing lines Patch % Lines
...ain/java/com/cloud/storage/StorageManagerImpl.java 61.11% 5 Missing and 2 partials ⚠️
...api/command/admin/host/AddSecondaryStorageCmd.java 0.00% 2 Missing ⚠️
...ck/api/command/admin/storage/AddImageStoreCmd.java 66.66% 1 Missing ⚠️
.../api/command/admin/storage/AddImageStoreS3CMD.java 0.00% 1 Missing ⚠️
...pi/command/admin/storage/CreateStoragePoolCmd.java 0.00% 1 Missing ⚠️
...pi/command/admin/storage/UpdateStoragePoolCmd.java 0.00% 1 Missing ⚠️
...loudstack/api/command/admin/swift/AddSwiftCmd.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##             ghi12316-storage-exceptions   #14560      +/-   ##
=================================================================
- Coverage                          20.78%   20.78%   -0.01%     
+ Complexity                         21932    21929       -3     
=================================================================
  Files                               6496     6496              
  Lines                             591502   591486      -16     
  Branches                           72568    72566       -2     
=================================================================
- Hits                              122963   122956       -7     
+ Misses                            455192   455185       -7     
+ Partials                           13347    13345       -2     
Flag Coverage Δ
uitests 3.88% <ø> (ø)
unittests 22.09% <48.14%> (-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 DaanHoogland changed the title StorageManager tech debt 3/5: raw types and unchecked casts StorageManager tech debt 3/6: raw types and unchecked casts Nov 2, 2026
@DaanHoogland
DaanHoogland force-pushed the ghi12316-storage-rawtypes branch from 9523aad to aebb3bb Compare November 6, 2026 11:36
Copilot AI balanced review requested due to automatic review settings November 6, 2026 11:36

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.

Part of #12316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DaanHoogland
DaanHoogland force-pushed the ghi12316-storage-rawtypes branch from aebb3bb to 585204c Compare November 6, 2026 15:08
Copilot AI balanced review requested due to automatic review settings November 6, 2026 15:08
@DaanHoogland DaanHoogland changed the title StorageManager tech debt 3/6: raw types and unchecked casts StorageManager tech debt: raw types and unchecked casts Nov 6, 2026

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
38.5% Coverage on New Code (required ≥ 40%)
C Reliability Rating on New Code (required ≥ B)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 25.90%
Branch coverage 20.23%

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

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.

deal with tech debt in StorageManager(Impl)

2 participants