Skip to content

Commit

Permalink
Bitbucket: increase bitbucket branch limit (default 25 -> 1000) (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
brainexe committed Jan 25, 2022
1 parent 55f01ec commit c7dd5f0
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v2.5.2
with:
version: v1.41.1
version: v1.44.0
only-new-issues: true
gosec:
name: GoSec
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ run: dep
go run $(FLAGS) cmd/bot/main.go

run-cli:
go run cmd/cli/main.go
go run $(FLAGS) cmd/cli/main.go

run-cli-config:
go run cmd/cli/main.go -config config.yaml
Expand Down Expand Up @@ -55,4 +55,4 @@ mocks: dep
# live reload
air:
command -v air || curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin
air
air
7 changes: 6 additions & 1 deletion client/vcs/bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ import (
"github.com/pkg/errors"
)

// by default bitbucket will only return the most recent 25 branches...
const bitbucketBranchLimit = 1000

type bitbucket struct {
client *bitbucketApi.DefaultApiService
cfg config.Bitbucket
}

// LoadBranches will load the branches from a stash/bitbucket server
func (f *bitbucket) LoadBranches() (branchNames []string, err error) {
branchesRaw, err := f.client.GetBranches(f.cfg.Project, f.cfg.Repository, nil)
branchesRaw, err := f.client.GetBranches(f.cfg.Project, f.cfg.Repository, map[string]interface{}{
"limit": bitbucketBranchLimit,
})
if err != nil {
return
}
Expand Down
13 changes: 8 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/andygrunwald/go-jira v1.14.0
github.com/bndr/gojenkins v1.1.0
github.com/brainexe/viper v1.8.2
github.com/gfleury/go-bitbucket-v1 v0.0.0-20210826163055-dff2223adeac
github.com/gfleury/go-bitbucket-v1 v0.0.0-20220125132502-90a950f9bcba
github.com/go-redis/redis/v7 v7.4.1
github.com/google/go-github v17.0.0+incompatible
github.com/gookit/color v1.5.0
Expand All @@ -27,14 +27,17 @@ require (
)

require (
github.com/aws/aws-sdk-go v1.42.25
github.com/aws/aws-sdk-go v1.42.40
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
github.com/jcelliott/lumber v0.0.0-20160324203708-dd349441af25 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/spf13/afero v1.8.0 // indirect
github.com/spf13/viper v1.9.0 // indirect
github.com/stretchr/objx v0.3.0 // indirect
golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
gopkg.in/ini.v1 v1.64.0 // indirect
golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
gopkg.in/ini.v1 v1.66.3 // indirect
)
Loading

0 comments on commit c7dd5f0

Please sign in to comment.