Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #833 +/- ##
==========================================
+ Coverage 40.02% 40.12% +0.09%
==========================================
Files 114 114
Lines 10785 10761 -24
==========================================
+ Hits 4317 4318 +1
+ Misses 6068 6042 -26
- Partials 400 401 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Refactors the WSMAN hardware/disk info retrieval path to return typed result structs instead of interface{}/map-based payloads, and updates the devices usecase + tests/mocks accordingly.
Changes:
- Updated WSMAN
ManagementAPIs to returnHWResults/DiskResultsstructs and removed the old map-shaping helpers. - Updated devices usecase DTO conversion to consume typed WSMAN results directly.
- Regenerated/updated mocks and adjusted unit tests to match the new return types.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/usecase/devices/wsman/message_test.go | Removes tests for the deleted physical-memory slice conversion helper. |
| internal/usecase/devices/wsman/message.go | Changes GetHardwareInfo/GetDiskInfo to return typed results; removes map-conversion helpers. |
| internal/usecase/devices/wsman/interfaces.go | Updates Management interface signatures to return typed results. |
| internal/usecase/devices/info.go | Converts typed WSMAN results directly into v1 DTOs (no intermediate maps). |
| internal/usecase/devices/info_test.go | Updates mocks/expectations and expected DTO shapes for HW/Disk info. |
| internal/mocks/wsman_mocks.go | Updates generated gomock stubs for the new typed return values and generation command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+125
to
+129
| return uc.discInfoToDTO(diskInfo), nil | ||
| } | ||
|
|
||
| func (uc *UseCase) discInfoToDTO(discInfo interface{}) dto.DiskInfo { | ||
| result := dto.DiskInfo{} | ||
|
|
||
| info, ok := discInfo.(map[string]interface{}) | ||
| if !ok { | ||
| return result | ||
| func (uc *UseCase) discInfoToDTO(diskInfo wsmanAPI.DiskResults) dto.DiskInfo { | ||
| return dto.DiskInfo{ |
Comment on lines
+90
to
93
| memoryItems := make([]interface{}, len(hw.PhysicalMemoryResult.Body.PullResponse.MemoryItems)) | ||
| for i := range hw.PhysicalMemoryResult.Body.PullResponse.MemoryItems { | ||
| memoryItems[i] = hw.PhysicalMemoryResult.Body.PullResponse.MemoryItems[i] | ||
| } |
Comment on lines
+129
to
+131
| return dto.DiskInfo{ | ||
| CIMMediaAccessDevice: dto.CIMResponse{Responses: []interface{}{diskInfo.MediaAccessPullResult.Body.PullResponse.MediaAccessDevices}}, | ||
| CIMPhysicalPackage: dto.CIMResponse{Responses: []interface{}{diskInfo.PPPullResult.Body.PullResponse.PhysicalPackage}}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.