Repository navigation
Init clone repos (spec 37) - #69
Merged
Merged
Conversation
…l and init's stdout before spec 37 Written first, as spec 37 §5.2 and §10 ask: realpathOfNearest moves to the core, the load gains a fetchHint, and init gains --clone — none of the three may change these bytes.
…reader, every refusal by index and key (spec 37)
…, one copy for the output gate and the clone (spec 37)
…os with an injected runner (spec 37)
… the --offline advice (spec 37)
…es and asks, the confirmation names the clone (spec 37)
… sync, reports each, exits 1 on a failed clone (spec 37)
…ries planInit checked are taken in either mode The interactive branch kept no entries for a typed --clone, so its confirmation named no clone and nothing was cloned; the suite cannot drive that mode (spec 28's declared gap), so this is read, not run.
…one clones the missing ones (spec 37)
…mmand (spec 37 §13.3 item 29) repos clone reads --workspace from its parent when commander hands the value there.
…ap and the status line (spec 37)
…, so the Commands row keeps two cells
…hanges, and spec 37's own README pins craftar ui stays listed as shipped and never as unbuilt or under Later; the Next: after it and the "not built yet" sentence are gone by design.
…ctive mode checks C3–C5, names the clone and clones (review)
…it — they would move the checkout out of the checked destination (review)
…aped — one copy of the 0.30.1 check (review)
…throughs fail closed (review)
…and the URL rule said exactly (review)
…ars) are not handed to the clone's git (review)
… for a clone's destination (review)
… run; repos keeps its warnings with no entry (review)
…with a newline (review)
…ne can no longer widen the transports (review)
…k on Windows CI NODE_OPTIONS read the hook's backslashes as escapes, so the craftar child failed to start; and a temp dir on another drive has no relative spelling. Both were test defects, not product ones.
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
craftar@0.33.0to npm after approval in thenpmenvironment.craftar init --cloneclones every entry of the profile'sreposinto the workspace after the first sync (or after writingcraftar.yamlunder--no-sync): onegit clone --no-recurse-submodules [--branch=<ref>] -- <url> <path>per entry, sequential, git by the absolute path found onPATH,GIT_ALLOW_PROTOCOL=https:sshset last, git's output and prompt on the terminal.--no-clone; in a terminal the interactiveinitlists the repositories and asks (default no). Refusals C1–C6 before anything is written; a failed clone exits 1 with the workspace kept and the by-hand command printed; a refused first sync clones nothing.craftar reposlists the entries aspresent/missing/blocked(no program but the Forge load, nothing written;--jsonis a new tooling contract) andcraftar repos clone [<name>…]clones the missing ones (R1–R4; refuses a remote Forge that cannot be fetched).reposis read by one function,profileRepos(ProfileSchema.reposstays open):name/url/path/refin plain ASCII classes,https/sshonly, no credentials, refusals by index and key, never a value. Destinations are checked on real paths (realpathOfNearest, moved to the core) and again before each clone.--jsonkey changes.Built as spec 37 recommends, not yet ruled (§13)
§13.1 items 5 (real-path destination check), 6 (absolute git, workspace root as cwd), 15 (
reposopen in the schema, checked on read); §13.2 items 17–24; §13.3 items 29–37 and 39.Departures from spec 37's text (to record at the spec refresh)
git rev-parse --local-env-varslists (git 2.53) and any inheritedGIT_ALLOW_PROTOCOL(case-insensitive on win32), plusGIT_ALLOW_PROTOCOL=https:ssh(andGIT_TERMINAL_PROMPT=0off a terminal) — so inheritedgit -csettings (GIT_CONFIG_PARAMETERS/COUNT) do not reach the clone; credential variables (GIT_ASKPASS,GIT_SSH_COMMAND) do.initreads a leftovercraftar.lock(N1 refuses onlycraftar.yaml): its paths refuse a destination as incraftar repos.reposkey, and an R1 name, are printed only when shaped like a name and not a token (the 0.30.1nameShapedcheck, shared).craftar repositself (norepos list); padded columns;craftar reposprints the plan's warnings on stdout, also with no entry;--jsonwith no entry printsrepos: [].Test plan
npm run typecheck— exit 0 (fce5e80, after the bump)npm run build— exit 0 (fce5e80);craftar --versionprints 0.33.0npm test(vitest--maxWorkers=6, withouttest/ci.test.ts) on 4fa855b — 129 files passed, 1 skipped; 3274 tests passed, 10 skipped. Oracle skipped (no fixture) — no emitter, plan or status byte path changed; three pins committed first (test/init-clone-pins.test.ts).src/; a mutation check removed each security control (GIT_ALLOW_PROTOCOL,--,--no-recurse-submodules, real-path containment, the Forge check, the re-check,credentialFault, the scheme check, the host's leading dash,GIT_TERMINAL_PROMPT=0) and each made a test fail.git cloneor reaches the network: the CLI tests use a fake git (test/helpers/fake-git.ts).runIf(win32)tests (Git_Dir, an other-casegit_allow_protocol) run there only.--cloneis not run by the suite and was not tested by hand: the list, the question, a typed--clone(the path the review's two blockers were on, fixed by reading —0b95d8eand a core test composingaskInit→planInit), and--no-sync --clonewith a refused sync. The suite cannot drive the interactive mode (spec 28's declared gap).--cloneoverhttpsand oversshin a terminal and piped;Ctrl-Cduring a clone; on Windows thegit.exefound onPATHand a pasted by-hand line in bash, zsh,cmd.exeand PowerShell (a destination1.10, a refv1.2).