fix: align the local runtime contract - #49
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe CLI now stores project metadata in local markers, discovers projects from nested directories, accepts existing UI and Core checkouts, and updates command workflows. Compose files use pinned images and revised host/container networking. Documentation and runtime tests cover the new contracts. ChangesProject configuration and runtime workflows
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🟡 Moderate · up to Initialization can still select the wrong runtime mode or create conflicting nested configuration, while a regression test may pass without validating the intended failure; these bounded issues should be fixed or explicitly accepted before merging. Sequence Diagram(s)sequenceDiagram
participant User
participant InitCommand
participant ProjectMarker
participant ProjectCommand
participant Compose
participant Core
participant UI
User->>InitCommand: provide project or checkout paths
InitCommand->>ProjectMarker: write .kubeorch/project.json
User->>ProjectCommand: run a project-scoped command
ProjectCommand->>ProjectMarker: discover and validate marker
ProjectCommand->>Compose: validate and start configured services
UI->>Core: request /v1/api
ProjectCommand->>Core: perform health check
ProjectCommand->>UI: perform health check
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Mohit Nagaraj <mohitnagaraj20@gmail.com>
0c6f2a4 to
5746d42
Compare
There was a problem hiding this comment.
Actionable comments posted: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmd/init.go (1)
132-152: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDo not require Git for existing-checkout initialization.
checkPrerequisitesalways checks or installs Git before this function resolves existing paths. With--ui-pathor--core-pathplus--skip-deps, no later operation needs Git. This documented adoption flow fails on systems without Git and can trigger an unnecessary installation.Check Git only when
cloneUI || cloneCore. Keep Docker Compose validation for every mode.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7f345606-3cc2-4f6e-b85c-a1a21f48f570
📒 Files selected for processing (26)
README.mdcmd/config.gocmd/debug.gocmd/docker/docker-compose.dev.ymlcmd/docker/docker-compose.hybrid-core.ymlcmd/docker/docker-compose.hybrid-ui.ymlcmd/docker/docker-compose.prod.ymlcmd/exec.gocmd/init.gocmd/logs.gocmd/restart.gocmd/root.gocmd/runtime_contract_test.gocmd/start.gocmd/status.gocmd/stop.gocmd/testing.gocmd/utils.godocker/docker-compose.dev.ymldocker/docker-compose.hybrid-core.ymldocker/docker-compose.hybrid-ui.ymldocker/docker-compose.prod.ymldocs/ARCHITECTURE.mddocs/CONCURRENT-OPERATIONS.mddocs/CONFIGURATION.mdtests/unit/cmd_test.go
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Signed-off-by: Mohit Nagaraj <mohitnagaraj20@gmail.com>
Signed-off-by: Mohit Nagaraj <mohitnagaraj20@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmd/init.go (1)
118-121: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winA plain
orchcli initsilently downgrades an existing development marker to production mode.
setupProductioncallssetProjectConfig(cwd, "", ""), andwriteProjectMarkerreplaces.kubeorch/project.jsonunconditionally. If a project was initialized with--ui-path/--fork-ui, a laterorchcli initwithout flags rewrites the marker withmode: "production"and empty source paths. The localui/andcore/checkouts stay on disk, butstart,status, andlogsthen resolve the production Compose file. The user gets no warning.Load the existing marker first. If it records source paths, either preserve them or print an explicit message that the project is switching to production mode.
🧹 Nitpick comments (3)
cmd/config.go (1)
223-289: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueAtomic replacement is correct; consider one directory sync for crash durability.
The temporary-file write,
Sync,Close, andRenamesequence removes the truncation window that the previousos.WriteFilecall created. The rename entry itself is not durable until the parent directory is synced. If crash durability of the marker matters, open the parent directory afteros.Renameand callSyncon it, ignoring the "not supported" case on Windows.cmd/status.go (1)
127-169: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueHealth checks are correct; consider draining response bodies.
The context-aware requests, the bounded client timeout, and the buffered channel are correct, and no goroutine can leak because every result is read. The bodies are closed without being read, so the underlying connections are not reusable. This does not matter for two one-shot checks. If you want to keep transport hygiene, add
io.Copy(io.Discard, response.Body)before the close.cmd/utils.go (1)
321-338: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePolling is now bounded; make the timeout message generic.
The context deadline plus
exec.CommandContextremoves the unboundeddocker infowait.waitForDockerDaemonis also called from the macOS and Windows paths, so the fixed text "docker desktop did not start within %s" describes only one case. Report the daemon instead, for example "docker daemon did not become ready within %s".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1af73ecb-b2e0-4b34-a751-c9dcfa4fc3f7
📒 Files selected for processing (10)
README.mdcmd/config.gocmd/init.gocmd/root.gocmd/runtime_contract_test.gocmd/start.gocmd/status.gocmd/utils.godocs/ARCHITECTURE.mddocs/CONCURRENT-OPERATIONS.md
🚧 Files skipped from review as they are similar to previous changes (2)
- cmd/root.go
- cmd/start.go
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Signed-off-by: Mohit Nagaraj <mohitnagaraj20@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fa79d431-e335-4837-b851-825d18abb91b
📒 Files selected for processing (3)
cmd/init.gocmd/runtime_contract_test.godocs/CONCURRENT-OPERATIONS.md
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Signed-off-by: Mohit Nagaraj <mohitnagaraj20@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 03467f05-0c5d-464d-a295-7023c281192e
📒 Files selected for processing (2)
cmd/init.gocmd/runtime_contract_test.go
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Signed-off-by: Mohit Nagaraj <mohitnagaraj20@gmail.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8597ab60-b689-4e36-82ea-57c5d6abf9f7
📒 Files selected for processing (2)
cmd/init.gocmd/runtime_contract_test.go
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Signed-off-by: Mohit Nagaraj <mohitnagaraj20@gmail.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
.kubeorch/project.jsonmarker with parent-directory discovery and safe legacy migration behaviororchcli initto adopt existing UI/Core checkouts, make initialization idempotent, and improve Windows Docker Desktop handling and service health reportingValidation
go test ./...go vet ./...docker compose ... config --quietfor all four shipped Compose modesstatusfrom nested UI/Core directories201, login200, authenticated dashboard/settings requests200, admin role rendered, and workspace create/list succeeded with no browser console errorsRemaining dependency
The currently published Core and UI
v0.0.3images expose AMD64 manifests only. This PR documents that limitation and pins the available images, but actual macOS ARM64 production/hybrid execution remains blocked on multi-arch component releases. For that reason this PR references rather than closes the runtime issue.Refs #47