Repository navigation
fix(prepare): Keep dry-run version bumps in the worktree - #954
Merged
Merged
Conversation
Fixes #953 Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0de3e53. Configure here.
BYK
approved these changes
Nov 2, 2026
8 tasks done
This branch was previously deployed
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.

Fixes #953.
craft prepare --dry-runwith automatic version bumping wrote the bump into the user's checkout, not the temporary worktree. So the next dry run computed a higher version.The cause:
findConfigFile()cached the original checkout's.craft.ymlpath from before isolation. After the dry run moved into the worktree,getReleaseUnitDir()still resolved to the original checkout, andnpm versionran there. Worktree mode allowed it.Changes:
findConfigFile()now caches per working directory, so the config path is found again after the dry run moves into or out of the worktree.createDryRunIsolation()now moves into the worktree directory that matches the original working directory, not the worktree root. Without this, a.craft.ymlin a subdirectory would not be found once the cache stops hiding the mismatch. Dependency symlinks go to the same place.release/<version>stayed behind. Once both runs compute the same version, the second dry run would fail with "Branch already exists".The new e2e test runs an automatic npm workspace bump twice. It checks that both runs compute the same version, that
package.jsonandgit statusstay unchanged, and that no release branch is left. The existing worktree test now checks that the release branch is removed, where it used to note that the branch may stay. I checked both behaviors by hand with the built binary: workspace config and subdirectory config, run twice each. I could not run the e2e suite locally because a sandbox git hook rejects its test author identity, so CI is the first full run.via @BYK.
--
View Session in Sentry