Skip to content

feat(repo): #54 enrich repo list and add move command#57

Merged
tyrantkhan merged 1 commit into
mainfrom
feat/54-repo-enrich-archive
Apr 10, 2026
Merged

feat(repo): #54 enrich repo list and add move command#57
tyrantkhan merged 1 commit into
mainfrom
feat/54-repo-enrich-archive

Conversation

@tyrantkhan
Copy link
Copy Markdown
Owner

Summary

  • bb repo list --details — adds last commit date and open PR count columns, fetched concurrently with bounded parallelism (10 goroutines)
  • bb repo move <slug> --project KEY — moves a repo to a different Bitbucket project, with optional --prefix for renaming (e.g. --prefix "Archived-")
  • api.Count() helper to get total size from a paginated endpoint without fetching all items
  • Updated bb-skill.md (v1.2.0) and commands.md with new commands and workspace members docs

Test plan

  • bb repo list --details --limit 5 shows Last Commit and Open PRs columns
  • bb repo list (without --details) works as before
  • bb repo move <slug> --project <key> moves repo to target project
  • bb repo move <slug> --project <key> --prefix "Archived-" moves and renames
  • bb repo move without args shows error
  • bb repo move <slug> without --project shows error

repo list --details fetches last commit date and open PR count
concurrently for each repo.

repo move relocates a repo to a different project with an optional
name prefix (e.g. --prefix "Archived-").
@tyrantkhan tyrantkhan merged commit c5c9090 into main Apr 10, 2026
7 checks passed
@tyrantkhan tyrantkhan deleted the feat/54-repo-enrich-archive branch April 10, 2026 15:17
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a bb repo move command and a --details flag for bb repo list to show commit dates and PR counts. It also introduces an api.Count helper. Feedback notes that the Visibility column is missing from the detailed view, the --details flag is not reflected in JSON output, and documentation was added for an unimplemented bb workspace members command.

Comment thread cmd/repo/list.go
Comment on lines +117 to +137
headers := []string{"Name", "Project", "Slug", "Language", "Last Commit", "Open PRs", "Updated"}
rows := make([][]string, len(repos))
for i, r := range repos {
projectKey := ""
if r.Project != nil {
projectKey = r.Project.Key
}
lastCommit := "-"
if detailsMap[i].LastCommit != "" {
lastCommit = models.FormatTime(detailsMap[i].LastCommit)
}
rows[i] = []string{
r.Name,
projectKey,
r.Slug,
r.Language,
lastCommit,
fmt.Sprintf("%d", detailsMap[i].OpenPRs),
models.FormatTime(r.UpdatedOn),
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Visibility column is missing in the detailed view, which creates an inconsistency with the default list view. It's recommended to include it to maintain a consistent user experience across both views.

				headers := []string{"Name", "Project", "Slug", "Visibility", "Language", "Last Commit", "Open PRs", "Updated"}
				rows := make([][]string, len(repos))
				for i, r := range repos {
					projectKey := ""
					if r.Project != nil {
						projectKey = r.Project.Key
					}
					lastCommit := "-"
					if detailsMap[i].LastCommit != "" {
						lastCommit = models.FormatTime(detailsMap[i].LastCommit)
					}
					rows[i] = []string{
						r.Name,
						projectKey,
						r.Slug,
						r.Visibility(),
						r.Language,
						lastCommit,
						fmt.Sprintf("%d", detailsMap[i].OpenPRs),
						models.FormatTime(r.UpdatedOn),
					}
				}

Comment thread cmd/repo/list.go
models.FormatTime(r.UpdatedOn),
}
}
return output.Format(format, repos, headers, rows)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When the --details flag is used with --format json, the output currently only contains the standard repository data. The extra details (last commit and open PR count) are not included in the JSON response because repos (a slice of models.Repository) does not contain these fields. To provide a complete JSON response, consider defining a temporary struct that embeds models.Repository and adds the new fields, then populating and returning that instead.

Comment thread docs/bb-skill.md
Comment on lines +122 to +126
### Workspaces

| Command | Description |
|---|---|
| `bb workspace members` | List workspace members (`--workspace`, `--limit`, `--format`) |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Documentation for bb workspace members is being added, but the implementation of this command is not present in this pull request. This could lead to user confusion if they attempt to use a command that hasn't been implemented yet. Please ensure the command is included in this PR or remove these documentation changes.

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