Skip to content

Commit 400685a

Browse files
author
Tyler Harris
committed
2 parents 4318dbb + 076d550 commit 400685a

File tree

15 files changed

+214
-187
lines changed

15 files changed

+214
-187
lines changed

.circleci/config.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ env: &env
55
TERRAGRUNT_VERSION: NONE
66
PACKER_VERSION: NONE
77
GRUNTWORK_INSTALLER_VERSION: v0.0.39
8-
MODULE_CI_VERSION: v0.52.6
9-
GOLANG_VERSION: 1.18
8+
MODULE_CI_VERSION: v0.57.3
9+
GOLANG_VERSION: 1.21.1
1010
GO111MODULE: auto
1111
CGO_ENABLED: 1
1212
defaults: &defaults
1313
docker:
14-
- image: 087285199408.dkr.ecr.us-east-1.amazonaws.com/circle-ci-test-image-base:go1.18-tf1.4-tg39.1-pck1.8-ci50.7
14+
- image: 087285199408.dkr.ecr.us-east-1.amazonaws.com/circle-ci-test-image-base:go1.21-tf1.5-tg39.1-pck1.8-ci50.7
1515
<<: *env
1616
install_gruntwork_utils: &install_gruntwork_utils
1717
name: Install gruntwork utils
@@ -34,7 +34,7 @@ jobs:
3434
- run:
3535
command: |
3636
pip install pre-commit
37-
go get golang.org/x/tools/cmd/goimports
37+
go install golang.org/x/tools/cmd/goimports@v0.24.0
3838
export GOPATH=~/go/bin && export PATH=$PATH:$GOPATH
3939
pre-commit install
4040
pre-commit run --all-files
@@ -64,8 +64,8 @@ jobs:
6464
deploy:
6565
<<: *env
6666
macos:
67-
xcode: 14.2.0
68-
resource_class: macos.x86.medium.gen2
67+
xcode: 15.3.0
68+
resource_class: macos.m1.medium.gen1
6969
steps:
7070
- checkout
7171
- attach_workspace:
@@ -81,6 +81,9 @@ jobs:
8181
- run:
8282
name: Compile and sign the binaries
8383
command: |
84+
export AC_PASSWORD=${MACOS_AC_PASSWORD}
85+
export AC_PROVIDER=${MACOS_AC_PROVIDER}
86+
8487
sign-binary --install-macos-sign-dependencies --os mac .gon_amd64.hcl
8588
sign-binary --os mac .gon_arm64.hcl
8689
echo "Done signing the binary"

.gon_amd64.hcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ bundle_id = "io.gruntwork.app.terragrunt"
77

88
apple_id {
99
username = "[email protected]"
10-
password = "@env:MACOS_AC_PASSWORD"
1110
}
1211

1312
sign {

.gon_arm64.hcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ bundle_id = "io.gruntwork.app.terragrunt"
77

88
apple_id {
99
username = "[email protected]"
10-
password = "@env:MACOS_AC_PASSWORD"
1110
}
1211

1312
sign {

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @brikis98 @hongil0316
1+
* @hongil0316

README.md

Lines changed: 68 additions & 61 deletions
Large diffs are not rendered by default.

cmd/git-xargs.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ func parseGitXargsConfig(c *cli.Context) (*config.GitXargsConfig, error) {
4242
config.SecondsToSleepBetweenPRs = c.Int("seconds-between-prs")
4343
config.PullRequestRetries = c.Int("max-pr-retries")
4444
config.SecondsToSleepWhenRateLimited = c.Int("seconds-to-wait-when-rate-limited")
45+
maxConcurrentClones := c.Int("max-concurrent-clones")
46+
if maxConcurrentClones > 0 {
47+
config.CloneJobsLimiter = make(chan struct{}, maxConcurrentClones)
48+
}
49+
4550
config.NoSkipCI = c.Bool("no-skip-ci")
4651
config.RetainLocalRepos = c.Bool("keep-cloned-repositories")
4752
// By default, prepend "[skip ci]" to commit messages, unless the user passed --no-skip-ci

common/common.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ const (
2424
DefaultPullRequestDescription = "git-xargs programmatic pull request"
2525
MaxPullRequestRetriesFlagName = "max-pr-retries"
2626
SecondsToWaitWhenRateLimitedFlagName = "seconds-to-wait-when-rate-limited"
27+
MaxConcurrentClonesFlagName = "max-concurrent-clones"
2728
NoSkipCIFlagName = "no-skip-ci"
2829
KeepClonedRepositoriesFlagName = "keep-cloned-repositories"
29-
DefaultMaxConcurrentRepos = 0
30+
DefaultMaxConcurrentClones = 4
3031
DefaultSecondsBetweenPRs = 1
3132
DefaultMaxPullRequestRetries = 3
3233
DefaultSecondsToWaitWhenRateLimited = 60
@@ -111,6 +112,11 @@ var (
111112
Usage: "The number of additional seconds to sleep before attempting to open a PR again, when rate limited by GitHub. Defaults to 60.",
112113
Value: DefaultSecondsToWaitWhenRateLimited,
113114
}
115+
GenericMaxConcurrentClonesFlag = cli.IntFlag{
116+
Name: MaxConcurrentClonesFlagName,
117+
Usage: "The maximum number of concurrent clones to run at once. Defaults to 4. If set to 0 no limit will be applied.",
118+
Value: DefaultMaxConcurrentClones,
119+
}
114120
GenericNoSkipCIFlag = cli.BoolFlag{
115121
Name: NoSkipCIFlagName,
116122
Usage: "By default, git-xargs prepends \"[skip ci]\" to its commit messages. Pass this flag to prevent \"[skip ci]\" from being prepending to commit messages.",

config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type GitXargsConfig struct {
3939
SecondsToSleepBetweenPRs int
4040
PullRequestRetries int
4141
SecondsToSleepWhenRateLimited int
42+
CloneJobsLimiter chan struct{}
4243
NoSkipCI bool
4344
RetainLocalRepos bool
4445
Ticker *time.Ticker
@@ -72,6 +73,7 @@ func NewGitXargsConfig() *GitXargsConfig {
7273
SecondsToSleepBetweenPRs: common.DefaultSecondsBetweenPRs,
7374
SecondsToSleepWhenRateLimited: common.DefaultSecondsToWaitWhenRateLimited,
7475
PullRequestRetries: common.DefaultMaxPullRequestRetries,
76+
CloneJobsLimiter: make(chan struct{}, common.DefaultMaxConcurrentClones),
7577
NoSkipCI: false,
7678
RetainLocalRepos: false,
7779
}

go.mod

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
module github.com/gruntwork-io/git-xargs
22

3-
go 1.18
3+
go 1.21
44

55
require (
6-
github.com/go-git/go-git/v5 v5.6.1
6+
github.com/go-git/go-git/v5 v5.13.0
77
github.com/google/go-github/v43 v43.0.0
88
github.com/gruntwork-io/go-commons v0.8.2
99
github.com/pterm/pterm v0.12.42
10-
github.com/sirupsen/logrus v1.7.0
11-
github.com/stretchr/testify v1.7.0
10+
github.com/sirupsen/logrus v1.9.0
11+
github.com/stretchr/testify v1.10.0
1212
github.com/urfave/cli v1.22.5
1313
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
1414
)
1515

1616
require (
1717
atomicgo.dev/cursor v0.1.1 // indirect
1818
atomicgo.dev/keyboard v0.2.8 // indirect
19-
github.com/Microsoft/go-winio v0.5.2 // indirect
20-
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
21-
github.com/acomagu/bufpipe v1.0.4 // indirect
22-
github.com/cloudflare/circl v1.1.0 // indirect
19+
dario.cat/mergo v1.0.0 // indirect
20+
github.com/Microsoft/go-winio v0.6.1 // indirect
21+
github.com/ProtonMail/go-crypto v1.1.3 // indirect
22+
github.com/cloudflare/circl v1.3.7 // indirect
2323
github.com/containerd/console v1.0.3 // indirect
2424
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
25+
github.com/cyphar/filepath-securejoin v0.2.5 // indirect
2526
github.com/davecgh/go-spew v1.1.1 // indirect
2627
github.com/emirpasic/gods v1.18.1 // indirect
2728
github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 // indirect
28-
github.com/go-git/gcfg v1.5.0 // indirect
29-
github.com/go-git/go-billy/v5 v5.4.1 // indirect
30-
github.com/golang/protobuf v1.4.3 // indirect
29+
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
30+
github.com/go-git/go-billy/v5 v5.6.0 // indirect
31+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
32+
github.com/golang/protobuf v1.5.0 // indirect
3133
github.com/google/go-querystring v1.1.0 // indirect
3234
github.com/gookit/color v1.5.0 // indirect
33-
github.com/imdario/mergo v0.3.13 // indirect
3435
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
3536
github.com/kevinburke/ssh_config v1.2.0 // indirect
3637
github.com/lithammer/fuzzysearch v1.1.5 // indirect
@@ -39,18 +40,21 @@ require (
3940
github.com/pmezard/go-difflib v1.0.0 // indirect
4041
github.com/rivo/uniseg v0.2.0 // indirect
4142
github.com/russross/blackfriday/v2 v2.0.1 // indirect
42-
github.com/sergi/go-diff v1.2.0 // indirect
43+
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
4344
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
44-
github.com/skeema/knownhosts v1.1.0 // indirect
45+
github.com/skeema/knownhosts v1.3.0 // indirect
4546
github.com/xanzy/ssh-agent v0.3.3 // indirect
4647
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
47-
golang.org/x/crypto v0.6.0 // indirect
48-
golang.org/x/net v0.7.0 // indirect
49-
golang.org/x/sys v0.5.0 // indirect
50-
golang.org/x/term v0.5.0 // indirect
51-
golang.org/x/text v0.7.0 // indirect
48+
golang.org/x/crypto v0.32.0 // indirect
49+
golang.org/x/mod v0.17.0 // indirect
50+
golang.org/x/net v0.34.0 // indirect
51+
golang.org/x/sync v0.10.0 // indirect
52+
golang.org/x/sys v0.29.0 // indirect
53+
golang.org/x/term v0.28.0 // indirect
54+
golang.org/x/text v0.21.0 // indirect
55+
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
5256
google.golang.org/appengine v1.6.7 // indirect
53-
google.golang.org/protobuf v1.25.0 // indirect
57+
google.golang.org/protobuf v1.33.0 // indirect
5458
gopkg.in/warnings.v0 v0.1.2 // indirect
55-
gopkg.in/yaml.v3 v3.0.0 // indirect
59+
gopkg.in/yaml.v3 v3.0.1 // indirect
5660
)

0 commit comments

Comments
 (0)