feat(plugins): add zero plugins info command#773
Conversation
Add plugins info to inspect manifest state, extension counts, and lockfile source/hash with optional hash drift detection.
|
Warning Review limit reached
Next review available in: 5 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughAdds a ChangesPlugin info command
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant runPlugins
participant runPluginInfo
participant plugins.Info
participant PluginLoader
participant Lockfile
User->>runPlugins: invoke plugins info <id>
runPlugins->>runPluginInfo: dispatch command
runPluginInfo->>plugins.Info: request plugin metadata
plugins.Info->>PluginLoader: discover plugin
plugins.Info->>Lockfile: read lock metadata
plugins.Info-->>runPluginInfo: return plugin and drift details
runPluginInfo-->>User: render text or JSON
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
internal/cli/distribution.go (1)
315-320: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsolidate duplicate conditional blocks.
Both blocks check
info.LockHash != "". Consolidating them reduces duplication and improves readability.♻️ Proposed refactor
- if info.LockHash != "" { - lines = append(lines, " lock hash: "+info.LockHash) - } - if info.LockHash != "" { - lines = append(lines, fmt.Sprintf(" hash drift: %t", info.HashDrift)) - } + if info.LockHash != "" { + lines = append(lines, " lock hash: "+info.LockHash) + lines = append(lines, fmt.Sprintf(" hash drift: %t", info.HashDrift)) + }🤖 Prompt for 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. In `@internal/cli/distribution.go` around lines 315 - 320, Consolidate the two adjacent info.LockHash checks in the distribution output into a single conditional block that appends both the lock hash and hash drift lines, preserving their current order and formatting.
🤖 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 `@internal/plugins/info.go`:
- Around line 20-24: Derive lockfile lookup from each loaded plugin’s directory
instead of a caller-provided lock directory: remove LockDir from InfoOptions and
use filepath.Dir(plugin.PluginDir) in the Info logic, adding the filepath
import. Remove the LockDir assignment from the plugins.InfoOptions literal in
internal/cli/distribution.go and from both InfoOptions literals in
internal/plugins/info_test.go; apply these changes at internal/plugins/info.go
lines 20-24 and 50-52, internal/cli/distribution.go lines 274-277, and
internal/plugins/info_test.go lines 32-35 and 52-55.
---
Nitpick comments:
In `@internal/cli/distribution.go`:
- Around line 315-320: Consolidate the two adjacent info.LockHash checks in the
distribution output into a single conditional block that appends both the lock
hash and hash drift lines, preserving their current order and formatting.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 04a8632d-a853-499b-b11d-a828a41f1578
📒 Files selected for processing (6)
docs/EXTENDING.mdinternal/cli/distribution.gointernal/cli/distribution_test.gointernal/cli/extensions.gointernal/plugins/info.gointernal/plugins/info_test.go
Remove LockDir from InfoOptions and read the lockfile from filepath.Dir(plugin.PluginDir) so lock metadata matches the resolved plugin location. Consolidate duplicate lock hash output lines.
|
Addressed CodeRabbit review in 74aac04:
|
Summary
zero plugins info <id> [--user] [--json]to inspect installed pluginszero skill infoworkflowTest plan
go test ./internal/plugins/ ./internal/cli/ -count=1go veton changed packagesgolangci-lint(unused/ineffassign/staticcheck) on./internal/plugins/— 0 issuesgovulncheck— no vulnerabilitieszero plugins info <id>, confirm lock metadataSummary by CodeRabbit
New Features
zero plugins info <plugin-id>to inspect plugin details.--userand--jsonoptions for targeted and machine-readable output.Bug Fixes