System Inventory MC cmd#629
Conversation
📝 WalkthroughWalkthroughAdds a new ChangesSystem Inventory Status
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant AdminClient
participant AdminAPIServer
Caller->>AdminClient: SystemInventoryStatus(ctx)
AdminClient->>AdminAPIServer: GET /system-inventory/status
AdminAPIServer-->>AdminClient: HTTP response (200 or error)
AdminClient->>AdminClient: decode JSON into SystemInventoryStatus
AdminClient-->>Caller: SystemInventoryStatus, error
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new MinIO Admin Go client API surface to support the “system inventory” status endpoint, exposing typed status information for consumption by callers (e.g., the referenced SY MC command work).
Changes:
- Introduces
SystemInventoryTableStatusconstants to model server-reported inventory table states. - Adds
SystemInventoryStatus/SystemInventoryBucketStatusresponse structs with JSON tags. - Implements
(*AdminClient).SystemInventoryStatus(ctx)to GET/system-inventory/statusand decode the JSON response.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@system-inventory.go`:
- Around line 54-76: Add unit test coverage for the new exported
AdminClient.SystemInventoryStatus method. Create tests around its executeMethod
call and response handling to verify the success path, non-200 status conversion
via httpRespToErrorResponse, and JSON decode failures from
json.NewDecoder(resp.Body).Decode. Use a fake transport or httptest.Server to
exercise SystemInventoryStatus and ensure the method returns the expected
SystemInventoryStatus and errors in each case.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 03875643-de29-4b1f-b538-0109b3c29c4c
📒 Files selected for processing (1)
system-inventory.go
Updates required for the system inventory
mccmd.Summary by CodeRabbit