feat(local-dev): deploy from a sibling git worktree via up --worktree/--branch#6031
Open
Yicong-Huang wants to merge 2 commits into
Open
feat(local-dev): deploy from a sibling git worktree via up --worktree/--branch#6031Yicong-Huang wants to merge 2 commits into
Yicong-Huang wants to merge 2 commits into
Conversation
…/--branch Split the orchestration tree (SELF_ROOT — where local-dev.sh lives, always main's copy of the tooling: the script, tui.py, docker overlay) from the application source tree (SOURCE_ROOT). `up`/`auto` now take --worktree=PATH or --branch=NAME to build/run a sibling worktree without disturbing the main checkout; a plain `up` returns to this checkout. The choice persists to $STATE_DIR/deploy-source so status/down/logs/<svc>/auto all follow it, and status --json gains "worktree"/"source" fields. Build stamps are namespaced per source so switching worktrees can't skip a needed build. The TUI mirrors all of this: u/a accept the selectors and re-point the banner live. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Automated Reviewer SuggestionsBased on the
|
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The deploy source's branch + short-sha was computed inline in four spots (status JSON, status banner, the up Deploy-target line, the TUI dashboard banner). Fold the three pre-existing copies plus the one this feature added into a single `_git_head` helper. 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.
What changes were proposed in this PR?
bin/local-dev.shcan now build and run the stack from a sibling git worktree while the orchestration tooling itself always runs from the canonical checkout.The key split is SELF_ROOT (where
local-dev.sh,tui.py, and the docker overlay live — the tooling) vs SOURCE_ROOT (the application tree that gets built/run, whichREPO_ROOTnow points at).up/autoaccept--worktree=PATHor--branch=NAME(resolved to the worktree that has the branch checked out). A plainupreturns to this checkout.$STATE_DIR/deploy-source, sostatus/down/logs/ single-service rebuild /autoall act on the active deployment.upre-marks the deploy target (branch / sha / worktree) at startup, andstatus --jsongains"worktree"and"source"fields..env/ overlay stay pinned to the canonical checkout (orchestration), while the app schema/DDL still comes from the deployed source.u/aaccept the same selectors, and the banner + SRC-dirty column re-point to the active tree live (the shell exportsTEXERA_DEPLOY_SOURCE; the TUI re-reads the persisted pointer after a switch).--branch/--worktreefail fast with a clear, actionable message before anything is built or started.Any related issues, documentation, discussions?
Closes #6030. The
--helptext and the in-TUI help (h) document the new selectors.How was this PR tested?
Extended both existing local-dev test suites (all green):
bin/local-dev/tests/test_local_dev_sh.sh— 25 checks (6 new):--helpdocuments the selectors;status --jsoncarriesworktree/source; a stale pointer is dropped and falls back to self; a valid pointer to a throwaway worktree (created and cleaned up in-test) is honored and reports its branch; invalid--branchand--worktreefail fast with rc=1.bin/local-dev/tests/test_local_dev_tui.py— 43 checks (5 new):_stamp_dir_formatches the shell'ssha1(path)[:12]namespacing;_resolve_deploy_sourcereturns self when the pointer is missing/stale/points at a non-checkout, and the worktree when valid.Run:
Also verified manually that
status --jsonagainst a persisted worktree pointer reports that worktree's branch/sha/source, and thatbash -n/py_compilepass.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.8 (Claude Code)