Skip to content

System Inventory MC cmd#629

Merged
rraulinio merged 3 commits into
minio:mainfrom
rraulinio:feat_#527
Jul 2, 2026
Merged

System Inventory MC cmd#629
rraulinio merged 3 commits into
minio:mainfrom
rraulinio:feat_#527

Conversation

@rraulinio

@rraulinio rraulinio commented Jul 1, 2026

Copy link
Copy Markdown
Member

Updates required for the system inventory mc cmd.

Summary by CodeRabbit

  • New Features
    • Added a new admin API to check system inventory status.
    • Exposed inventory status details for buckets, including whether the feature is disabled, backfilling, or active.
    • Added support for indicating whether system inventory is enabled across the cluster.

Signed-off-by: Raul <gfxsraul@gmail.com>
@rraulinio rraulinio requested a review from Copilot July 1, 2026 14:26
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new system-inventory.go file to the madmin package, introducing SystemInventoryTableStatus, SystemInventoryBucketStatus, and SystemInventoryStatus types with status constants, plus an AdminClient.SystemInventoryStatus method that fetches and decodes inventory status from a cluster endpoint.

Changes

System Inventory Status

Layer / File(s) Summary
Inventory status types and constants
system-inventory.go
Defines SystemInventoryTableStatus type with Disabled, Backfilling, Active constants, plus SystemInventoryBucketStatus and SystemInventoryStatus structs with JSON tags.
Status fetch client method
system-inventory.go
Adds AdminClient.SystemInventoryStatus performing an HTTP GET to /system-inventory/status, validating a 200 OK response, and decoding the JSON body into SystemInventoryStatus.

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
Loading

Poem

A rabbit hops through cluster halls,
Checking buckets, status calls,
Active, Backfilling, or Disabled tight,
One GET request sets it right,
Hop hop hooray, the inventory's bright! 🐇📦

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change by referring to the new System Inventory admin client command.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rraulinio rraulinio self-assigned this Jul 1, 2026
@rraulinio rraulinio added the enhancement New feature or request label Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SystemInventoryTableStatus constants to model server-reported inventory table states.
  • Adds SystemInventoryStatus / SystemInventoryBucketStatus response structs with JSON tags.
  • Implements (*AdminClient).SystemInventoryStatus(ctx) to GET /system-inventory/status and decode the JSON response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread system-inventory.go
Signed-off-by: Raul <gfxsraul@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 47606f6 and 29e9613.

📒 Files selected for processing (1)
  • system-inventory.go

Comment thread system-inventory.go
@rraulinio rraulinio changed the title SY MC cmd System Inventory MC cmd Jul 1, 2026

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

lgtm

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

lgtm

@rraulinio rraulinio merged commit 283a806 into minio:main Jul 2, 2026
5 of 6 checks passed
@rraulinio rraulinio deleted the feat_#527 branch July 2, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants