Hotfix revert last two#56
Conversation
Kimchi Code Review
Summary📊 Review Score: 88/100 (overall code quality — 0 lowest, 100 highest) 🧪 Tests: yes — Test files updated to reflect the binary rename from 📝 Found 1 issue(s). See inline comments for details. What to expectKimchi will analyze the changes in this pull request and post:
The review typically completes within a few minutes. This comment will be updated once the review is ready. Interact with Kimchi
ConfigurationReviews are configured by your organization admin. Powered by Kimchi — AI-powered code review by CAST AI |
There was a problem hiding this comment.
📊 Review Score: 88/100 (overall code quality — 0 lowest, 100 highest)
⏱️ Estimated effort to review: 2/5 (1 = trivial, 5 = very complex)
🧪 Tests: yes — Test files updated to reflect the binary rename from kimchi to kimchi-code and the new path resolution logic. Tests cover archive extraction, file permissions, path traversal protection, and harness installation detection.
📝 Found 1 issue(s). See inline comments for details.
| // ResolveHarnessPath returns the path where the harness binary lives. | ||
| // It is placed inside the harness data directory so it does not collide | ||
| // with the Go CLI binary (both are now named "kimchi" after the merge). | ||
| // ResolveHarnessPath derives the harness binary path from the kimchi executable's |
There was a problem hiding this comment.
ℹ️🏗️ Design
The ResolveHarnessPath function now places the harness binary in the same directory as the CLI executable (e.g., /usr/local/bin/kimchi-code alongside /usr/local/bin/kimchi), rather than in the user-writable data directory (~/.local/share/kimchi/bin). This change may cause permission issues if the CLI is installed in a system directory, as updating the harness will now require write access to that system directory.
💡 Suggestion: Consider documenting this requirement or ensuring the installer handles permission elevation when the CLI is installed in a system path. Alternatively, fall back to the data directory if the binary directory is not writable.
Kimchi Summary
What changed
Changes the harness binary name from
kimchitokimchi-codeand installs it alongside the CLI executable instead of the user's data directory. Removes theguardAgainstSelfExecsafety check that was required when both binaries shared the same name.Why
Having both the CLI and harness named identically required fragile path resolution logic to prevent accidentally launching the CLI as its own harness. Using distinct names eliminates this ambiguity and the risk of infinite execution loops.
Key changes
cmd/harness.go: RemovedguardAgainstSelfExecfunction and its two call sites inrunHarness.internal/update/github_client.go: ChangedkimchiDevRepo.Binaryfrom"kimchi"to"kimchi-code".internal/update/harness.go: UpdatedResolveHarnessPathto derive the harness path from the CLI's directory (installingkimchi-codenext tokimchi) instead of the data directory.internal/update/extract_test.go,harness_test.go,workflow_test.go: Updated test assertions to expect thekimchi-codebinary name.Impact
kimchi-codein the same directory as the CLI. Existing harness installations at the previous data directory location will be ignored untilkimchi updateis run.