diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index c32f91d20e..6e1316dfab 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -40,4 +40,4 @@ jobs: run: | make -C $GOPATH/src/github.com/shipwright-io/build \ sanity-check \ - verify-codegen + verify-generate diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 268d423e6c..9db70938d2 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -147,7 +147,7 @@ As you make changes to the code, you can redeploy your controller with: ``` You may use the following command to re-generate CRDs of build and buildrun if you change their spec: ```sh - make generate-crds + make generate ``` ### Tear it down diff --git a/Makefile b/Makefile index dfbc8925b3..bdf04b3591 100644 --- a/Makefile +++ b/Makefile @@ -107,9 +107,11 @@ generate: hack/update-codegen.sh hack/generate-fakes.sh hack/generate-copyright.sh + hack/install-controller-gen.sh + "$(CONTROLLER_GEN)" "$(CRD_OPTIONS)" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=deploy/crds -.PHONY: verify-codegen -verify-codegen: generate +.PHONY: verify-generate +verify-generate: generate @hack/verify-generate.sh ginkgo: @@ -299,6 +301,3 @@ kind: ./hack/install-kind.sh ./hack/install-registry.sh -generate-crds: - ./hack/install-controller-gen.sh - "$(CONTROLLER_GEN)" "$(CRD_OPTIONS)" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=deploy/crds diff --git a/hack/README.md b/hack/README.md index 7547a0e028..484c7044a9 100644 --- a/hack/README.md +++ b/hack/README.md @@ -18,3 +18,4 @@ This directory contains several scripts useful in the development process of Shi - `release.sh` Creates a new release of Shipwright Build. - `update-codegen.sh` Updates auto-generated client libraries. - `verify-codegen.sh` Verifies that auto-generated client libraries are up-to-date. +- `verify-generate.sh` Check both uncommitted/unstaged changes for CRDs and the client code. diff --git a/hack/verify-generate.sh b/hack/verify-generate.sh index 304dd342ba..b672e64ed1 100755 --- a/hack/verify-generate.sh +++ b/hack/verify-generate.sh @@ -6,11 +6,11 @@ # Verifies if a developer has forgot to run the # `make generate` so that all the changes in the -# clientset should also be pushed +# clientset and CRDs should also be pushed -if [[ -n "$(git status --porcelain -- pkg/client)" ]]; then - echo "The pkg/client package contains changes:" - git --no-pager diff --name-only -- pkg/client +if [[ -n "$(git status --porcelain -- pkg/client pkg/apis deploy/crds)" ]]; then + echo "The pkg/client, pkg/apis package or CRDs contains changes:" + git --no-pager diff --name-only -- pkg/client pkg/apis deploy/crds echo echo "Run make generate to those commit changes!" exit 1 diff --git a/pkg/apis/build/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/build/v1alpha1/zz_generated.deepcopy.go index a66bc797f7..9028a98f6c 100644 --- a/pkg/apis/build/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/build/v1alpha1/zz_generated.deepcopy.go @@ -1,4 +1,3 @@ -//go:build !ignore_autogenerated // +build !ignore_autogenerated // Copyright The Shipwright Contributors