chore: Separate CLI entrypoints by binary role#1425
Conversation
Add binary-owner entrypoint packages so dispatcher-only behavior and project-local CLI behavior can evolve independently without changing command behavior. - Route cmd/uloop through internal/dispatcher. - Route cmd/uloop-cli through internal/projectcli. - Update architecture tests to enforce the new entrypoint boundaries.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTwo new wrapper packages are added for dispatcher and project CLI entrypoints, the cmd mains switch to those wrappers, the dispatcher contract version changes, and architecture tests are updated for the new package boundaries. ChangesEntrypoint Package Split
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cli/internal/architecture/architecture_test.go (1)
49-57: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winBlock feature packages from importing the new entrypoint wrappers.
Line 56 still only rejects
.../internal/cli, so feature packages can now import.../internal/dispatcheror.../internal/projectcliwithout tripping this test. That means the new boundary added in this PR is not actually enforced.Suggested fix
for _, importedPath := range goPackage.Imports { - if strings.HasPrefix(importedPath, cliModulePath+"/internal/cli") { + if strings.HasPrefix(importedPath, cliModulePath+"/internal/cli") || + strings.HasPrefix(importedPath, cliModulePath+"/internal/dispatcher") || + strings.HasPrefix(importedPath, cliModulePath+"/internal/projectcli") { t.Fatalf("feature package %s must not import CLI package %s", goPackage.ImportPath, importedPath) } }🤖 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 `@cli/internal/architecture/architecture_test.go` around lines 49 - 57, The architecture test currently only blocks imports of the old CLI package, so it misses feature packages importing the new entrypoint wrappers. Update the import check in architecture_test.go around the goPackage.Imports loop to reject the dispatcher and projectcli packages as well, using the same cliModulePath-based prefix matching already used for the existing CLI boundary. Keep the existing package-skip logic, but expand the forbidden import condition so feature packages cannot depend on internal/cli, internal/dispatcher, or internal/projectcli.
🤖 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.
Outside diff comments:
In `@cli/internal/architecture/architecture_test.go`:
- Around line 49-57: The architecture test currently only blocks imports of the
old CLI package, so it misses feature packages importing the new entrypoint
wrappers. Update the import check in architecture_test.go around the
goPackage.Imports loop to reject the dispatcher and projectcli packages as well,
using the same cliModulePath-based prefix matching already used for the existing
CLI boundary. Keep the existing package-skip logic, but expand the forbidden
import condition so feature packages cannot depend on internal/cli,
internal/dispatcher, or internal/projectcli.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c559411b-3164-4b3a-b3d1-ddd4bb2aa309
📒 Files selected for processing (5)
cli/cmd/uloop-cli/main.gocli/cmd/uloop/main.gocli/internal/architecture/architecture_test.gocli/internal/dispatcher/dispatcher.gocli/internal/projectcli/projectcli.go
The dispatcher command entrypoint changed in this PR, so the dispatcher release contract must advertise a newer dispatcherVersion for the CI release-input guard.
Summary
uloopanduloop-clibehavior unchanged while separating their command entrypoints by binary role.User Impact
Changes
Verification
scripts/check-go-cli.shgo run ./cmd/uloop --versiongo run ./cmd/uloop-cli --version