Skip to content

rebuild: testdata: GitClone steps clone git bundles kept beside the runbook, with no network - #1651

Merged
odgrim merged 1 commit into
rebuild/p6-classb-pr-e2e-readyfrom
rebuild/p6-classb-gitclone-bundles
Dec 2, 2026
Merged

odgrim merged 1 commit into
rebuild/p6-classb-pr-e2e-readyfrom
rebuild/p6-classb-gitclone-bundles

Conversation

@odgrim

@odgrim odgrim commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Stack: rebuild phase 6, rows class B skips, part 20 of 22: GitClone from git bundles. Base: #1650 (rows class B skips, part 19 of 22). Map: .more9s/rebuild.md on rebuild/main.

213 changed lines, 179 of them tests and test runbooks.

Change

  • Each fixture keeps its remotes as git bundles in test-remotes/, with a README giving the command that made them, and a test case's env has git read the remote's URL as the bundle: GIT_CONFIG_COUNT, GIT_CONFIG_KEY_n url.${RUNBOOKS_TEST_DIR}/test-remotes/<x>.bundle.insteadOf, GIT_CONFIG_VALUE_n the URL.
  • The 7 skipped GitClone steps run, success, with their outputs asserted:
  • feature-demos/file-workspace: generated-only, renamed staging-account, runs clone-infra, modify-repo and account-config (clone_path, root.hcl modified, account.hcl with its staging inputs). full-workspace-flow clones the same bundle, asserts clone_path, repo_owner, repo_name, and that modify-repo deleted CODEOWNERS.
  • feature-demos/git-clone: clone-generic and clone-helper take https://git.example.invalid/acme/infra.git from the test's inputs (gitUrl), and clone-helper a localPath, helper: clone_path, repo_owner, repo_name, README.md in the folder.
  • feature-demos/inputs-and-outputs: happy-path's clone-from-inputs and clone-merged clone runbooks-test.bundle and runbooks.bundle; clone-merged's NEW-SYNTAX.md is only on feature/new-syntax, the override's branch.
  • sample-runbooks/dual-clone: clone-after-cd, issue GitClone clones second repo inside first repo's directory #94's check: after cd-subdir's cd, the clone is in the working folder (infra/README.md), not in subdir (dir_not_exists subdir/infra). The TODO that waited for "a local bare repo" goes.
  • baseline/behaviour-changes/dual-clone.patch: regenerated for the test file's new lines (same changes, new context and index line).
  • Docs: testing.mdx's Testing GitClone blocks: a block with no prefilledUrl fails "Needs input: gitUrl", so give the URL in inputs; an offline example with a bundle; git takes the longest matching URL. blocks/git-clone/docs.mdx's Testing names the test case env route.

Decisions

  • The route is the lead's ruling (2026-12-01): ${RUNBOOKS_TEST_DIR} (67c56ac45) in env, git's insteadOf to a bundle. GitClone's refusal of file:// URLs and paths stays: the block is given the https URL, and only git, after the block's check, reads it as the bundle.
  • The folder is test-remotes/, as the token commit's testing.mdx example names it (beside test-stubs/), not remotes/: one name in the docs and the fixtures.
  • A block with a prefilledUrl keeps the runbook's GitHub URL, mapped. A block with none gets https://git.example.invalid/... from inputs: .invalid never resolves, so a mapping that broke couldn't reach a real host.
  • full-workspace-flow and happy-path, which cloned github.com, now clone bundles too (the lead's ruling 3): infra-live.bundle holds root.hcl and CODEOWNERS, the files the test reads, and nothing reads runbooks-test's files. git-clone's github-clone-with-auth is left as it was: a real authenticated clone with CI's secret.
  • The least history each test needs: one commit per bundle, except runbooks.bundle, which holds main (HEAD) and feature/new-syntax one commit on, so the branch the clone checked out can be told apart (G1). Each is made with HEAD main (the token commit's note: without HEAD a clone warns "remote HEAD refers to nonexistent ref"), a fixed author and date, so the README's command makes it again byte for byte.
  • The runbooks don't change; only the test files, test-remotes/, and dual-clone.patch's context.
  • The e2e map's dual-clone item stays left: it is the old overwrite dialog (git-clone.spec.ts:87-101 has Replace Existing), and this commit covers where the clone goes, not the dialog.

Gaps

  • CI's Runbook Tests jobs run the old CLI (cli/test), which skips a GitClone with no prefilledUrl (cli/test/executor.ts:2408) and passes ${RUNBOOKS_TEST_DIR} on as written, so these fixtures fail there. This commit depends on the skip agent's CI commit, which moves those jobs to the gate's runner, landing below it. Index row at the next index commit.
  • showFileTree has no effect in the rebuilt window (GitClone's docs), so clone-with-show-file-tree-false checks the clone into the folder the test gives, not a hidden file tree. Index row at the next index commit.
  • git-clone's github-clone-with-auth still clones github.com, with CI's RUNBOOKS_GITHUB_TOKEN, by the lead's ruling. Index row at the next index commit.

Evidence

Local, in a scratch worktree with a scratch HOME. CI's run on this head is the gate.

    • Restacked onto rebuild/main 20cc5f0, with the skip check now near the top: bun check, lint, fmt:check and knip clean; bun test packages/cli packages/core packages/app-renderer packages/platform-node scripts baseline blocks: 6386 pass, 0 fail. The counts below were taken before the restack, on the earlier base. A "skip only sign-in blocks" failure among them is the skip check, which sat below this commit then.
    • No network: every run below has https_proxy, HTTPS_PROXY, http_proxy, HTTP_PROXY and ALL_PROXY set to http://127.0.0.1:9, where nothing listens, and GITHUB_TOKEN, GH_TOKEN, RUNBOOKS_GITHUB_TOKEN empty. Without the mapping (N1) the same clone fails "fatal: unable to access 'https://github.com/gruntwork-io/runbooks-infrastructure-live-example/': Failed to connect to 127.0.0.1 port 9 after 0 ms: Couldn't connect to server".
    • HOME=$S/home-g76 bun baseline/gate/fixtures.ts testdata/sample-runbooks/dual-clone testdata/feature-demos/file-workspace testdata/feature-demos/inputs-and-outputs: "3 fixtures: 3 passed every test case, 0 failed, 0 missing; 4 test cases passed, 0 did not."
    • With testdata/feature-demos/git-clone added: "4 fixtures: 3 passed every test case, 1 failed, 0 missing; 7 test cases passed, 1 did not.", the one "github-clone-with-auth: gh-auth: Expected success, got skip: No login was found to sign in with." (no token here; CI has it).
    • HOME=$S/home-g76 bun packages/cli/src/main.ts test , the tree without the gate's patches:
    • inputs-and-outputs: "✓ happy-path", 1 passed.
    • git-clone: ✓ skip-without-credentials, generic-clone-public-repo, clone-with-show-file-tree-false; ✗ github-clone-with-auth (no token).
    • file-workspace: both cases "account-config: Expected success, got config_error: the repository prop of ", the change file-workspace.patch makes; clone-infra and modify-repo pass.
    • dual-clone: "verify-cwd.cwd ... does not match /subdir$", the cd change dual-clone.patch makes; clone-after-cd passes.
    • The README commands, run in empty folders: bundles byte-identical to the committed ones (cmp), heads dafe4038 (infra-live), 6e33c8a9 (infra), 14401fa6 (runbooks-test), bbee2bd5 main and b6268669 feature/new-syntax (runbooks).
    • testing.mdx's new example, run as written beside a GitClone with no prefilledUrl and infra.bundle: "✓ offline-clone". The same block with no inputs: "Expected success, got fail: Needs input: gitUrl".
    • Mutants, each run through the gate on the four fixtures as above (unmutated: 7 test cases pass, 1 did not, github-clone-with-auth); failing cases beyond that one:
    • G1 run.ts: the ref read as "": 1 (clone-merged NEW-SYNTAX.md)
    • G2 block.ts: localPath ignored: 3 (clone_path, both file-workspace cases and clone-helper)
    • G3 run.ts: owner and name read from "": 4 (repo_owner, repo_name)
    • G4 modify-repo.sh keeps CODEOWNERS: 1 (file_not_exists)
    • G5 dual-clone's clone-after-cd given prefilledLocalPath subdir/infra: 1 (../infra/README.md is not a file)
    • N1 file-workspace GIT_CONFIG_COUNT 0: 2 (the dead proxy, above)
    • N2 inputs-and-outputs GIT_CONFIG_COUNT 0: 1
    • N3 inputs-and-outputs maps runbooks only, so runbooks-test's URL reads runbooks.bundle-test: 1 (git could not clone)
    • HOME=$S/home-g76 bun test packages/cli blocks/git-clone blocks/git-pull-request scripts baseline: 1065 pass, 1 fail, "skip only sign-in blocks", on 18 skips, none GitClone: demo2 12 and lambda 6, the stubs agent's. behaviour-changes.test.ts: dual-clone.patch applies.
    • cspell 10.4.0 (docs/cspell.json) on testing.mdx and blocks/git-clone/docs.mdx: 0 issues.
    • bun run lint, fmt:check, knip, bun check: exit 0 each.

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
runbooks Ready Ready Preview Dec 2, 2026 2:03am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 214c1347-670c-423e-9ffc-35c67b9edd13

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…unbook, with no network

Change
- Each fixture keeps its remotes as git bundles in test-remotes/, with a
  README giving the command that made them, and a test case's env has git
  read the remote's URL as the bundle: GIT_CONFIG_COUNT, GIT_CONFIG_KEY_n
  `url.${RUNBOOKS_TEST_DIR}/test-remotes/<x>.bundle.insteadOf`,
  GIT_CONFIG_VALUE_n the URL.
- The 7 skipped GitClone steps run, `success`, with their outputs
  asserted:
  - feature-demos/file-workspace: generated-only, renamed
    staging-account, runs clone-infra, modify-repo and account-config
    (clone_path, root.hcl modified, account.hcl with its staging inputs).
    full-workspace-flow clones the same bundle, asserts clone_path,
    repo_owner, repo_name, and that modify-repo deleted CODEOWNERS.
  - feature-demos/git-clone: clone-generic and clone-helper take
    `https://git.example.invalid/acme/infra.git` from the test's inputs
    (gitUrl), and clone-helper a localPath, `helper`: clone_path,
    repo_owner, repo_name, README.md in the folder.
  - feature-demos/inputs-and-outputs: happy-path's clone-from-inputs and
    clone-merged clone runbooks-test.bundle and runbooks.bundle;
    clone-merged's NEW-SYNTAX.md is only on feature/new-syntax, the
    override's branch.
  - sample-runbooks/dual-clone: clone-after-cd, issue #94's check: after
    cd-subdir's cd, the clone is in the working folder (infra/README.md),
    not in subdir (dir_not_exists subdir/infra). The TODO that waited for
    "a local bare repo" goes.
- baseline/behaviour-changes/dual-clone.patch: regenerated for the test
  file's new lines (same changes, new context and index line).
- Docs: testing.mdx's Testing GitClone blocks: a block with no
  prefilledUrl fails "Needs input: gitUrl", so give the URL in inputs; an
  offline example with a bundle; git takes the longest matching URL.
  blocks/git-clone/docs.mdx's Testing names the test case env route.

Decisions
- The route is the lead's ruling (2026-12-01): ${RUNBOOKS_TEST_DIR}
  (67c56ac45) in env, git's insteadOf to a bundle. GitClone's refusal of
  file:// URLs and paths stays: the block is given the https URL, and
  only git, after the block's check, reads it as the bundle.
- The folder is test-remotes/, as the token commit's testing.mdx example
  names it (beside test-stubs/), not remotes/: one name in the docs and
  the fixtures.
- A block with a prefilledUrl keeps the runbook's GitHub URL, mapped. A
  block with none gets `https://git.example.invalid/...` from inputs:
  `.invalid` never resolves, so a mapping that broke couldn't reach a
  real host.
- full-workspace-flow and happy-path, which cloned github.com, now clone
  bundles too (the lead's ruling 3): infra-live.bundle holds root.hcl and
  CODEOWNERS, the files the test reads, and nothing reads runbooks-test's
  files. git-clone's github-clone-with-auth is left as it was: a real
  authenticated clone with CI's secret.
- The least history each test needs: one commit per bundle, except
  runbooks.bundle, which holds main (HEAD) and feature/new-syntax one
  commit on, so the branch the clone checked out can be told apart (G1).
  Each is made with `HEAD main` (the token commit's note: without HEAD a
  clone warns "remote HEAD refers to nonexistent ref"), a fixed author
  and date, so the README's command makes it again byte for byte.
- The runbooks don't change; only the test files, test-remotes/, and
  dual-clone.patch's context.
- The e2e map's dual-clone item stays left: it is the old overwrite
  dialog (git-clone.spec.ts:87-101 has Replace Existing), and this commit
  covers where the clone goes, not the dialog.

Gaps
- CI's Runbook Tests jobs run the old CLI (cli/test), which skips a
  GitClone with no prefilledUrl (cli/test/executor.ts:2408) and passes
  ${RUNBOOKS_TEST_DIR} on as written, so these fixtures fail there. This
  commit depends on the skip agent's CI commit, which moves those jobs to
  the gate's runner, landing below it. Index row at the next index
  commit.
- showFileTree has no effect in the rebuilt window (GitClone's docs), so
  clone-with-show-file-tree-false checks the clone into the folder the
  test gives, not a hidden file tree. Index row at the next index commit.
- git-clone's github-clone-with-auth still clones github.com, with CI's
  RUNBOOKS_GITHUB_TOKEN, by the lead's ruling. Index row at the next index
  commit.

Evidence
- Restacked onto rebuild/main 20cc5f0, with the skip check now near
  the top: bun check, lint, fmt:check and knip clean; bun test
  packages/cli packages/core packages/app-renderer
  packages/platform-node scripts baseline blocks: 6386 pass, 0 fail.
  The counts below were taken before the restack, on the earlier
  base. A "skip only sign-in blocks" failure among them is the skip
  check, which sat below this commit then.
- No network: every run below has https_proxy, HTTPS_PROXY, http_proxy,
  HTTP_PROXY and ALL_PROXY set to http://127.0.0.1:9, where nothing
  listens, and GITHUB_TOKEN, GH_TOKEN, RUNBOOKS_GITHUB_TOKEN empty.
  Without the mapping (N1) the same clone fails "fatal: unable to access
  'https://github.com/gruntwork-io/runbooks-infrastructure-live-example/':
  Failed to connect to 127.0.0.1 port 9 after 0 ms: Couldn't connect to
  server".
- HOME=$S/home-g76 bun baseline/gate/fixtures.ts
  testdata/sample-runbooks/dual-clone testdata/feature-demos/file-workspace
  testdata/feature-demos/inputs-and-outputs: "3 fixtures: 3 passed every
  test case, 0 failed, 0 missing; 4 test cases passed, 0 did not."
- With testdata/feature-demos/git-clone added: "4 fixtures: 3 passed
  every test case, 1 failed, 0 missing; 7 test cases passed, 1 did not.",
  the one "github-clone-with-auth: gh-auth: Expected success, got skip: No
  login was found to sign in with." (no token here; CI has it).
- HOME=$S/home-g76 bun packages/cli/src/main.ts test <fixture>, the tree
  without the gate's patches:
  - inputs-and-outputs: "✓ happy-path", 1 passed.
  - git-clone: ✓ skip-without-credentials, generic-clone-public-repo,
    clone-with-show-file-tree-false; ✗ github-clone-with-auth (no token).
  - file-workspace: both cases "account-config: Expected success, got
    config_error: the `repository` prop of <TemplateInline>", the change
    file-workspace.patch makes; clone-infra and modify-repo pass.
  - dual-clone: "verify-cwd.cwd ... does not match \/subdir$", the cd
    change dual-clone.patch makes; clone-after-cd passes.
- The README commands, run in empty folders: bundles byte-identical to
  the committed ones (cmp), heads dafe4038 (infra-live), 6e33c8a9
  (infra), 14401fa6 (runbooks-test), bbee2bd5 main and b6268669
  feature/new-syntax (runbooks).
- testing.mdx's new example, run as written beside a GitClone with no
  prefilledUrl and infra.bundle: "✓ offline-clone". The same block with
  no inputs: "Expected success, got fail: Needs input: gitUrl".
- Mutants, each run through the gate on the four fixtures as above
  (unmutated: 7 test cases pass, 1 did not, github-clone-with-auth);
  failing cases beyond that one:
  - G1 run.ts: the ref read as "": 1 (clone-merged NEW-SYNTAX.md)
  - G2 block.ts: localPath ignored: 3 (clone_path, both file-workspace
    cases and clone-helper)
  - G3 run.ts: owner and name read from "": 4 (repo_owner, repo_name)
  - G4 modify-repo.sh keeps CODEOWNERS: 1 (file_not_exists)
  - G5 dual-clone's clone-after-cd given prefilledLocalPath subdir/infra:
    1 (../infra/README.md is not a file)
  - N1 file-workspace GIT_CONFIG_COUNT 0: 2 (the dead proxy, above)
  - N2 inputs-and-outputs GIT_CONFIG_COUNT 0: 1
  - N3 inputs-and-outputs maps runbooks only, so runbooks-test's URL
    reads runbooks.bundle-test: 1 (git could not clone)
- HOME=$S/home-g76 bun test packages/cli blocks/git-clone
  blocks/git-pull-request scripts baseline: 1065 pass, 1 fail, "skip only
  sign-in blocks", on 18 skips, none GitClone: demo2 12 and lambda 6, the
  stubs agent's. behaviour-changes.test.ts: dual-clone.patch applies.
- cspell 10.4.0 (docs/cspell.json) on testing.mdx and
  blocks/git-clone/docs.mdx: 0 issues.
- bun run lint, fmt:check, knip, bun check: exit 0 each.
@odgrim
odgrim force-pushed the rebuild/p6-classb-gitclone-bundles branch from b42a108 to 42190f7 Compare December 2, 2026 02:03
@odgrim
odgrim marked this pull request as ready for review December 2, 2026 02:20
@odgrim
odgrim requested a review from yhakbar as a code owner December 2, 2026 02:20
@odgrim
odgrim merged commit 465ec73 into rebuild/main Dec 2, 2026
15 of 16 checks passed

This branch was successfully deployed

1 active deployment
Preview — 42190f7f Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant