Skip to content

Commit cefe990

Browse files
šŸ› Set previous release tag version for RELEASE CANDIDATE/BETA RELEASE (#10435)
* Set previous release tag version for RELEASE CANDIDATE/BETA RELEASE Signed-off-by: chandankumar4 <[email protected]> * Remove unused variable and update release-notes cmd Signed-off-by: chandankumar4 <[email protected]> * Update release process document Signed-off-by: chandankumar4 <[email protected]> * Add notes for first pre-release version Signed-off-by: chandankumar4 <[email protected]> * Replace PREVIOUS_VERSION_TAG with PREVIOUS_RELEASE_TAG Signed-off-by: chandankumar4 <[email protected]> --------- Signed-off-by: chandankumar4 <[email protected]>
1 parent b5568cf commit cefe990

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

ā€ŽMakefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -999,11 +999,6 @@ serve-book: ## Build and serve the book (with live-reload)
999999

10001000
## latest git tag for the commit, e.g., v0.3.10
10011001
RELEASE_TAG ?= $(shell git describe --abbrev=0 2>/dev/null)
1002-
ifneq (,$(findstring -,$(RELEASE_TAG)))
1003-
PRE_RELEASE=true
1004-
endif
1005-
# the previous release tag, e.g., v0.3.9, excluding pre-release tags
1006-
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)
10071002
## set by Prow, ref name of the base branch, e.g., main
10081003
RELEASE_ALIAS_TAG := $(PULL_BASE_REF)
10091004
RELEASE_DIR := out
@@ -1180,7 +1175,7 @@ release-notes-tool:
11801175

11811176
.PHONY: release-notes
11821177
release-notes: release-notes-tool
1183-
./bin/notes --release $(RELEASE_TAG) > CHANGELOG/$(RELEASE_TAG).md
1178+
./bin/notes --release $(RELEASE_TAG) --previous-release-version "$(PREVIOUS_RELEASE_TAG)" > CHANGELOG/$(RELEASE_TAG).md
11841179

11851180
.PHONY: test-release-notes-tool
11861181
test-release-notes-tool:

ā€Ždocs/release/release-tasks.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,15 +361,22 @@ The goal of this task is to keep the CAPI community updated on recent PRs that h
361361
362362
#### Create PR for release notes
363363
1. Checkout the `main` branch.
364-
1. Generate release notes with:
364+
2. Generate release notes with:
365365
366+
1. RELEASE CANDIDATE/BETA RELEASE example:
366367
```bash
367368
# RELEASE_TAG should be the new desired tag (note: at this point the tag does not yet exist).
368-
# Can be also used for pre-releases. The warning banner for RC and beta releases will be determined automatically.
369-
RELEASE_TAG=v1.6.x make release-notes
369+
# PREVIOUS_RELEASE_TAG is the previous released tag for determining the changes.
370+
RELEASE_TAG=v1.7.x-rc.1 PREVIOUS_RELEASE_TAG=tags/v1.7.x-rc.0 make release-notes
371+
```
372+
**Note**: For a first pre-release version without a pre-release precedent, use above command without `PREVIOUS_RELEASE_TAG`.
373+
2. STABLE RELEASE example
374+
```bash
375+
# RELEASE_TAG should be the new desired tag (note: at this point the tag does not yet exist).
376+
RELEASE_TAG=v1.7.x make release-notes
370377
```
371378
372-
1. This will generate a new release notes file at `CHANGELOG/<RELEASE_TAG>.md`. Finalize the release notes:
379+
3. This will generate a new release notes file at `CHANGELOG/<RELEASE_TAG>.md`. Finalize the release notes:
373380
- [ ] Look for any `MISSING_AREA` entries. Add the corresponding label to the PR and regenerate the notes.
374381
- [ ] 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.
375382
- [ ] 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
382389
- [ ] Sort manually all entries if you made any manual edits that might have altered the correct order.
383390
- [ ] **For minor releases:** Modify `Changes since v1.x.y` to `Changes since v1.x`
384391
<br>**Note**: The release notes tool includes all merges since the previous release branch was branched of.
385-
1. Checkout `main`, branch out from it and add `CHANGELOG/<RELEASE_TAG>.md`.
386-
1. Open a pull request **against the main branch** with all manual edits to `CHANGELOG/<RELEASE_TAG>.md` which is used for the new release notes. The commit and PR title should be `šŸš€ Release v1.x.y`.
392+
4. Checkout `main`, branch out from it and add `CHANGELOG/<RELEASE_TAG>.md`.
393+
5. Open a pull request **against the main branch** with all manual edits to `CHANGELOG/<RELEASE_TAG>.md` which is used for the new release notes. The commit and PR title should be `šŸš€ Release v1.x.y`.
387394
<br>**Note**: Important! The commit should only contain the release notes file, nothing else, otherwise automation will not work.
388395
389396

ā€Žhack/tools/release/notes/main.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func newNotesCmd() *notesCmd {
9595

9696
func (cmd *notesCmd) run() error {
9797
releaseType := releaseTypeFromNewTag(cmd.config.newTag)
98-
if err := validateConfig(cmd.config, releaseType); err != nil {
98+
if err := validateConfig(cmd.config); err != nil {
9999
return err
100100
}
101101

@@ -166,7 +166,7 @@ func commandExists(cmd string) bool {
166166
return err == nil
167167
}
168168

169-
func validateConfig(config *notesCmdConfig, releaseType string) error {
169+
func validateConfig(config *notesCmdConfig) error {
170170
if config.fromRef == "" && config.newTag == "" {
171171
return errors.New("at least one of --from or --release need to be set")
172172
}
@@ -187,12 +187,6 @@ func validateConfig(config *notesCmdConfig, releaseType string) error {
187187
}
188188
}
189189

190-
if releaseType != "" {
191-
if config.previousReleaseVersion == "" {
192-
return errors.New("--previous-release-version need to be set with RELEASE CANDIDATE/BETA RELEASE tag")
193-
}
194-
}
195-
196190
return nil
197191
}
198192

0 commit comments

Comments
Ā (0)