You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrates health, check-update, self, version, update-provider, daemon status|netcheck|start, project list, template list (host flag only), cluster list (host flag only).
Removes five //nolint:dupl directives and two //nolint:goconst directives made unnecessary by the helpers.
Why
Each host-scoped factory repeated the same flag, env binding, required-flag, completion, and agent-executed annotation code. Sharing it keeps the wiring in one place.
Validation
Behaviour: throwaway dumper of usage, short, hidden, flags, defaults, annotations, and completion directives for all 11 factories, before vs after. Identical (158 lines).
mise run cli:format: applied.
mise run cli:lint:ci: 0 issues.
golangci-lint run --new-from-rev=origin/main ./cmd/... ./pkg/...: 0 issues on darwin, linux; ./cmd/pro/... 0 issues on windows.
Windows ./pkg/...: typecheck fails in pkg/extract/extract_test.go (syscall.Stat_t). Pre-existing on origin/main; this PR does not touch pkg/extract.
go build ./...: pass on darwin, linux, windows.
go test ./cmd/pro/...: pass, including new proutil tests.
Within policy: 12 modified files plus one new test file, 126 insertions and 293 deletions in non-test code, no go.mod changes, no lint disabled, no new //nolint.
Summary by CodeRabbit
Improvements
Host-based Pro commands now handle host selection and execution consistently.
Host flags continue to support required values, environment variables, and command completion.
Agent-executed status is applied consistently across applicable commands.
Tests
Added coverage for host selection, configuration forwarding, resolution errors, and agent-executed status.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: e45e1970-d6ff-447a-ac0c-1b3d96de5045
📥 Commits
Reviewing files that changed from the base of the PR and between db85eb5 and 5a8ebc8.
📒 Files selected for processing: 13
cmd/pro/check_update.go
cmd/pro/cluster/list.go
cmd/pro/daemon/netcheck.go
cmd/pro/daemon/start.go
cmd/pro/daemon/status.go
cmd/pro/health.go
cmd/pro/project/list.go
cmd/pro/proutil/proutil.go
cmd/pro/proutil/proutil_test.go
cmd/pro/self.go
cmd/pro/template/list.go
cmd/pro/update_provider.go
cmd/pro/version.go
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
📝 Walkthrough
Pro commands now use shared helpers for host resolution, host flag configuration, optional completion, and agent-executed annotations. Tests cover host flag behavior, execution-time resolution, error handling, and annotation preservation.
Adds helpers for host-based execution, required host flag setup, optional completion, and agent-executed annotations. Tests cover flag values, provider resolution, errors, and root annotations.
Command constructors replace inline provider resolution and host flag setup with shared helpers. Daemon commands also use shared completion and annotation helpers where applicable.
The shared host-command wiring has no identified behavior change that needs correction before merge.
Security architecture risk:⚪ Minimal · up to 5a8eb
The refactor preserves host selection, required-input handling, and failure behavior. No introduced or increased security exposure was identified in the migrated commands.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The shared helper increases the number of commands depending on one wiring implementation, but does not itself expand execution beyond the caller-selected configured host/provider or add cross-host dispatch. Downstream operation authority remains that of the existing command callbacks.
Trust Boundaries and Controls
observed — User-controlled host input still passes through the existing configuration and provider-resolution path. ProviderFromHost loads the configured host instance, finds its provider, and accepts proxy or daemon providers before command execution proceeds; the refactor does not bypass this selection check.
Resilience and Maintainability Implications
observed — The execution marker remains command-tree state set before host-scoped execution, with existing annotations preserved. It is not cleared after execution failure or cancellation, but that lifecycle behavior already existed in the replaced handlers and is not a new rollback or authority regression.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title accurately and concisely describes the main change: introducing shared host command wiring for pro commands.
Docstring Coverage
Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 13 files.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
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
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.
Summary
cmd/pro/proutil:AddHostFlag,HostRunE,WithHostCompletion,MarkAgentExecuted.health,check-update,self,version,update-provider,daemon status|netcheck|start,project list,template list(host flag only),cluster list(host flag only).//nolint:dupldirectives and two//nolint:goconstdirectives made unnecessary by the helpers.Why
Each host-scoped factory repeated the same flag, env binding, required-flag, completion, and agent-executed annotation code. Sharing it keeps the wiring in one place.
Validation
mise run cli:format: applied.mise run cli:lint:ci: 0 issues.golangci-lint run --new-from-rev=origin/main ./cmd/... ./pkg/...: 0 issues on darwin, linux;./cmd/pro/...0 issues on windows../pkg/...: typecheck fails inpkg/extract/extract_test.go(syscall.Stat_t). Pre-existing onorigin/main; this PR does not touchpkg/extract.go build ./...: pass on darwin, linux, windows.go test ./cmd/pro/...: pass, including newproutiltests.CodeRabbit CLI
coderabbit review --agent --committedagainstorigin/mainmerge base: completed, 0 findings, 13 files reviewed.Auto-merge
Within policy: 12 modified files plus one new test file, 126 insertions and 293 deletions in non-test code, no
go.modchanges, no lint disabled, no new//nolint.Summary by CodeRabbit