feat(env): support standalone-repo worktrees in isolated envs#413
Open
jason10lee wants to merge 2 commits into
Open
feat(env): support standalone-repo worktrees in isolated envs#413jason10lee wants to merge 2 commits into
jason10lee wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
All Submissions:
Changes proposed in this Pull Request:
Isolated environments can already mount worktrees of monorepo plugins/themes (
n env create --worktree <plugin>:<branch>). This extends--worktreeto standalone checkouts that live outside the monorepo atrepos/{plugins,themes}/<name>— private or customer-specific plugins, licensed extensions, etc. — so they can be branch-isolated in an env the same way monorepo projects are.A standalone checkout is discovered by path (no registration). Its worktree is created from the checkout's own git history at
worktrees/standalone/<repo>/<branch>and mounted serving-only: unlike a monorepo worktree, a standalone repo is not a pnpm workspace member, so it gets no/newspack-monorepo/...workspace mount.n env destroyandn env listunderstand the new mount shape and clean it up / display it.This is additive — monorepo (tier-1) and legacy worktree handling are unchanged.
bin/worktree.sh:n worktree add|remove <branch> --repo <name>for standalone checkouts;n worktree listenumerates standalone worktrees alongside workspace ones.bin/worktree-mounts.sh(new): a small, host-testable helper that emits tier-aware compose volume lines (monorepo → serving + workspace-member; standalone → serving only). Unit-tested.bin/env.sh:env create --worktreeresolves standalone checkouts by path and mounts them tier-aware; the worktree-mount parser,env destroy, andenv listgain standalone awareness.How to test the changes in this Pull Request:
repos/plugins/<name>(clone, unzip, orgit worktree add).n env create <env> --worktree <name>:<branch> --up— confirm the env comes up and the worktree is created atworktrees/standalone/<name>/<branch>.n build <name>, see the change).n env list— confirm the env shows the standalone worktree.n worktree list— confirm a[<name>]section lists the standalone worktree.n env destroy <env>— confirm the env, its worktree, and the branch are all removed.--worktree newspack-plugin:<branch>) and confirm tier-1 both-path mounting and cleanup still work.bash tests/worktree-mounts.test.sh— unit tests for the mount helper pass.Other information: