[release-15.0] Re-organize the `releasenotes` directory into `changelog` (#12566) (#12659)

* Re-organize the `releasenotes` directory into `changelog` (#12566)

* Move all release related documents to ./release and add tool to generate READMEs

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Addition of the release.go file

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* simplify release.go

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* generate the release notes in the proper place

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* modify previous mentions of docs/releasenotes

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* re-add v17.0.0 summary

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* add new release tool to release instruction and ci

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* apply review suggestions

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* simplify release notes document path

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Apply review suggestions and fix team files

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

---------

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* update the changelog dir and release_notes_label workflow

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

---------

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
This commit is contained in:
Florent Poinsard 2023-03-21 12:20:14 +02:00 коммит произвёл GitHub
Родитель f568a5ccb1
Коммит f0cfda7983
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
87 изменённых файлов: 461 добавлений и 64 удалений

2
.github/workflows/release_notes_label.yml поставляемый
Просмотреть файл

@ -17,7 +17,7 @@ jobs:
- name: Release Notes label
run: |
if [[ "${{contains( github.event.pull_request.labels.*.name, 'release notes (needs details)')}}" == "true" ]]; then
echo The "release notes (needs details)" label is set. The changes made in this Pull Request need to be documented in the release notes summary "('./doc/releasenotes/16_0_0_summary.md')". Once documented, the "release notes (needs details)" label can be removed.
echo The "release notes (needs details)" label is set. The changes made in this Pull Request need to be documented in the release notes summary "('./changelog/15.0/15.0.3/summary.md')". Once documented, the "release notes (needs details)" label can be removed.
exit 1
fi

17
.github/workflows/static_checks_etc.yml поставляемый
Просмотреть файл

@ -90,6 +90,9 @@ jobs:
ci_config:
- 'test/config.json'
- '.github/workflows/static_checks_etc.yml'
release_notes:
- 'changelog/**'
- './go/tools/releases/**'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && (steps.changes.outputs.go_files == 'true' || steps.changes.outputs.parser_changes == 'true' || steps.changes.outputs.proto_changes == 'true')
@ -199,3 +202,17 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && (steps.changes.outputs.go_files == 'true' || steps.changes.outputs.ci_config == 'true')
run: |
go run ./go/tools/ci-config/main.go || exit 1
- name: Check changelog
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.release_notes == 'true'
run: |
set -e
go run ./go/tools/releases/releases.go
output=$(git status -s)
if [ -z "${output}" ]; then
exit 0
fi
echo 'We wish to maintain a consistent changelog directory, please run `go run ./go/tools/releases/releases.go`, commit and push again.'
echo 'Running `go run ./go/tools/releases/releases.go` on CI yields the following changes:'
echo "$output"
echo ""

2
.gitignore поставляемый
Просмотреть файл

@ -70,7 +70,7 @@ _test/
/vendor/*/
# release folder
releases
/releases/
# Angular2 Bower Libs
/web/vtctld2/.bowerrc~

Просмотреть файл

Просмотреть файл

Просмотреть файл

18
changelog/10.0/README.md Normal file
Просмотреть файл

@ -0,0 +1,18 @@
## v10.0
* **[10.0.5](10.0.5)**
* [Release Notes](10.0.5/release_notes.md)
* **[10.0.4](10.0.4)**
* [Release Notes](10.0.4/release_notes.md)
* **[10.0.3](10.0.3)**
* [Release Notes](10.0.3/release_notes.md)
* **[10.0.2](10.0.2)**
* [Release Notes](10.0.2/release_notes.md)
* **[10.0.1](10.0.1)**
* [Release Notes](10.0.1/release_notes.md)
* **[10.0.0](10.0.0)**
* [Release Notes](10.0.0/release_notes.md)

Просмотреть файл

Просмотреть файл

Просмотреть файл

15
changelog/11.0/README.md Normal file
Просмотреть файл

@ -0,0 +1,15 @@
## v11.0
* **[11.0.4](11.0.4)**
* [Release Notes](11.0.4/release_notes.md)
* **[11.0.3](11.0.3)**
* [Release Notes](11.0.3/release_notes.md)
* **[11.0.2](11.0.2)**
* [Release Notes](11.0.2/release_notes.md)
* **[11.0.1](11.0.1)**
* [Release Notes](11.0.1/release_notes.md)
* **[11.0.0](11.0.0)**
* [Release Notes](11.0.0/release_notes.md)

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -9,7 +9,7 @@ Below is a summary of this patch release. You can learn more [here](https://go.d
> go1.17.12 (released 2022-07-12) includes security fixes to the compress/gzip, encoding/gob, encoding/xml, go/parser, io/fs, net/http, and path/filepath packages, as well as bug fixes to the compiler, the go command, the runtime, and the runtime/metrics package. [See the Go 1.17.12 milestone](https://github.com/golang/go/issues?q=milestone%3AGo1.17.12+label%3ACherryPickApproved) on our issue tracker for details.
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/12_0_5_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/12.0/12.0.5/changelog.md).
The release includes 7 commits (excluding merges)

Просмотреть файл

@ -15,7 +15,7 @@ This change is documented on our website [here](https://vitess.io/docs/12.0/over
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/12_0_6_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/12.0/12.0.6/changelog.md).
The release includes 11 commits (excluding merges)

Просмотреть файл

23
changelog/12.0/README.md Normal file
Просмотреть файл

@ -0,0 +1,23 @@
## v12.0
* **[12.0.6](12.0.6)**
* [Changelog](12.0.6/changelog.md)
* [Release Notes](12.0.6/release_notes.md)
* **[12.0.5](12.0.5)**
* [Changelog](12.0.5/changelog.md)
* [Release Notes](12.0.5/release_notes.md)
* **[12.0.4](12.0.4)**
* [Release Notes](12.0.4/release_notes.md)
* **[12.0.3](12.0.3)**
* [Release Notes](12.0.3/release_notes.md)
* **[12.0.2](12.0.2)**
* [Release Notes](12.0.2/release_notes.md)
* **[12.0.1](12.0.1)**
* [Release Notes](12.0.1/release_notes.md)
* **[12.0.0](12.0.0)**
* [Release Notes](12.0.0/release_notes.md)

Просмотреть файл

Просмотреть файл

@ -9,7 +9,7 @@ Below is a summary of this patch release. You can learn more [here](https://go.d
> go1.17.12 (released 2022-07-12) includes security fixes to the compress/gzip, encoding/gob, encoding/xml, go/parser, io/fs, net/http, and path/filepath packages, as well as bug fixes to the compiler, the go command, the runtime, and the runtime/metrics package. [See the Go 1.17.12 milestone](https://github.com/golang/go/issues?q=milestone%3AGo1.17.12+label%3ACherryPickApproved) on our issue tracker for details.
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/13_0_2_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/13.0/13.0.2/changelog.md).
The release includes 28 commits (excluding merges)
Thanks to all our contributors: @GuptaManan100, @aquarapid, @frouioui, @harshit-gangal, @mattlord, @rohit-nayak-ps, @systay, @vitess-bot[bot], @vmg

Просмотреть файл

Просмотреть файл

@ -15,7 +15,7 @@ This change is documented on our website [here](https://vitess.io/docs/13.0/over
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/13_0_3_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/13.0/13.0.3/changelog.md).
The release includes 17 commits(excluding merges)

Просмотреть файл

14
changelog/13.0/README.md Normal file
Просмотреть файл

@ -0,0 +1,14 @@
## v13.0
* **[13.0.3](13.0.3)**
* [Changelog](13.0.3/changelog.md)
* [Release Notes](13.0.3/release_notes.md)
* **[13.0.2](13.0.2)**
* [Changelog](13.0.2/changelog.md)
* [Release Notes](13.0.2/release_notes.md)
* **[13.0.1](13.0.1)**
* [Release Notes](13.0.1/release_notes.md)
* **[13.0.0](13.0.0)**
* [Release Notes](13.0.0/release_notes.md)

Просмотреть файл

@ -319,7 +319,7 @@ Work has gone into making the advisory locks (`get_lock()`, `release_lock()`, et
A long time ago, the sharding column and type were specified at the keyspace level. This syntax is now deprecated and will be removed in v15.
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/14_0_0_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/14.0/14.0.0/changelog.md).
The release includes 1101 commits (excluding merges)

Просмотреть файл

Просмотреть файл

@ -13,7 +13,7 @@ Below is a summary of this patch release. You can learn more [here](https://go.d
> go1.18.4 (released 2022-07-12) includes security fixes to the compress/gzip, encoding/gob, encoding/xml, go/parser, io/fs, net/http, and path/filepath packages, as well as bug fixes to the compiler, the go command, the linker, the runtime, and the runtime/metrics package. [See the Go 1.18.4 milestone](https://github.com/golang/go/issues?q=milestone%3AGo1.18.4+label%3ACherryPickApproved) on our issue tracker for details.
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/14_0_1_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/14.0/14.0.1/changelog.md).
The release includes 25 commits (excluding merges)

Просмотреть файл

Просмотреть файл

@ -18,7 +18,7 @@ Since the end-of-life of MariaDB 10.2, its Docker image is unavailable, and we d
You can find more information on the list of supported databases on our documentation website, [here](https://vitess.io/docs/14.0/overview/supported-databases/).
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/14_0_2_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/14.0/14.0.2/changelog.md).
The release includes 23 commits (excluding merges)

Просмотреть файл

Просмотреть файл

@ -12,7 +12,7 @@ This problem could be resolved by restarting the VTOrc so that it discovers all
frequently, this posed a greater challenge, since some pods when evicted and rescheduled on a different node, would sometimes fail to be discovered by VTOrc.
This has problem has been addressed in this patch by the fix https://github.com/vitessio/vitess/pull/10662.
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/14_0_3_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/14.0/14.0.3/changelog.md).
The release includes 12 commits (excluding merges)

Просмотреть файл

16
changelog/14.0/README.md Normal file
Просмотреть файл

@ -0,0 +1,16 @@
## v14.0
* **[14.0.3](14.0.3)**
* [Changelog](14.0.3/changelog.md)
* [Release Notes](14.0.3/release_notes.md)
* **[14.0.2](14.0.2)**
* [Changelog](14.0.2/changelog.md)
* [Release Notes](14.0.2/release_notes.md)
* **[14.0.1](14.0.1)**
* [Changelog](14.0.1/changelog.md)
* [Release Notes](14.0.1/release_notes.md)
* **[14.0.0](14.0.0)**
* [Changelog](14.0.0/changelog.md)
* [Release Notes](14.0.0/release_notes.md)

Просмотреть файл

@ -455,7 +455,7 @@ Below are the changes for each binary.
- [zkctld](https://github.com/vitessio/vitess/blob/release-15.0/doc/flags/14.0-to-15.0-transition/zkctld.diff)
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/15_0_0_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/15.0/15.0.0/changelog.md).
The release includes 595 commits (excluding merges)

Просмотреть файл

Просмотреть файл

@ -16,7 +16,7 @@ This issue is fixed in 15.0.1. The full issue can be found [here](https://github
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/15_0_1_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/15.0/15.0.1/changelog.md).
The release includes 25 commits (excluding merges)

Просмотреть файл

Просмотреть файл

@ -12,7 +12,7 @@ Below is a summary of this patch release. You can learn more [here](https://grou
------------
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/15_0_2_changelog.md).
The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/15.0/15.0.2/changelog.md).
The release includes 14 commits (excluding merges)

Просмотреть файл

13
changelog/15.0/README.md Normal file
Просмотреть файл

@ -0,0 +1,13 @@
## v15.0
The dedicated team for this release can be found [here](team.md).
* **[15.0.2](15.0.2)**
* [Changelog](15.0.2/changelog.md)
* [Release Notes](15.0.2/release_notes.md)
* **[15.0.1](15.0.1)**
* [Changelog](15.0.1/changelog.md)
* [Release Notes](15.0.1/release_notes.md)
* **[15.0.0](15.0.0)**
* [Changelog](15.0.0/changelog.md)
* [Release Notes](15.0.0/release_notes.md)

5
changelog/15.0/team.md Normal file
Просмотреть файл

@ -0,0 +1,5 @@
## Release Team for v15
- **Lead:** Rameez Sajwani ([rsajwani](https://github.com/rsajwani)) rameez@planetscale.com
- **Shadow:** Manan Gupta ([GuptaManan100](https://github.com/GuptaManan100)) manan@planetscale.com
- **Mentor:** Florent Poinsard ([frouioui](https://github.com/frouioui)) florent@planetscale.com

12
changelog/7.0/README.md Normal file
Просмотреть файл

@ -0,0 +1,12 @@
## v7.0
* **[7.0.3](7.0.3)**
* [Release Notes](7.0.3/release_notes.md)
* **[7.0.2](7.0.2)**
* [Release Notes](7.0.2/release_notes.md)
* **[7.0.1](7.0.1)**
* [Release Notes](7.0.1/release_notes.md)
* **[7.0.0](7.0.0)**
* [Release Notes](7.0.0/release_notes.md)

3
changelog/8.0/README.md Normal file
Просмотреть файл

@ -0,0 +1,3 @@
## v8.0
* **[8.0.0](8.0.0)**
* [Release Notes](8.0.0/release_notes.md)

9
changelog/9.0/README.md Normal file
Просмотреть файл

@ -0,0 +1,9 @@
## v9.0
* **[9.0.2](9.0.2)**
* [Release Notes](9.0.2/release_notes.md)
* **[9.0.1](9.0.1)**
* [Release Notes](9.0.1/release_notes.md)
* **[9.0.0](9.0.0)**
* [Release Notes](9.0.0/release_notes.md)

10
changelog/README.md Normal file
Просмотреть файл

@ -0,0 +1,10 @@
## Releases
* [15.0](15.0)
* [14.0](14.0)
* [13.0](13.0)
* [12.0](12.0)
* [11.0](11.0)
* [10.0](10.0)
* [9.0](9.0)
* [8.0](8.0)
* [7.0](7.0)

Просмотреть файл

@ -55,7 +55,7 @@ Pre-release versions should be labeled with a suffix like `-beta2` or `-rc1`.
## Release Branches
Each major and minor releases (X.Y) should have a [release branch](https://github.com/vitessio/vitess/branches/all?query=release) named
`release-X.Y`. This branch should diverge from `main` when the code freeze when the release
`release-X.Y`. This branch should diverge from `main` when the release
is declared, after which point only bugfix PRs should be cherry-picked onto the branch.
All other activity on `main` will go out with a subsequent major or minor release.
@ -109,6 +109,7 @@ Therefore, file a JIRA ticket with Sonatype to get added ([example for a differe
Follow [Sonatype's GPG instructions](https://central.sonatype.org/pages/working-with-pgp-signatures.html).
Install `gpg-agent` (needed below) e.g. on Ubuntu via: `sudo apt-get install gnupg-agent`.
for Mac you need to install 'gnupg' via 'brew install gnupg'
#### Login configuration
@ -118,7 +119,7 @@ Create the `settings.xml` in the `$HOME/.m2/` directory as described in their [i
## Release Cutover
In this section we describe our current release process. We begin with a list of [**pre-requisites for the release team**](#pre-requisites) and with a short [**overview**](#overview).
In this section we describe our current release process. We begin with a list of [**pre-requisite for the release team**](#pre-requisites) and with a short [**overview**](#overview).
The release process is divided into three parts: [**Pre-Release**](#pre-release), [**Release**](#release), [**Post-Release**](#post-release), which are detailed after the overview.
### Pre-Requisites
@ -139,7 +140,8 @@ We usually create the RC1 during the first week of the month, and the GA version
#### Code Freeze
Before creating RC1, there is a code freeze. Assuming the release of RC1 happens on a Tuesday, the release branch will be frozen Friday of the previous week.
This allows us to test that the release branch can be released and avoid discovering unwanted events during the release day. Once the RC1 is released, there are three more weeks to backport bug fixes into the release branches. However, we also proceed to a code freeze the Friday before the GA release. (Assuming GA is on a Tuesday)
This allows us to test that the release branch can be released and avoid discovering unwanted events during the release day. Once the RC1 is released, there are three more weeks to backport bug fixes into the release branches.
However, we also proceed to a code freeze the Friday before the GA release. (Assuming GA is on a Tuesday)
Regarding patch releases, no code freeze is planned.
#### Tracking Issue for each Release
@ -159,8 +161,9 @@ That includes:
> - This includes write access to the Vitess repository and to the Maven repository.
- **Preparing and cleaning the release notes summary.**
> - One or more Pull Requests have to be submitted in advance to create and update the release summary.
> - The summary files are located in: `./doc/releasenotes/*_*_*_summary.md`.
> - The summary files are located in: `./changelog/*.0/*.*.*/summary.md`.
> - The summary file for a release candidate is the same as the one for the GA release.
> - Make sure to run `go run ./go/tools/releases/releases.go` to update the `changelog` directory with the latest release notes.
- **Finishing the blog post, and coordinating with the different organizations for cross-posting. Usually CNCF and PlanetScale. This step applies only for GA releases.**
> - The blog post must be finished and reviewed.
> - A Pull Request on the website repository of Vitess has to be created so we can easily publish the blog during the release day.
@ -168,17 +171,29 @@ That includes:
> - As soon as we go into code freeze, if we are doing an RC, create the release branch.
> - If we are doing a GA release, do not merge any new Pull Requests.
> - The guide on how to do a code freeze is available in the [How To Code Freeze](#how-to-code-freeze) section.
> - It is not advised to merge a PR during code freeze, but if it is deemed necessary by the release lead, then follow the steps in [How To Merge During Code Freeze](#how-to-merge-during-code-freeze) section.
- **Create the Vitess release.**
> - A guide on how to create a Vitess release is available in the [How to prepare the release of Vitess](#how-to-prepare-the-release-of-vitess) section.
> - This step will create a Release Pull Request, it must be reviewed and merged before the release day. The release commit will be used to tag the release.
- **Preparing the Vitess Operator release.**
> - While the Vitess Operator is located in a different repository, we also need to do a release for it.
> - The Operator follows the same cycle: RC1 -> GA -> Patches.
> - Documentation for the pre-release of the Vitess Operator is available [here](https://github.com/planetscale/vitess-operator/blob/main/docs/release-process.md#prepare-for-release).
- **Update the release notes on `main`.**
> - One Pull Request against `main` must be created, it will contain the new release notes that we are adding in the Release Pull Request.
> - We open this Pull Request now to avoid waiting on the CI during release day.
> - All future changes to the release notes during the code freeze will need to be ported to both PRs: the one on `main` and the Release Pull Request.
### Release
On the release day, there are several things to do:
- **Create the Vitess release.**
> - A guide on how to create a Vitess release is available in the [How To Release Vitess](#how-to-release-vitess) section.
- **Merge the Release Pull Request.**
> - During the code freeze, we created a Release Pull Request. It must be merged.
- **Tag the Vitess release.**
> - A guide on how to tag a version is available in the [How To Release Vitess](#how-to-release-vitess) section.
- **Update the release notes on `main`.**
> - During the code freeze, we created a Pull Request against `main` to update the release notes. It must be merged.
- **Create the corresponding Vitess operator release.**
> - Applies only to versions greater or equal to `v14.0.0`.
> - If we are doing an RC release, then we will need to create the Vitess Operator RC too. If we are doing a GA release, we're also doing a GA release in the Operator.
@ -200,10 +215,8 @@ On the release day, there are several things to do:
> - After a while, those elements will finish their execution and their status will be green.
> - This step is even more important for GA releases as we often include a link to _arewefastyet_ in the blog post.
> - The benchmarks need to complete before announcing the blog posts or before they get cross-posted.
- **Update the release notes on the release branch and on `main`.**
> - Two new Pull Requests have to be created.
> - One against `main`, it will contain only the new release notes.
> - And another against the release branch, this one contains the release notes and the release commit. (The commit on which we did `git tag`)
- **Go back to dev mode on the release branch.**
> - The version constants across the codebase must be updated to `SNAPSHOT`.
- **Build k8s Docker images and publish them**
> - The docker image for `base`, `lite`, etc are built automatically by DockerHub. The k8s images however are dependent on these images and are required to be built manually.
> - These images should be built after the `base` image has been built and available on DockerHub.
@ -214,6 +227,56 @@ On the release day, there are several things to do:
Once the release is over, we need to announce it on both Slack and Twitter. We also want to make sure the blog post was cross-posted, if applicable.
We need to verify that _arewefastyet_ has finished the benchmark too.
### How to prepare the release of Vitess
> In this example our current version is `v14.0.3` and we release the version `v15.0.0`.
> Alongside Vitess' release, we also release a new version of the operator.
> Since we are releasing a release candidate here, the new version of the operator will also be a release candidate.
> In this example, the new operator version is `2.8.0`.
>
> It is important to note that before the RC, there is a code freeze during which we create the release branch.
>
> The release branch in this example is `release-15.0`.
>
> The example also assumes that `origin` is the `vitessio/vitess` remote.
1. Fetch `github.com/vitessio/vitess`'s remote.
```shell
git fetch origin
```
2. Creation of the Release Pull Request.
> This step will create the Release Pull Request that will then be reviewed ahead of the release day.
> The merge commit of that Pull Request will be used during the release day to tag the release.
1. Run the `create_release` script using the Makefile:
1. Release Candidate:
```shell
make BASE_BRANCH="release-15.0" BASE_REMOTE="origin" RELEASE_VERSION="15.0.0-rc1" VTOP_VERSION="2.8.0-rc1" create_release
```
2. General Availability:
```shell
make BASE_BRANCH="release-15.0" BASE_REMOTE="origin" RELEASE_VERSION="15.0.0" VTOP_VERSION="2.8.0" create_release
```
The script will prompt you `Pausing so release notes can be added. Press enter to continue`. We are now going to generate the release notes, continue to the next sub-step.
2. Run the following command to generate the release notes:
1. Release Candidate:
```shell
make VERSION="v15.0.0-rc1" FROM="v14.0.3" TO="HEAD" SUMMARY="./changelog/15.0/15.0.0/summary.md" release-notes
```
2. General Availability:
```shell
make VERSION="v15.0.0-rc1" FROM="v14.0.3" TO="HEAD" SUMMARY="./changelog/15.0/15.0.0/summary.md" release-notes
```
This command will generate the release notes by looking at all the commits between the tag `v14.0.3` and the reference `HEAD`.
It will also use the file located in `./changelog/15.0/15.0.0/summary.md` to prefix the release notes with a text that the maintainers wrote before the release.
Please verify the generated release notes to make sure it is well-formatted and all the bookmarks are generated properly.
3. Follow the instruction prompted by the `create_release` Makefile command's output in order to push the newly created branch and create the Release Pull Request on GitHub.
4. If we are doing an RC release it means we created a new branch from `main`. We need to update `main` with the next SNAPSHOT version. If `main` was on `15.0.0-SNAPSHOT`, we need to update it to `16.0.0-SNAPSHOT`. A simple find and replace in the IDE is sufficient, there only a handful of files that must be changed: `version.go` and several java files.
### How To Release Vitess
This section is divided into two parts:
@ -222,7 +285,10 @@ This section is divided into two parts:
#### Creation of the tags and release notes
> In this example our current version is `v14` and we release the version `v15.0.0`.
> This step implies that you have created a [Release Pull Request](#how-to-prepare-the-release-of-vitess) beforehand and that it has been reviewed.
> The merge commit of this Release Pull Request will be used to tag the release.
>
> In this example our current version is `v14.0.3` and we release the version `v15.0.0`.
> Alongside Vitess' release, we also release a new version of the operator.
> Since we are releasing a release candidate here, the new version of the operator will also be a release candidate.
> In this example, the new operator version is `2.8.0`.
@ -238,37 +304,22 @@ This section is divided into two parts:
git fetch origin
```
2. Creation of the release notes and tags.
1. Run the release script using the Makefile:
1. Release Candidate:
```shell
make BASE_BRANCH="release-15.0" BASE_REMOTE="origin" RELEASE_VERSION="15.0.0-rc1" DEV_VERSION="15.0.0-SNAPSHOT" VTOP_VERSION="2.8.0-rc1" do_release
```
2. General Availability:
```shell
make BASE_BRANCH="release-15.0" BASE_REMOTE="origin" RELEASE_VERSION="15.0.0" DEV_VERSION="15.0.1-SNAPSHOT" VTOP_VERSION="2.8.0" do_release
```
2. Checkout to the merge commit of the Release Pull Request.
The script will prompt you `Pausing so release notes can be added. Press enter to continue`. We are now going to generate the release notes, continue to the next sub-step.
3. Tag the release and push the tags
```shell
git tag v15.0.0 && git tag v0.15.0 && git push origin v15.0.0 && git push origin v0.15.0
```
2. Run the following command to generate the release notes:
1. Release Candidate:
```shell
make VERSION="v15.0.0-rc1" FROM="v14.0.0" TO="HEAD" SUMMARY="./doc/releasenotes/15_0_0_summary.md" release-notes
```
2. General Availability:
```shell
make VERSION="v15.0.0-rc1" FROM="v14.0.0" TO="HEAD" SUMMARY="./doc/releasenotes/15_0_0_summary.md" release-notes
```
This command will generate the release notes by looking at all the commits between the tag `v14.0.0` and the reference `HEAD`.
It will also use the file located in `./doc/releasenotes/15_0_0_summary.md` to prefix the release notes with a text that the maintainers wrote before the release.
4. Create a Pull Request against the `main` branch with the release notes found in `./changelog/15.0/15.0.0/15_0_0_*.md`.
3. Follow the instruction prompted by the `do_release` Makefile command's output in order to push the tags, branches and create the Pull Requests.
4. Create a Pull Request against the `main` branch with the newly created release notes.
5. Release the tag on GitHub UI as explained in the following section.
5. Run the back to dev mode tool.
```shell
make BASE_BRANCH="release-15.0" BASE_REMOTE="origin" RELEASE_VERSION="15.0.0-rc1" DEV_VERSION="15.0.0-SNAPSHOT" back_to_dev_mode
```
> You will then need to follow the instructions given by the output of the back_to_dev_mode Makefile command. You will need to push the newly created branch and open a Pull Request.
6. Release the tag on GitHub UI as explained in the following section.
#### Creating Release or Release Candidate on the GitHub UI
@ -313,6 +364,9 @@ git fetch --all
git checkout -b release-15.0 origin/main
```
> Important: after creating the new branch `release-15.0`, we need to create new branch protection rules on the GitHub UI.
> The rules can be copied from the rules that are on the `main` branch.
The new branch will be based on `origin/main`, here `origin` points to `vitessio/vitess`. If we are not doing a release candidate, then the branch already exists and we can checkout on it.
Now, if we are doing a GA release, let's update the branch:
@ -329,6 +383,26 @@ Finally, let's run the code freeze script:
The script will prompt the command that will allow you to push the code freeze change. Once pushed, open a PR that will be merged on `release-15.0`.
Remember, you should also disable the Launchable integration from the newly created release branch.
### How To Merge During Code Freeze
> **Warning:** It is not advised to merge a PR during code-freeze. If it is deemed absolutely necessary, then the following steps can be followed.
The PR that needs to be merged will be failing on the `Code Freeze` CI. To merge this PR, we'll have to mark this CI action as not required.
You will need administrator privileges on the vitess repository to be able to make this change.
1. Go to the GitHub repository and click on `Settings`.
2. Under the `Code and automation` section, select `Branches`.
3. Find the branch that you want to merge the PR against and then select `Edit`.
4. Scroll down to find the list of required checks.
5. Within this list find `Code Freeze` and click on the cross next to it to remove it from this list.
6. Save your changes on the bottom of the page.
7. Refresh the page of the PR, and you should be able to merge it.
8. After merging the PR, you need to do 2 more things -
1. Add `Code Freeze` back as a required check.
2. Check if the release PR has any merge conflicts. If it does, fix them and push.
### Java Packages: Deploy & Release
> **Warning:** This section's steps need to be executed only when releasing a new major version of Vitess,
@ -336,12 +410,12 @@ The script will prompt the command that will allow you to push the code freeze c
>
> For this example, we assume we juste released `v12.0.0`.
1. Checkout to the release commit.
1. Checkout to the release commit.
```shell
git checkout v12.0.0
```
2. Run `gpg-agent` to avoid that Maven will constantly prompt you for the password of your private key.
2. Run `gpg-agent` to avoid that Maven will constantly prompt you for the password of your private key. Note that this can print error messages that can be ignored on Mac.
```bash
eval $(gpg-agent --daemon --no-grab --write-env-file $HOME/.gpg-agent-info)
@ -349,11 +423,20 @@ The script will prompt the command that will allow you to push the code freeze c
export GPG_AGENT_INFO
```
3. Deploy (upload) the Java code to the oss.sonatype.org repository:
3. Export following to avoid any version conflicts
```bash
export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED
--add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
```
4. Deploy (upload) the Java code to the oss.sonatype.org repository:
> **Warning:** After the deployment, the Java packages will be automatically released. Once released, you cannot delete them. The only option is to upload a newer version (e.g. increment the patch level).</p>
```bash
cd ./java/
mvn clean deploy -P release -DskipTests
cd ..
```
5. It will take some time for artifacts to appear on [maven directory](https://mvnrepository.com/artifact/io.vitess/vitess-client)

Просмотреть файл

@ -76,14 +76,17 @@ type (
KnownIssues string
AddDetails string
PathToChangeLogFileOnGH, ChangeLog, ChangeMetrics string
SubDirPath string
}
)
const (
releaseNotesPath = `doc/releasenotes/`
releaseNotesPathGitHub = `https://github.com/vitessio/vitess/blob/main/` + releaseNotesPath
var (
releaseNotesPath = `changelog/`
)
markdownTemplate = `# Release of Vitess {{.Version}}
const (
releaseNotesPathGitHub = `https://github.com/vitessio/vitess/blob/main/`
markdownTemplate = `# Release of Vitess {{.Version}}
{{- if or .Announcement .AddDetails }}
{{ .Announcement }}
@ -138,9 +141,9 @@ The entire changelog for this release can be found [here]({{ .PathToChangeLogFil
func (rn *releaseNote) generate(rnFile, changelogFile *os.File) error {
var err error
// Generate the release notes
rn.PathToChangeLogFileOnGH = fmt.Sprintf(releaseNotesPathGitHub+"%s_changelog.md", rn.VersionUnderscore)
rn.PathToChangeLogFileOnGH = releaseNotesPathGitHub + path.Join(rn.SubDirPath, "changelog.md")
if rnFile == nil {
rnFile, err = os.OpenFile(fmt.Sprintf(path.Join(releaseNotesPath, "%s_release_notes.md"), rn.VersionUnderscore), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
rnFile, err = os.OpenFile(path.Join(rn.SubDirPath, "release_notes.md"), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
if err != nil {
return err
}
@ -154,7 +157,7 @@ func (rn *releaseNote) generate(rnFile, changelogFile *os.File) error {
// Generate the changelog
if changelogFile == nil {
changelogFile, err = os.OpenFile(fmt.Sprintf(path.Join(releaseNotesPath, "%s_changelog.md"), rn.VersionUnderscore), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
changelogFile, err = os.OpenFile(path.Join(rn.SubDirPath, "changelog.md"), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
if err != nil {
return err
}
@ -506,9 +509,20 @@ func main() {
log.Fatal("The --version flag must be set using a valid format. Format: 'vX.X.X'.")
}
// Define the path to the release notes folder
majorVersion := versionMatch[1] + "." + versionMatch[2]
patchVersion := versionMatch[0]
releaseNotesPath = path.Join(releaseNotesPath, majorVersion, patchVersion)
err := os.MkdirAll(releaseNotesPath, os.ModePerm)
if err != nil {
log.Fatal(err)
}
releaseNotes := releaseNote{
Version: versionName,
VersionUnderscore: fmt.Sprintf("%s_%s_%s", versionMatch[1], versionMatch[2], versionMatch[3]), // v14.0.0 -> 14_0_0, this is used to format filenames.
SubDirPath: releaseNotesPath,
}
// summary of the release

Просмотреть файл

@ -160,11 +160,12 @@ func TestGenerateReleaseNotes(t *testing.T) {
VersionUnderscore: "12_0_0",
ChangeLog: "* PR 1\n* PR 2\n",
ChangeMetrics: "optimization is the root of all evil",
SubDirPath: "changelog/12.0/12.0.0",
},
expectedOut: "# Release of Vitess v12.0.0\n" +
"This is the new release.\n\nNew features got added.\n" +
"------------\n" +
"The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/12_0_0_changelog.md).\n" +
"The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/12.0/12.0.0/changelog.md).\n" +
"optimization is the root of all evil\n",
expectedOutChangeLog: "# Changelog of Vitess v12.0.0\n" +
"* PR 1\n" +
@ -176,9 +177,10 @@ func TestGenerateReleaseNotes(t *testing.T) {
VersionUnderscore: "12_0_0",
ChangeLog: "* PR 1\n* PR 2\n",
ChangeMetrics: "optimization is the root of all evil",
SubDirPath: "changelog/12.0/12.0.0",
},
expectedOut: "# Release of Vitess v12.0.0\n" +
"The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/12_0_0_changelog.md).\n" +
"The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/12.0/12.0.0/changelog.md).\n" +
"optimization is the root of all evil\n",
expectedOutChangeLog: "# Changelog of Vitess v12.0.0\n" +
"* PR 1\n" +

Просмотреть файл

@ -0,0 +1,143 @@
/*
Copyright 2023 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
// The changelog directory is composed of a README that lists
// and links to all major releases of Vitess. It has one
// sub-directory for each major version. Each sub-directory is
// composed of another README that also lists and links all the
// patch releases of this major release. Those sub-directories
// are composed of one directory per patch release. Finally,
// the patch release directory contains the old files markdown:
// summary, release_notes, changelog.
//
// This tool is solely responsible for generating the READMEs
// and making sure they are up-to-date with the list of major
// and patch releases we have.
import (
"log"
"os"
"path"
"sort"
"strings"
"text/template"
)
const (
rootDir = "./changelog/"
rootFileTmpl = `## Releases
{{- range $r := .SubDirs }}
* [{{ $r.Name }}]({{ $r.Name }})
{{- end -}}
`
majorVersionTmpl = `## v{{ .Name }}
{{- if .Team }}
The dedicated team for this release can be found [here]({{.Team}}).{{ end }}
{{- range $r := .SubDirs }}
* **[{{ $r.Name }}]({{ $r.Name }})**
{{ if $r.Changelog }} * [Changelog]({{ $r.Name }}/{{ $r.Changelog }})
{{ end -}}
{{ if $r.ReleaseNotes }} * [Release Notes]({{ $r.Name }}/{{ $r.ReleaseNotes }})
{{ end -}}
{{- end -}}
`
)
type dir struct {
Name string
Path string
Changelog string
ReleaseNotes string
Team string
SubDirs []dir
}
func main() {
rootDir, err := getDirs(dir{Path: rootDir})
if err != nil {
log.Fatal(err)
}
err = execReadMeTemplateWithDir(rootDir, rootFileTmpl)
if err != nil {
log.Fatal(err)
}
for _, subDir := range rootDir.SubDirs {
err := execReadMeTemplateWithDir(subDir, majorVersionTmpl)
if err != nil {
log.Fatal(err)
}
}
}
func execReadMeTemplateWithDir(d dir, tmpl string) error {
rootRM, err := os.OpenFile(path.Join(d.Path, "README.md"), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0640)
if err != nil {
return err
}
t := template.Must(template.New("root_readme").Parse(tmpl))
err = t.ExecuteTemplate(rootRM, "root_readme", d)
if err != nil {
return err
}
return nil
}
func getDirs(curDir dir) (dir, error) {
entries, err := os.ReadDir(curDir.Path)
if err != nil {
return dir{}, err
}
for _, entry := range entries {
if entry.IsDir() {
subDir, err := getDirs(dir{
Name: entry.Name(),
Path: path.Join(curDir.Path, entry.Name()),
})
if err != nil {
return dir{}, err
}
curDir.SubDirs = append(curDir.SubDirs, subDir)
continue
}
switch {
case strings.Contains(entry.Name(), "changelog.md"):
curDir.Changelog = entry.Name()
case strings.Contains(entry.Name(), "release_notes.md"):
curDir.ReleaseNotes = entry.Name()
case strings.Contains(entry.Name(), "team.md"):
curDir.Team = entry.Name()
}
}
sort.Slice(curDir.SubDirs, func(i, j int) bool {
if len(curDir.SubDirs[i].Name) < len(curDir.SubDirs[j].Name) {
return false
}
return curDir.SubDirs[i].Name > curDir.SubDirs[j].Name
})
return curDir, nil
}