diff --git a/Makefile b/Makefile index 504aa007b..cf299c7bc 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,11 @@ $(MYGOBIN)/pluginator: cd cmd/pluginator; \ go install . +# Build from local source. +$(MYGOBIN)/prchecker: + cd cmd/prchecker; \ + go install . + # Build from local source. $(MYGOBIN)/kustomize: cd kustomize; \ @@ -85,6 +90,7 @@ install-tools: \ $(MYGOBIN)/gorepomod \ $(MYGOBIN)/mdrip \ $(MYGOBIN)/pluginator \ + $(MYGOBIN)/prchecker \ $(MYGOBIN)/stringer ### Begin kustomize plugin rules. diff --git a/cmd/prchecker/go.mod b/cmd/prchecker/go.mod new file mode 100644 index 000000000..e9ae2acfc --- /dev/null +++ b/cmd/prchecker/go.mod @@ -0,0 +1,8 @@ +module sigs.k8s.io/kustomize/cmd/prchecker + +go 1.15 + +require ( + github.com/google/go-github v17.0.0+incompatible + github.com/google/go-querystring v1.0.0 // indirect +) diff --git a/cmd/prchecker/go.sum b/cmd/prchecker/go.sum new file mode 100644 index 000000000..c90713b76 --- /dev/null +++ b/cmd/prchecker/go.sum @@ -0,0 +1,4 @@ +github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= diff --git a/travis/module-span/multi-module-span.go b/cmd/prchecker/main.go similarity index 89% rename from travis/module-span/multi-module-span.go rename to cmd/prchecker/main.go index 95a7d20a6..369b764bd 100644 --- a/travis/module-span/multi-module-span.go +++ b/cmd/prchecker/main.go @@ -1,12 +1,16 @@ -// multi-module-span script: -// A script which can detect when a pull request would make changes which -// span a series of restricted directories (ex: multiple go modules or projects) +// prchecker examines pull requests // -// When a pull request includes files which span two modules the script will -// exit with a non-zero exit code. +// - When a PR includes files from multiple modules that we'd rather not +// modify at the same time (in an effort to have more self-contained +// release notes), the script will exit with a non-zero exit code. // -// Running: -// go run multi-module-span.go -owner=kubernetes-sigs -repo=kustomize -pr=2997 cmd/config api/ kustomize/ kyaml/ +// Usage: +// +// go run . \ +// -owner=kubernetes-sigs \ +// -repo=kustomize \ +// -pr=2997 \ +// cmd/config api kustomize kyaml package main