Skip to content

Commit e1ce605

Browse files
authored
Merge pull request #553 from andyzhangx/update_release-tools2
[chore] Update release tools2
2 parents 1499d02 + 1fe00cb commit e1ce605

File tree

4 files changed

+149
-51
lines changed

4 files changed

+149
-51
lines changed

release-tools/SIDECAR_RELEASE_PROCESS.md

+39-48
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The release manager must:
1717
Whenever a new Kubernetes minor version is released, our kubernetes-csi CI jobs
1818
must be updated.
1919

20-
[Our CI jobs](https://k8s-testgrid.appspot.com/sig-storage-csi-ci) have the
20+
[Our CI jobs](https://testgrid.k8s.io/sig-storage-csi-ci) have the
2121
naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
2222

2323
1. Jobs should be actively monitored to find and fix failures in sidecars and
@@ -46,62 +46,53 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
4646
## Release Process
4747
1. Identify all issues and ongoing PRs that should go into the release, and
4848
drive them to resolution.
49-
1. Download the latest version of the
50-
[K8s release notes generator](https://github.com/kubernetes/release/tree/HEAD/cmd/release-notes)
51-
1. Create a
52-
[Github personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
53-
with `repo:public_repo` access
54-
1. Generate release notes for the release. Replace arguments with the relevant
55-
information.
56-
* Clean up old cached information (also needed if you are generating release
57-
notes for multiple repos)
58-
```bash
59-
rm -rf /tmp/k8s-repo
60-
```
61-
* For new minor releases on master:
62-
```bash
63-
GITHUB_TOKEN=<token> release-notes \
64-
--discover=mergebase-to-latest \
65-
--org=kubernetes-csi \
66-
--repo=external-provisioner \
67-
--required-author="" \
68-
--markdown-links \
69-
--output out.md
70-
```
71-
* For new patch releases on a release branch:
72-
```bash
73-
GITHUB_TOKEN=<token> release-notes \
74-
--discover=patch-to-latest \
75-
--branch=release-1.1 \
76-
--org=kubernetes-csi \
77-
--repo=external-provisioner \
78-
--required-author="" \
79-
--markdown-links \
80-
--output out.md
81-
```
82-
1. Compare the generated output to the new commits for the release to check if
83-
any notable change missed a release note.
84-
1. Reword release notes as needed. Make sure to check notes for breaking
85-
changes and deprecations.
86-
1. If release is a new major/minor version, create a new `CHANGELOG-<major>.<minor>.md`
87-
file. Otherwise, add the release notes to the top of the existing CHANGELOG
88-
file for that minor version.
89-
1. Submit a PR for the CHANGELOG changes.
90-
1. Submit a PR for README changes, in particular, Compatibility, Feature status,
91-
and any other sections that may need updating.
9249
1. Check that all [canary CI
93-
jobs](https://k8s-testgrid.appspot.com/sig-storage-csi-ci) are passing,
50+
jobs](https://testgrid.k8s.io/sig-storage-csi-ci) are passing,
9451
and that test coverage is adequate for the changes that are going into the release.
9552
1. Check that the post-\<sidecar\>-push-images builds are succeeding.
96-
[Example](https://k8s-testgrid.appspot.com/sig-storage-image-build#post-external-snapshotter-push-images)
53+
[Example](https://testgrid.k8s.io/sig-storage-image-build#post-external-snapshotter-push-images)
54+
1. Generate release notes.
55+
1. Download the latest version of the [K8s release notes generator](https://github.com/kubernetes/release/tree/HEAD/cmd/release-notes)
56+
1. Create a
57+
[Github personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
58+
with `repo:public_repo` access
59+
1. For patch release, use the script generate_patch_release_notes.sh. Read the instructions at the top of the
60+
script. The script also creates PRs for each branch.
61+
1. For new minor releases, follow these steps and replace arguments with the relevant
62+
information.
63+
* Clean up old cached information (also needed if you are generating release
64+
notes for multiple repos)
65+
```bash
66+
rm -rf /tmp/k8s-repo
67+
```
68+
* For new minor releases on master:
69+
```bash
70+
GITHUB_TOKEN=<token> release-notes \
71+
--discover=mergebase-to-latest \
72+
--org=kubernetes-csi \
73+
--repo=external-provisioner \
74+
--required-author="" \
75+
--markdown-links \
76+
--output out.md
77+
```
78+
1. Compare the generated output to the new commits for the release to check if
79+
any notable change missed a release note.
80+
1. Reword release notes as needed, ideally in the original PRs so that the
81+
release notes can be regnerated. Make sure to check notes for breaking
82+
changes and deprecations.
83+
1. If release is a new major/minor version, create a new `CHANGELOG-<major>.<minor>.md`
84+
file.
85+
1. Submit a PR for the CHANGELOG changes.
86+
1. Submit a PR for README changes, in particular, Compatibility, Feature status,
87+
and any other sections that may need updating.
9788
1. Make sure that no new PRs have merged in the meantime, and no PRs are in
9889
flight and soon to be merged.
9990
1. Create a new release following a previous release as a template. Be sure to select the correct
10091
branch. This requires Github release permissions as required by the prerequisites.
10192
[external-provisioner example](https://github.com/kubernetes-csi/external-provisioner/releases/new)
10293
1. If release was a new major/minor version, create a new `release-<minor>`
10394
branch at that commit.
104-
1. Check [image build status](https://k8s-testgrid.appspot.com/sig-storage-image-build).
95+
1. Check [image build status](https://testgrid.k8s.io/sig-storage-image-build).
10596
1. Promote images from k8s-staging-sig-storage to registry.k8s.io/sig-storage. From
10697
the [k8s image
10798
repo](https://github.com/kubernetes/k8s.io/tree/HEAD/registry.k8s.io/images/k8s-staging-sig-storage),
@@ -120,7 +111,7 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
120111

121112
The following jobs are triggered after tagging to produce the corresponding
122113
image(s):
123-
https://k8s-testgrid.appspot.com/sig-storage-image-build
114+
https://testgrid.k8s.io/sig-storage-image-build
124115

125116
Clicking on a failed build job opens that job in https://prow.k8s.io. Next to
126117
the job title is a rerun icon (circle with arrow). Clicking it opens a popup
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/bin/bash
2+
3+
# Copyright 2023 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
# Usage: generate_patch_release_notes.sh
19+
#
20+
# Generates and creates PRs for kubernetes-csi patch releases.
21+
#
22+
# Required environment variables
23+
# CSI_RELEASE_TOKEN: Github token needed for generating release notes
24+
# GITHUB_USER: Github username to create PRs with
25+
#
26+
# Instructions:
27+
# 1. Login with "gh auth login"
28+
# 2. Copy this script to the kubernetes-csi directory (one directory above the
29+
# repos)
30+
# 3. Update the repos and versions in the $releases array
31+
# 4. Set environment variables
32+
# 5. Run script from the kubernetes-csi directory
33+
#
34+
# Caveats:
35+
# - This script doesn't handle regenerating and updating existing PRs yet.
36+
# It might work if you comment out the PR creation line
37+
38+
set -e
39+
set -x
40+
41+
releases=(
42+
# "external-attacher 4.4.1"
43+
# "external-provisioner 3.6.1"
44+
# "external-snapshotter 6.2.3"
45+
)
46+
47+
function gen_patch_relnotes() {
48+
rm out.md || true
49+
rm -rf /tmp/k8s-repo || true
50+
GITHUB_TOKEN="$CSI_RELEASE_TOKEN" \
51+
release-notes --discover=patch-to-latest --branch="$2" \
52+
--org=kubernetes-csi --repo="$1" \
53+
--required-author="" --markdown-links --output out.md
54+
}
55+
56+
for rel in "${releases[@]}"; do
57+
read -r repo version <<< "$rel"
58+
59+
# Parse minor version
60+
minorPattern="(^[[:digit:]]+\.[[:digit:]]+)\."
61+
[[ "$version" =~ $minorPattern ]]
62+
minor="${BASH_REMATCH[1]}"
63+
64+
echo "$repo" "$version" "$minor"
65+
66+
pushd "$repo/CHANGELOG"
67+
68+
git fetch upstream
69+
70+
# Create branch
71+
branch="changelog-release-$minor"
72+
git checkout master
73+
git branch -D "$branch" || true
74+
git checkout --track "upstream/release-$minor" -b "$branch"
75+
76+
# Generate release notes
77+
gen_patch_relnotes "$repo" "release-$minor"
78+
cat > tmp.md <<EOF
79+
# Release notes for v$version
80+
81+
[Documentation](https://kubernetes-csi.github.io)
82+
83+
EOF
84+
85+
cat out.md >> tmp.md
86+
echo >> tmp.md
87+
88+
file="CHANGELOG-$minor.md"
89+
cat "$file" >> tmp.md
90+
mv tmp.md "$file"
91+
92+
git add -u
93+
git commit -m "Add changelog for $version"
94+
git push -f origin "$branch"
95+
96+
# Create PR
97+
prbody=$(cat <<EOF
98+
\`\`\`release-note
99+
NONE
100+
\`\`\`
101+
EOF
102+
)
103+
gh pr create --title="Changelog for v$version" --body "$prbody" --head "$GITHUB_USER:$branch" --base "release-$minor" --repo="kubernetes-csi/$repo"
104+
105+
popd
106+
done

release-tools/prow.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64 amd64; linux ppc64le ppc64le -pp
8686
# which is disabled with GOFLAGS=-mod=vendor).
8787
configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory"
8888

89-
configvar CSI_PROW_GO_VERSION_BUILD "1.20" "Go version for building the component" # depends on component's source code
89+
configvar CSI_PROW_GO_VERSION_BUILD "1.21" "Go version for building the component" # depends on component's source code
9090
configvar CSI_PROW_GO_VERSION_E2E "" "override Go version for building the Kubernetes E2E test suite" # normally doesn't need to be set, see install_e2e
9191
configvar CSI_PROW_GO_VERSION_SANITY "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building the csi-sanity test suite" # depends on CSI_PROW_SANITY settings below
9292
configvar CSI_PROW_GO_VERSION_KIND "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building 'kind'" # depends on CSI_PROW_KIND_VERSION below
@@ -199,7 +199,7 @@ kindest/node:v1.18.20@sha256:738cdc23ed4be6cc0b7ea277a2ebcc454c8373d7d8fb991a7fc
199199
# If the deployment script is called with CSI_PROW_TEST_DRIVER=<file name> as
200200
# environment variable, then it must write a suitable test driver configuration
201201
# into that file in addition to installing the driver.
202-
configvar CSI_PROW_DRIVER_VERSION "v1.11.0" "CSI driver version"
202+
configvar CSI_PROW_DRIVER_VERSION "v1.12.0" "CSI driver version"
203203
configvar CSI_PROW_DRIVER_REPO https://github.com/kubernetes-csi/csi-driver-host-path "CSI driver repo"
204204
configvar CSI_PROW_DEPLOYMENT "" "deployment"
205205
configvar CSI_PROW_DEPLOYMENT_SUFFIX "" "additional suffix in kubernetes-x.yy[suffix].yaml files"
@@ -240,7 +240,7 @@ configvar CSI_PROW_SIDECAR_E2E_IMPORT_PATH "none" "CSI Sidecar E2E package"
240240
# of the cluster. The alternative would have been to (cross-)compile csi-sanity
241241
# and install it inside the cluster, which is not necessarily easier.
242242
configvar CSI_PROW_SANITY_REPO https://github.com/kubernetes-csi/csi-test "csi-test repo"
243-
configvar CSI_PROW_SANITY_VERSION v5.0.0 "csi-test version"
243+
configvar CSI_PROW_SANITY_VERSION v5.2.0 "csi-test version"
244244
configvar CSI_PROW_SANITY_PACKAGE_PATH github.com/kubernetes-csi/csi-test "csi-test package"
245245
configvar CSI_PROW_SANITY_SERVICE "hostpath-service" "Kubernetes TCP service name that exposes csi.sock"
246246
configvar CSI_PROW_SANITY_POD "csi-hostpathplugin-0" "Kubernetes pod with CSI driver"

release-tools/pull-test.sh

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ CSI_RELEASE_TOOLS_DIR="$(pwd)"
2525

2626
# Update the other repo.
2727
cd "$PULL_TEST_REPO_DIR"
28+
git reset --hard # Shouldn't be necessary, but somehow is to avoid "fatal: working tree has modifications. Cannot add." (https://stackoverflow.com/questions/3623351/git-subtree-pull-says-that-the-working-tree-has-modifications-but-git-status-sa)
2829
git subtree pull --squash --prefix=release-tools "$CSI_RELEASE_TOOLS_DIR" master
2930
git log -n2
3031

0 commit comments

Comments
 (0)