Repository navigation
Conversation
|
|
Member
|
Hey, thanks for the PR. Could you sign the CLA when you get a chance so we can review it? |
Author
|
I can't sign the Contributor License Agreement on the author's behalf. It has to be signed from the author's GitHub account through the CLA link on this PR. No code changed in this round. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The bug
A folder and a symlink to it were treated as two workspaces. The engine host named its directory by a hash of the path as spelled, and the project store keyed projects the same way. So
/tmp/xand/private/tmp/x(or any linked~/Code) got two engines and two project entries, andcodeaf engine --status/--stopon the link missed the engine that was running.The change
A workspace is now named by its resolved path (
filepath.EvalSymlinks, falling back to the cleaned spelling when the path does not exist yet) wherever it becomes a key:internal/enginehost: the host directory hash inwhere.internal/gitidentity:ProjectKey.cmd/codeaf/engine.go:engineWorkspace, so--workspaceand--dirresolve the same way.internal/tui3/projectcmd.go: a/projectpin stores the resolved folder.How it was tested
TestASymlinkToAWorkspaceHoldsTheSameEngine(internal/enginehost/workspace_symlink_test.go): fails on the base commit witha folder and a symlink to it hold two engines, passes on this change. Commands:go test ./internal/enginehost/ -run TestASymlinkToAWorkspaceHoldsTheSameEngine -count=1.go vetandgo testfor./internal/enginehost/and./internal/gitidentity/pass.go build ./cmd/codeafandgo vet ./internal/tui3/pass.Not verified here
/project <link>followed by a launch from the resolved directory, andengine --status/--stopthrough a link against a running engine) was not run.gitidentity,cmd/codeafortui3changes directly.Regression test: fails on base twice (/a folder and a symlink to it hold two engines/), passes on fix twice (
go test ./internal/enginehost/ -run TestASymlinkToAWorkspaceHoldsTheSameEngine -count=1)Fixes #1761