Skip to content

feat(cli): send the git repositories cloned inside a project - #26

Merged
Flosk6 merged 2 commits into
masterfrom
feat/cli-nested-repositories
Oct 10, 2026
Merged

Flosk6 merged 2 commits into
masterfrom
feat/cli-nested-repositories

Conversation

@Flosk6

@Flosk6 Flosk6 commented Oct 10, 2026

Copy link
Copy Markdown
Owner

What and why

spawner up skipped the git repositories cloned inside a project. git lists a directory with its own .git as one entry, and collectFiles() took every such entry for a submodule. A workspace repository holding clones of its services (api/, web/...) therefore sent none of them: a compose file building ../api passed the local check, where the directory exists, and failed on the server with compose.path_not_found. The way around was a source per clone in spawner.yaml and a --source <name>=<dir> at every spawner up.

collectFiles() now goes down such a directory and lists it with its own git ls-files, by the same rules (tracked files, untracked ones that are not ignored, no untracked node_modules/, vendor/, .env or secrets, upload.include), under its path, recursively:

  • a submodule that .gitmodules declares is still skipped, with the same reason, in a monorepo's directory too;
  • another worktree of the same repository checked out inside it (an .claude/worktrees/x that is not ignored) is skipped as git worktree (not sent), instead of sending a second copy of the project; a worktree of another repository is sent;
  • the upload.include globs, relative to the project, are rewritten for git in each cloned repository (globUnder), and every path git lists is still checked against the whole glob;
  • the upload limits count everything sent.

A clone that the project's .gitignore ignores stays home, as any ignored path. A deploy from git (--ref, a branch in the dashboard) still has only what the repository commits: docs/cli.md says so.

Tried on a real workspace holding five clones: 1,387 files, 11 MiB, listed in 0.2 s, no node_modules.

Checks

  • Tests next to the code, a compose fixture for a policy change, or an end-to-end check
  • Documentation and CHANGELOG.md updated when the behaviour changes

pnpm lint, pnpm typecheck and pnpm test pass locally (CLI: 119 tests, 15 new, all failing on the previous archive.ts). The end-to-end tests run in CI.

git lists a directory with its own .git as one entry, which spawner up
skipped as a submodule: a workspace holding clones of its services sent
none of them, so a compose file building ../api passed the local check
and failed on the server (compose.path_not_found), and each clone
needed a source in spawner.yaml and a --source at every spawner up.

- Such a repository is now listed by its own git, by the same rules
  (tracked files, untracked ones that are not ignored, the default
  excludes, upload.include), under its path, and so are the
  repositories cloned inside it. The upload limits count them all.
- Submodules that .gitmodules declares are still skipped, and so are
  the other worktrees of the same repository checked out inside it
  ("git worktree (not sent)"); a worktree of another repository is
  sent.
- The upload.include globs are rewritten for git in each cloned
  repository; every path it lists is still checked against the whole
  glob.
spawner up now runs git in every repository cloned inside a project,
whose config could name a core.fsmonitor command that git ls-files runs.

- git runs with core.fsmonitor off.
- spawner up names the clones it sends in its progress line, and
  spawner up --json in uploads[].repositories.
@Flosk6
Flosk6 merged commit 6b2234e into master Oct 10, 2026
4 checks passed
@Flosk6
Flosk6 deleted the feat/cli-nested-repositories branch October 10, 2026 23:37
@Flosk6 Flosk6 mentioned this pull request Oct 10, 2026
2 tasks done
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