Accept workspace-root cwd in validate when worktree is set#1
Open
cengebretson wants to merge 1 commit into
Open
Accept workspace-root cwd in validate when worktree is set#1cengebretson wants to merge 1 commit into
cengebretson wants to merge 1 commit into
Conversation
A workspace-level stage (e.g. qa-automation) intentionally runs at the workspace root via next_action.cwd "." even when the feature has a worktree. ResolveCWD already maps "."/"" to the workspace root, but ValidateRepos rejected it as not under any recorded worktree. Validation now accepts a cwd that resolves to the workspace root, keeping it consistent with ResolveCWD.
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.
What
orc validaterejected a workspace-levelnext_action.cwd(e.g.".") whenever the feature also had a worktree, failing withnext_action.cwd: "." does not match any recorded worktree.Why
ResolveCWDalready maps"."/""to the workspace root, and workspace-level stages (for exampleqa-automation) intentionally run there even when the feature has a worktree (see theSTORY-456-export-apitestdata fixture, which has a worktree andcwd: ".").ValidateReposdisagreed withResolveCWDand would reject that valid state. The two are now consistent: a cwd that resolves to the workspace root is accepted, a cwd under a recorded worktree is accepted, and anything else is still rejected.Changes
internal/state/state.go:ValidateReposaccepts a cwd resolving to the workspace root (in addition to under a worktree).internal/state/state_test.go: addTestValidateRepos_CWDWorkspaceRootWithWorktree(failed before the fix, passes after). ExistingTestValidateRepos_CWDNotUnderWorktreestill rejects a genuinely-wrong path.CHANGELOG.md: Unreleased > Fixed entry.Verification
go test ./...green (full suite).make lintreports 0 issues;gofmtclean.main, green with the fix.Risk
Low. The change only widens validation to accept an already-supported cwd value; it does not loosen the rejection of paths that are neither the workspace root nor under a worktree.