Skip to content

BBC2-20 BBC2-26 add bb repo list and bb repo clone#26

Open
b2l wants to merge 2 commits into
mainfrom
b2lpowa/bbc2-20-26-repo-list-clone
Open

BBC2-20 BBC2-26 add bb repo list and bb repo clone#26
b2l wants to merge 2 commits into
mainfrom
b2lpowa/bbc2-20-26-repo-list-clone

Conversation

@b2l
Copy link
Copy Markdown
Owner

@b2l b2l commented Apr 27, 2026

Summary

  • bb repo list: paginated listing with name filter (-q), limit (-l), workspace auto-detection (current repo or sole workspace from API)
  • bb repo clone <repo>: resolve workspace/repo or bare repo to SSH (default) or HTTPS (--https) clone URL via API, delegate to git clone
  • Shared resolve-workspace helper with fallback chain: -R flag → current repo → sole workspace → error with list
  • Fix parse-url to accept bitbucket.com alongside bitbucket.org
  • Backend with tests (listRepositories, getRepositoryCloneLinks)

Test plan

  • bun test — 167 pass, 0 fail
  • bun run lint — clean
  • bb repo list from inside a BB repo
  • bb repo list from outside any repo (auto-selects sole workspace)
  • bb repo list -q <name> filters by substring
  • bb repo clone <repo> with bare name (workspace auto-detected)
  • bb repo clone workspace/repo with explicit workspace
  • bb repo clone --https <repo> uses HTTPS URL

b2l added 2 commits April 27, 2026 14:54
- bb repo list: paginated listing with name filter (-q), limit (-l),
  workspace auto-detection (current repo or sole workspace from API)
- bb repo clone <repo>: resolve workspace/repo to SSH (default) or
  HTTPS (--https) clone URL via API, delegate to git clone
- Shared resolve-workspace helper with fallback chain:
  -R flag → current repo → sole workspace → error with list
- Fix parse-url to accept bitbucket.com alongside bitbucket.org
- Backend with tests (listRepositories, getRepositoryCloneLinks)
- Move workspace resolution from commands/repo/ to shared/workspace/
  so it's reusable by any workspace-scoped command
- Throw WorkspaceResolutionError instead of calling process.exit()
  (matches resolveRepository pattern in shared/repository/)
- Inject dependencies (detectFromRepo, fetchWorkspaceSlugs) so shared/
  doesn't import backend/ — respects boundary rules
- Add 10 tests covering all paths: override, repo detection, sole
  workspace, no workspaces, multiple workspaces, error propagation
- Fix git clone output: drop .quiet() so git streams naturally
- Lowercase workspace/slug in parseRepoArg (matches parseOverride)
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