From cefe99022a6d18bc1b6c9c516d989da69fe91bb5 Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Tue, 6 Aug 2024 21:56:50 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Set=20previous=20release=20tag?= =?UTF-8?q?=20version=20for=20RELEASE=20CANDIDATE/BETA=20RELEASE=20(#10435?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Set previous release tag version for RELEASE CANDIDATE/BETA RELEASE Signed-off-by: chandankumar4 * Remove unused variable and update release-notes cmd Signed-off-by: chandankumar4 * Update release process document Signed-off-by: chandankumar4 * Add notes for first pre-release version Signed-off-by: chandankumar4 * Replace PREVIOUS_VERSION_TAG with PREVIOUS_RELEASE_TAG Signed-off-by: chandankumar4 --------- Signed-off-by: chandankumar4 --- Makefile | 7 +------ docs/release/release-tasks.md | 19 +++++++++++++------ hack/tools/release/notes/main.go | 10 ++-------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 64cb5f08fba0..94baf982f86c 100644 --- a/Makefile +++ b/Makefile @@ -999,11 +999,6 @@ serve-book: ## Build and serve the book (with live-reload) ## latest git tag for the commit, e.g., v0.3.10 RELEASE_TAG ?= $(shell git describe --abbrev=0 2>/dev/null) -ifneq (,$(findstring -,$(RELEASE_TAG))) - PRE_RELEASE=true -endif -# the previous release tag, e.g., v0.3.9, excluding pre-release tags -PREVIOUS_TAG ?= $(shell git tag -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$$" | sort -V | grep -B1 $(RELEASE_TAG) | head -n 1 2>/dev/null) ## set by Prow, ref name of the base branch, e.g., main RELEASE_ALIAS_TAG := $(PULL_BASE_REF) RELEASE_DIR := out @@ -1180,7 +1175,7 @@ release-notes-tool: .PHONY: release-notes release-notes: release-notes-tool - ./bin/notes --release $(RELEASE_TAG) > CHANGELOG/$(RELEASE_TAG).md + ./bin/notes --release $(RELEASE_TAG) --previous-release-version "$(PREVIOUS_RELEASE_TAG)" > CHANGELOG/$(RELEASE_TAG).md .PHONY: test-release-notes-tool test-release-notes-tool: diff --git a/docs/release/release-tasks.md b/docs/release/release-tasks.md index e7558cb17972..280506d674ed 100644 --- a/docs/release/release-tasks.md +++ b/docs/release/release-tasks.md @@ -361,15 +361,22 @@ The goal of this task is to keep the CAPI community updated on recent PRs that h #### Create PR for release notes 1. Checkout the `main` branch. -1. Generate release notes with: +2. Generate release notes with: + 1. RELEASE CANDIDATE/BETA RELEASE example: ```bash # RELEASE_TAG should be the new desired tag (note: at this point the tag does not yet exist). - # Can be also used for pre-releases. The warning banner for RC and beta releases will be determined automatically. - RELEASE_TAG=v1.6.x make release-notes + # PREVIOUS_RELEASE_TAG is the previous released tag for determining the changes. + RELEASE_TAG=v1.7.x-rc.1 PREVIOUS_RELEASE_TAG=tags/v1.7.x-rc.0 make release-notes + ``` + **Note**: For a first pre-release version without a pre-release precedent, use above command without `PREVIOUS_RELEASE_TAG`. + 2. STABLE RELEASE example + ```bash + # RELEASE_TAG should be the new desired tag (note: at this point the tag does not yet exist). + RELEASE_TAG=v1.7.x make release-notes ``` -1. This will generate a new release notes file at `CHANGELOG/.md`. Finalize the release notes: +3. This will generate a new release notes file at `CHANGELOG/.md`. Finalize the release notes: - [ ] Look for any `MISSING_AREA` entries. Add the corresponding label to the PR and regenerate the notes. - [ ] Look for any `MULTIPLE_AREAS` entries. If the PR does indeed guarantee multiple areas, just remove the `MULTIPLE_AREAS` prefix and just leave the areas. Otherwise, fix the labels in the PR and regenerate the notes. - [ ] Review that all areas are correctly assigned to each PR. If not, correct the labels and regenerate the notes. @@ -382,8 +389,8 @@ The goal of this task is to keep the CAPI community updated on recent PRs that h - [ ] Sort manually all entries if you made any manual edits that might have altered the correct order. - [ ] **For minor releases:** Modify `Changes since v1.x.y` to `Changes since v1.x`
**Note**: The release notes tool includes all merges since the previous release branch was branched of. -1. Checkout `main`, branch out from it and add `CHANGELOG/.md`. -1. Open a pull request **against the main branch** with all manual edits to `CHANGELOG/.md` which is used for the new release notes. The commit and PR title should be `🚀 Release v1.x.y`. +4. Checkout `main`, branch out from it and add `CHANGELOG/.md`. +5. Open a pull request **against the main branch** with all manual edits to `CHANGELOG/.md` which is used for the new release notes. The commit and PR title should be `🚀 Release v1.x.y`.
**Note**: Important! The commit should only contain the release notes file, nothing else, otherwise automation will not work. diff --git a/hack/tools/release/notes/main.go b/hack/tools/release/notes/main.go index dfa56de0e177..5815791bd68a 100644 --- a/hack/tools/release/notes/main.go +++ b/hack/tools/release/notes/main.go @@ -95,7 +95,7 @@ func newNotesCmd() *notesCmd { func (cmd *notesCmd) run() error { releaseType := releaseTypeFromNewTag(cmd.config.newTag) - if err := validateConfig(cmd.config, releaseType); err != nil { + if err := validateConfig(cmd.config); err != nil { return err } @@ -166,7 +166,7 @@ func commandExists(cmd string) bool { return err == nil } -func validateConfig(config *notesCmdConfig, releaseType string) error { +func validateConfig(config *notesCmdConfig) error { if config.fromRef == "" && config.newTag == "" { return errors.New("at least one of --from or --release need to be set") } @@ -187,12 +187,6 @@ func validateConfig(config *notesCmdConfig, releaseType string) error { } } - if releaseType != "" { - if config.previousReleaseVersion == "" { - return errors.New("--previous-release-version need to be set with RELEASE CANDIDATE/BETA RELEASE tag") - } - } - return nil }