From b4809c03c5202275657a5b1df39d83e4c7f4081e Mon Sep 17 00:00:00 2001 From: k8s-infra-cherrypick-robot <90416843+k8s-infra-cherrypick-robot@users.noreply.github.com> Date: Tue, 13 Feb 2024 21:38:05 -0800 Subject: [PATCH] Add make rule to prepare branch for release (#1731) Change-Id: Iaad4e043f8c295edbe16fa08f8ad431d8d96d8e5 Co-authored-by: Aldo Culquicondor --- .github/ISSUE_TEMPLATE/NEW_RELEASE.md | 9 ++++++--- Makefile | 19 ++++++++++++++++--- charts/kueue/Chart.yaml | 2 +- charts/kueue/values.yaml | 8 +++----- hack/e2e-test.sh | 2 +- hack/multikueue-e2e-test.sh | 2 +- 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/NEW_RELEASE.md b/.github/ISSUE_TEMPLATE/NEW_RELEASE.md index 3f9c2c5214..6d47cba36f 100644 --- a/.github/ISSUE_TEMPLATE/NEW_RELEASE.md +++ b/.github/ISSUE_TEMPLATE/NEW_RELEASE.md @@ -14,13 +14,16 @@ Please do not remove items from the checklist At least two for minor or major releases. At least one for a patch release. - [ ] Verify that the changelog in this issue and the CHANGELOG folder is up-to-date - [ ] Use https://github.com/kubernetes/release/tree/master/cmd/release-notes to gather notes. - Example: `release-notes --org kubernetes-sigs --repo kueue --branch release-0.3 --start-sha 4a0ebe7a3c5f2775cdf5fc7d60c23225660f8702 --end-sha a51cf138afe65677f5f5c97f8f8b1bc4887f73d2` + Example: `release-notes --org kubernetes-sigs --repo kueue --branch release-0.3 --start-sha 4a0ebe7a3c5f2775cdf5fc7d60c23225660f8702 --end-sha a51cf138afe65677f5f5c97f8f8b1bc4887f73d2 --dependencies=false --required-author=""` - [ ] For major or minor releases (v$MAJ.$MIN.0), create a new release branch. - - [ ] an OWNER creates a vanilla release branch with + - [ ] An OWNER creates a vanilla release branch with `git branch release-$MAJ.$MIN main` - [ ] An OWNER pushes the new release branch with `git push release-$MAJ.$MIN` -- [ ] Update `README.md`, `CHANGELOG`, `charts/kueue/Chart.yaml` (`appVersion`) and `charts/kueue/values.yaml` (`controllerManager.manager.image.tag`) in the release branch: +- [ ] Update the release branch: + - [ ] Update `RELEASE_BRANCH` and `RELEASE_VERSION` in `Makefile` and run `make prepare-release-branch` + - [ ] Update the `CHANGELOG` + - [ ] Submit a pull request with the changes: - [ ] An OWNER [prepares a draft release](https://github.com/kubernetes-sigs/kueue/releases) - [ ] Write the change log into the draft release. - [ ] Run diff --git a/Makefile b/Makefile index 3aa2c9464f..425a1945ef 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,11 @@ version_pkg = sigs.k8s.io/kueue/pkg/version LD_FLAGS += -X '$(version_pkg).GitVersion=$(GIT_TAG)' LD_FLAGS += -X '$(version_pkg).GitCommit=$(shell git rev-parse HEAD)' +# Update these variables when preparing a new release or a release branch. +# Then run `make prepare-release-branch` +RELEASE_VERSION=v0.5.3 +RELEASE_BRANCH=main + .PHONY: all all: generate fmt vet build @@ -180,20 +185,22 @@ run-test-e2e-%: K8S_VERSION = $(@:run-test-e2e-%=%) run-test-e2e-%: FORCE @echo Running e2e for k8s ${K8S_VERSION} E2E_KIND_VERSION="kindest/node:v$(K8S_VERSION)" KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) CREATE_KIND_CLUSTER=$(CREATE_KIND_CLUSTER) ARTIFACTS="$(ARTIFACTS)/$@" IMAGE_TAG=$(IMAGE_TAG) GINKGO_ARGS="$(GINKGO_ARGS)" ./hack/e2e-test.sh + @$(call clean-manifests) JOBSET_VERSION = $(shell $(GO_CMD) list -m -f "{{.Version}}" sigs.k8s.io/jobset) run-test-multikueue-e2e-%: K8S_VERSION = $(@:run-test-multikueue-e2e-%=%) run-test-multikueue-e2e-%: FORCE @echo Running multikueue e2e for k8s ${K8S_VERSION} E2E_KIND_VERSION="kindest/node:v$(K8S_VERSION)" KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) CREATE_KIND_CLUSTER=$(CREATE_KIND_CLUSTER) ARTIFACTS="$(ARTIFACTS)/$@" IMAGE_TAG=$(IMAGE_TAG) GINKGO_ARGS="$(GINKGO_ARGS)" JOBSET_VERSION=$(JOBSET_VERSION) ./hack/multikueue-e2e-test.sh + @$(call clean-manifests) .PHONY: ci-lint ci-lint: golangci-lint $(GOLANGCI_LINT) run --timeout 15m0s .PHONY: verify -verify: gomod-verify vet ci-lint fmt-verify toc-verify manifests generate update-helm generate-apiref - git --no-pager diff --exit-code config/components apis charts/kueue/templates client-go site/content/en/docs/reference +verify: gomod-verify vet ci-lint fmt-verify toc-verify manifests generate update-helm generate-apiref prepare-release-branch + git --no-pager diff --exit-code config/components apis charts/kueue/templates client-go site/ ##@ Build @@ -243,7 +250,7 @@ ifndef ignore-not-found ignore-not-found = false endif -clean-manifests = (cd config/components/manager && $(KUSTOMIZE) edit set image controller=gcr.io/k8s-staging-kueue/kueue:main) +clean-manifests = (cd config/components/manager && $(KUSTOMIZE) edit set image controller=gcr.io/k8s-staging-kueue/kueue:$(RELEASE_BRANCH)) .PHONY: install install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. @@ -286,6 +293,12 @@ artifacts: kustomize yq helm # Revert the image changes $(YQ) e '.controllerManager.manager.image.repository = "$(STAGING_IMAGE_REGISTRY)/$(IMAGE_NAME)" | .controllerManager.manager.image.tag = "main" | .controllerManager.manager.image.pullPolicy = "Always"' -i charts/kueue/values.yaml +.PHONY: prepare-release-branch +prepare-release-branch: yq kustomize + sed -r 's/v[0-9]+\.[0-9]+\.[0-9]+/$(RELEASE_VERSION)/g' -i README.md -i site/config.toml + $(YQ) e '.appVersion = "$(RELEASE_VERSION)"' -i charts/kueue/Chart.yaml + @$(call clean-manifests) + ##@ Tools # Build an image that can be used with kubectl debug diff --git a/charts/kueue/Chart.yaml b/charts/kueue/Chart.yaml index 3b19e9071b..69476c0564 100644 --- a/charts/kueue/Chart.yaml +++ b/charts/kueue/Chart.yaml @@ -18,4 +18,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.5.3" +appVersion: "v0.5.3" diff --git a/charts/kueue/values.yaml b/charts/kueue/values.yaml index 0c1a90d8af..94725329f9 100644 --- a/charts/kueue/values.yaml +++ b/charts/kueue/values.yaml @@ -9,9 +9,9 @@ enablePrometheus: false enableCertManager: false # Customize controlerManager controllerManager: - #featureGates: - # - name: PartialAdmission - # enabled: true + #featureGates: + # - name: PartialAdmission + # enabled: true kubeRbacProxy: image: repository: gcr.io/kubebuilder/kube-rbac-proxy @@ -22,8 +22,6 @@ controllerManager: manager: image: repository: gcr.io/k8s-staging-kueue/kueue - # tag, if defined will use the given image tag, else Chart.AppVersion will be used - tag: main # This should be set to 'IfNotPresent' for released version pullPolicy: Always resources: diff --git a/hack/e2e-test.sh b/hack/e2e-test.sh index 6b0c172df3..61f60202c4 100755 --- a/hack/e2e-test.sh +++ b/hack/e2e-test.sh @@ -35,7 +35,7 @@ function cleanup { fi cluster_cleanup $KIND_CLUSTER_NAME fi - (cd config/components/manager && $KUSTOMIZE edit set image controller=gcr.io/k8s-staging-kueue/kueue:main) + exit 0 } function startup { diff --git a/hack/multikueue-e2e-test.sh b/hack/multikueue-e2e-test.sh index 1c5aa53f83..5ab8eef3c8 100755 --- a/hack/multikueue-e2e-test.sh +++ b/hack/multikueue-e2e-test.sh @@ -46,7 +46,7 @@ function cleanup { cluster_cleanup $WORKER1_KIND_CLUSTER_NAME cluster_cleanup $WORKER2_KIND_CLUSTER_NAME fi - (cd config/components/manager && $KUSTOMIZE edit set image controller=gcr.io/k8s-staging-kueue/kueue:main) + exit 0 }