Skip to content

Commit 805a402

Browse files
committed
Merge branch 'release/0.17.1'
2 parents 3fd098a + e74f409 commit 805a402

File tree

26 files changed

+125
-52
lines changed

26 files changed

+125
-52
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,20 @@ bb repo list --columns name --columns slug
9090
bb repo list --sort name
9191
```
9292

93+
`list` commands also support the `--query` flag to filter the output by a specific query. The query syntax is similar to the one used in the Bitbucket web interface. For example, to filter Pull Requests updated after a specific date:
94+
95+
```bash
96+
bb pullrequest list --query 'updated_on > 2025-12-31'
97+
```
98+
99+
Please refer to the [Bitbucket API documentation](https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering) for more information about the supported query syntax and fields.
100+
101+
`list` commands also support the 'page-length' flag to set the number of items to retrieve per request to Bitbucket API at a time. By default, the page length is set on the profile and the default is 50. You can set it to a value between 1 and 100.
102+
103+
```bash
104+
bb repo list --page-length 25
105+
```
106+
93107
### Output
94108

95109
`bb` outputs a table by default. You can change the output format with the `--output` flag, by setting the `BB_OUTPUT_FORMAT` environment variable, or by modifying the profile configuration (See [Profiles](#profiles)).

cmd/artifact/list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var listOptions struct {
2323
Query string
2424
Columns *flags.EnumSliceFlag
2525
SortBy *flags.EnumFlag
26+
PageLength int
2627
}
2728

2829
func init() {
@@ -34,6 +35,7 @@ func init() {
3435
listCmd.Flags().StringVar(&listOptions.Query, "query", "", "Query string to filter artifacts")
3536
listCmd.Flags().Var(listOptions.Columns, "columns", "Comma-separated list of columns to display")
3637
listCmd.Flags().Var(listOptions.SortBy, "sort", "Column to sort by")
38+
listCmd.Flags().IntVar(&listOptions.PageLength, "page-length", 0, "Number of items per page to retrieve from Bitbucket. Default is the profile's default page length")
3739
_ = listCmd.RegisterFlagCompletionFunc(listOptions.Columns.CompletionFunc("columns"))
3840
_ = listCmd.RegisterFlagCompletionFunc(listOptions.SortBy.CompletionFunc("sort"))
3941
}

cmd/branch/list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var listOptions struct {
1919
Repository string
2020
Columns *flags.EnumSliceFlag
2121
SortBy *flags.EnumFlag
22+
PageLength int
2223
}
2324

2425
func init() {
@@ -29,6 +30,7 @@ func init() {
2930
listCmd.Flags().StringVar(&listOptions.Repository, "repository", "", "Repository to list branches from. Defaults to the current repository")
3031
listCmd.Flags().Var(listOptions.Columns, "columns", "Comma-separated list of columns to display")
3132
listCmd.Flags().Var(listOptions.SortBy, "sort", "Column to sort by")
33+
listCmd.Flags().IntVar(&listOptions.PageLength, "page-length", 0, "Number of items per page to retrieve from Bitbucket. Default is the profile's default page length")
3234
_ = listCmd.RegisterFlagCompletionFunc(listOptions.Columns.CompletionFunc("columns"))
3335
_ = listCmd.RegisterFlagCompletionFunc(listOptions.SortBy.CompletionFunc("sort"))
3436
}

cmd/commit/list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var listOptions struct {
2323
Query string
2424
Columns *flags.EnumSliceFlag
2525
SortBy *flags.EnumFlag
26+
PageLength int
2627
}
2728

2829
func init() {
@@ -34,6 +35,7 @@ func init() {
3435
listCmd.Flags().StringVar(&listOptions.Query, "query", "", "Query string to filter commits")
3536
listCmd.Flags().Var(listOptions.Columns, "columns", "Comma-separated list of columns to display")
3637
listCmd.Flags().Var(listOptions.SortBy, "sort", "Column to sort by")
38+
listCmd.Flags().IntVar(&listOptions.PageLength, "page-length", 0, "Number of items per page to retrieve from Bitbucket. Default is the profile's default page length")
3739
_ = listCmd.RegisterFlagCompletionFunc(listOptions.Columns.CompletionFunc("columns"))
3840
_ = listCmd.RegisterFlagCompletionFunc(listOptions.SortBy.CompletionFunc("sort"))
3941
}

cmd/component/list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var listOptions struct {
2323
Query string
2424
Columns *flags.EnumSliceFlag
2525
SortBy *flags.EnumFlag
26+
PageLength int
2627
}
2728

2829
func init() {
@@ -34,6 +35,7 @@ func init() {
3435
listCmd.Flags().StringVar(&listOptions.Query, "query", "", "Query string to filter components")
3536
listCmd.Flags().Var(listOptions.Columns, "columns", "Comma-separated list of columns to display")
3637
listCmd.Flags().Var(listOptions.SortBy, "sort", "Column to sort by")
38+
listCmd.Flags().IntVar(&listOptions.PageLength, "page-length", 0, "Number of items per page to retrieve from Bitbucket. Default is the profile's default page length")
3739
_ = listCmd.RegisterFlagCompletionFunc(listOptions.Columns.CompletionFunc("columns"))
3840
_ = listCmd.RegisterFlagCompletionFunc(listOptions.SortBy.CompletionFunc("sort"))
3941
}

cmd/gpg-key/list.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ var listCmd = &cobra.Command{
1616
}
1717

1818
var listOptions struct {
19-
Owner string
20-
Columns *flags.EnumSliceFlag
21-
SortBy *flags.EnumFlag
19+
Owner string
20+
Columns *flags.EnumSliceFlag
21+
SortBy *flags.EnumFlag
22+
PageLength int
2223
}
2324

2425
func init() {
@@ -29,6 +30,7 @@ func init() {
2930
listCmd.Flags().StringVar(&listOptions.Owner, "user", "", "Owner of the keys")
3031
listCmd.Flags().Var(listOptions.Columns, "columns", "Comma-separated list of columns to display")
3132
listCmd.Flags().Var(listOptions.SortBy, "sort", "Column to sort by")
33+
listCmd.Flags().IntVar(&listOptions.PageLength, "page-length", 0, "Number of items per page to retrieve from Bitbucket. Default is the profile's default page length")
3234
_ = listCmd.RegisterFlagCompletionFunc(listOptions.Columns.CompletionFunc("columns"))
3335
_ = listCmd.RegisterFlagCompletionFunc(listOptions.SortBy.CompletionFunc("sort"))
3436
}

cmd/issue/attachment/list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var listOptions struct {
2424
IssueID *flags.EnumFlag
2525
Columns *flags.EnumSliceFlag
2626
SortBy *flags.EnumFlag
27+
PageLength int
2728
}
2829

2930
func init() {
@@ -37,6 +38,7 @@ func init() {
3738
listCmd.Flags().StringVar(&listOptions.Query, "query", "", "Query string to filter attachments")
3839
listCmd.Flags().Var(listOptions.Columns, "columns", "Comma-separated list of columns to display")
3940
listCmd.Flags().Var(listOptions.SortBy, "sort", "Column to sort by")
41+
listCmd.Flags().IntVar(&listOptions.PageLength, "page-length", 0, "Number of items per page to retrieve from Bitbucket. Default is the profile's default page length")
4042
_ = listCmd.MarkFlagRequired("issue")
4143
_ = listCmd.RegisterFlagCompletionFunc(listOptions.IssueID.CompletionFunc("issue"))
4244
_ = listCmd.RegisterFlagCompletionFunc(listOptions.Columns.CompletionFunc("columns"))

cmd/issue/comment/list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var listOptions struct {
2424
Query string
2525
Columns *flags.EnumSliceFlag
2626
SortBy *flags.EnumFlag
27+
PageLength int
2728
}
2829

2930
func init() {
@@ -37,6 +38,7 @@ func init() {
3738
listCmd.Flags().StringVar(&listOptions.Query, "query", "", "Query string to filter comments")
3839
listCmd.Flags().Var(listOptions.Columns, "columns", "Comma-separated list of columns to display")
3940
listCmd.Flags().Var(listOptions.SortBy, "sort", "Column to sort by")
41+
listCmd.Flags().IntVar(&listOptions.PageLength, "page-length", 0, "Number of items per page to retrieve from Bitbucket. Default is the profile's default page length")
4042
_ = listCmd.MarkFlagRequired("issue")
4143
_ = listCmd.RegisterFlagCompletionFunc(listOptions.IssueID.CompletionFunc("issue"))
4244
_ = listCmd.RegisterFlagCompletionFunc(listOptions.Columns.CompletionFunc("columns"))

cmd/pipeline/list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var listOptions struct {
2424
Query string
2525
Columns *flags.EnumSliceFlag
2626
SortBy *flags.EnumFlag
27+
PageLength int
2728
}
2829

2930
func init() {
@@ -35,6 +36,7 @@ func init() {
3536
listCmd.Flags().StringVar(&listOptions.Query, "query", "", "Query string to filter pipelines")
3637
listCmd.Flags().Var(listOptions.Columns, "columns", "Comma-separated list of columns to display")
3738
listCmd.Flags().Var(listOptions.SortBy, "sort", "Column to sort by")
39+
listCmd.Flags().IntVar(&listOptions.PageLength, "page-length", 0, "Number of items per page to retrieve from Bitbucket. Default is the profile's default page length")
3840
_ = listCmd.RegisterFlagCompletionFunc(listOptions.Columns.CompletionFunc("columns"))
3941
_ = listCmd.RegisterFlagCompletionFunc(listOptions.SortBy.CompletionFunc("sort"))
4042
}

cmd/pipeline/step/list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var listOptions struct {
2525
PipelineID *flags.EnumFlag
2626
Columns *flags.EnumSliceFlag
2727
SortBy *flags.EnumFlag
28+
PageLength int
2829
ShowLogsCommand bool
2930
}
3031

@@ -38,6 +39,7 @@ func init() {
3839
listCmd.Flags().Var(listOptions.PipelineID, "pipeline", "Pipeline to list steps from")
3940
listCmd.Flags().Var(listOptions.Columns, "columns", "Comma-separated list of columns to display")
4041
listCmd.Flags().Var(listOptions.SortBy, "sort", "Column to sort by")
42+
listCmd.Flags().IntVar(&listOptions.PageLength, "page-length", 0, "Number of items per page to retrieve from Bitbucket. Default is the profile's default page length")
4143
listCmd.Flags().BoolVar(&listOptions.ShowLogsCommand, "show-logs-command", false, "Show the command to get the logs for each step")
4244
_ = listCmd.MarkFlagRequired("pipeline")
4345
_ = listCmd.RegisterFlagCompletionFunc(listOptions.PipelineID.CompletionFunc("pipeline"))

0 commit comments

Comments
 (0)