Accept git+ sources for the sync/prune env-definition positional - #216
Merged
Conversation
Besides a local staging directory, sync and prune now take a pip-style git spec — git+URL[@ref][#subdirectory=DIR] — shallow-fetched (init + fetch --depth 1 + detached FETCH_HEAD checkout, so branch, tag, and full-SHA refs all work) into a temp checkout that lives until process exit, then fed through the existing local-dir path unchanged. Lets a cluster converge straight from the catalog repo without an scp step. Co-Authored-By: Claude Fable 5 <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.
Summary
rootstock syncandrootstock prunetake an optional positional source of env definitions; until now it had to be a local staging directory. This adds a second form — a pip-style git spec:REFmay be a branch, tag, or full commit SHA (omitted = the remote default branch);subdirectorydefaults to the repo root. This lets a cluster converge straight from the catalog repo, skipping the scp/staging round-trip.How
rootstock/gitsource.py: spec parsing plus a shallow fetch (init+fetch --depth 1+ detachedFETCH_HEADcheckout — one code path that covers branch/tag/SHA refs, unlikeclone --branch) into a temp dir removed at process exit. That lifetime is sufficient: the planner hashes the staged files and the build phase copies them into the install root, so nothing durable lives in the checkout.resolve_source_argincommands/common.pydispatches git specs vs. local dirs; the sync and prune adapters both use it, preserving the existing contract (unusable source → exit 2).source_dirpath the planner already had.gitbinary, malformed specs, unknown fragment options, refs that don't exist (git stderr attached), andsubdirectoryvalues that are missing or escape the repo.Testing
tests/test_gitsource.py: parse cases (ssh userinfo vs. ref@, branch names with/, malformed specs) and real fetches against a local repo overfile://(default branch, tag, SHA, subdirectory, error paths).tests/cli/test_sync.py: adapter wiring (git spec materialized before planning; fetch failure → exit 2).tests/cli+tests/commandssuites pass (304 tests); ruff check/format and ty clean.git+file://…#subdirectory=environmentsrepo produced the expected build/download plan.🤖 Generated with Claude Code