Skip to content

StorageManager tech debt 2/6: never-thrown checked exceptions - #14559

Open
DaanHoogland wants to merge 1 commit into
ghi12316-storageManagerTechDebtfrom
ghi12316-storage-exceptions
Open

DaanHoogland wants to merge 1 commit into
ghi12316-storageManagerTechDebtfrom
ghi12316-storage-exceptions

Conversation

@DaanHoogland

@DaanHoogland DaanHoogland commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #13598

Description

Stack for #12316 (StorageManager tech debt), one PR per item of the issue checklist, review only the top commit of each:

  1. StorageManager tech debt 1/6: remove unused methods, fields and return values #13598: unused methods, fields and return values
  2. never-thrown checked exceptions
  3. raw types and unchecked casts
  4. never-used parameters
  5. remaining trivial warnings
  6. deprecated SearchCriteria.addAnd usages

This PR (2/6) removes checked exceptions that can never be thrown from StorageService.createPool, preparePrimaryStorageForMaintenance and discoverImageStore (ResourceInUseException, UnknownHostException, ResourceUnavailableException, InsufficientCapacityException, DiscoveryException). It also drops the matching dead catch blocks in AddSecondaryStorageCmd, AddImageStoreCmd, AddImageStoreS3CMD, AddSwiftCmd and CreateStoragePoolCmd. No caller elsewhere catches the removed exceptions.

Part of #12316

Types of changes

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

🤖 Generated with Claude Code

Part of #12316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 22.22222% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.77%. Comparing base (58eae14) to head (fb4c916).

Files with missing lines Patch % Lines
...api/command/admin/host/AddSecondaryStorageCmd.java 0.00% 8 Missing ⚠️
.../api/command/admin/storage/AddImageStoreS3CMD.java 0.00% 8 Missing ⚠️
...loudstack/api/command/admin/swift/AddSwiftCmd.java 0.00% 8 Missing ⚠️
...ain/java/com/cloud/storage/StorageManagerImpl.java 0.00% 4 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                          @@
##             ghi12316-storageManagerTechDebt   #14559      +/-   ##
=====================================================================
- Coverage                              20.77%   20.77%   -0.01%     
+ Complexity                             21906    21904       -2     
=====================================================================
  Files                                   6496     6496              
  Lines                                 591486   591457      -29     
  Branches                               72561    72561              
=====================================================================
- Hits                                  122861   122849      -12     
+ Misses                                455288   455271      -17     
  Partials                               13337    13337              
Flag Coverage Δ
uitests 3.88% <ø> (ø)
unittests 22.08% <22.22%> (-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 2/5: never-thrown checked exceptions StorageManager tech debt 2/6: never-thrown checked exceptions Nov 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability 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 2, 2026

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 25.88%
Branch coverage 20.21%

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)

1 participant