BBC2-20 BBC2-26 add bb repo list and bb repo clone#26
Open
b2l wants to merge 2 commits into
Open
Conversation
- 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)
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
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>: resolveworkspace/repoor barerepoto SSH (default) or HTTPS (--https) clone URL via API, delegate togit cloneresolve-workspacehelper with fallback chain:-Rflag → current repo → sole workspace → error with listparse-urlto acceptbitbucket.comalongsidebitbucket.orglistRepositories,getRepositoryCloneLinks)Test plan
bun test— 167 pass, 0 failbun run lint— cleanbb repo listfrom inside a BB repobb repo listfrom outside any repo (auto-selects sole workspace)bb repo list -q <name>filters by substringbb repo clone <repo>with bare name (workspace auto-detected)bb repo clone workspace/repowith explicit workspacebb repo clone --https <repo>uses HTTPS URL