-
Notifications
You must be signed in to change notification settings - Fork 159
Add changelogs for latest patch releases #1546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d06d7d1
Add changelog for 1.12.5
msau42 bde5024
Add changelog for 1.11.7
msau42 27c5098
Add changelog for 1.10.12
msau42 e342fa7
Add changelog for 1.9.14
msau42 0835373
Add changelog for 1.8.18
msau42 fcd1e5f
Add changelog for 1.7.19
msau42 33d9df8
Add script to generate patch release notes
msau42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/bin/bash | ||
|
||
# Usage: generate_patch_release_notes.sh | ||
# | ||
# Generates and creates commits for GCP CSI driver patch release notes. | ||
# | ||
# Required environment variables: | ||
# CSI_RELEASE_TOKEN: Github token needed for generating release notes | ||
# | ||
# Prerequisites: | ||
# - This script creates and deletes the origin/changelog branch in your git | ||
# workspace. Make sure you are not using the branch for anything else. | ||
# | ||
# Instructions: | ||
# 1. Update the versions in the $releases array | ||
# 2. Set environment variables | ||
# 3. Run the script | ||
# 4. The script pushes the commits to your origin/changelog branch | ||
# 5. Make any modifications as needed | ||
# 6. Create a PR | ||
# | ||
# Caveats: | ||
# - This script doesn't handle regenerating and updating existing branches. | ||
# - The "--start-rev" option in the release-notes generator is inclusive, which | ||
# causes the last commit from the last patch to show up in the release notes (if | ||
# there was a release note). This needs to be manually modified until a solution is found. | ||
|
||
set -e | ||
set -x | ||
|
||
repo="gcp-compute-persistent-disk-csi-driver" | ||
releases=( | ||
"1.12.5" | ||
"1.11.7" | ||
"1.10.12" | ||
"1.9.14" | ||
"1.8.18" | ||
"1.7.19" | ||
) | ||
|
||
function gen_patch_relnotes() { | ||
rm out.md || true | ||
rm -rf /tmp/k8s-repo || true | ||
GITHUB_TOKEN=$CSI_RELEASE_TOKEN \ | ||
release-notes --start-rev=$3 --end-rev=$2 --branch=$2 \ | ||
--org=kubernetes-sigs --repo=$1 \ | ||
--required-author="" --markdown-links --output out.md | ||
} | ||
|
||
script_dir="$(dirname "$(readlink -f "$0")")" | ||
pushd "$script_dir/../CHANGELOG" | ||
|
||
# Create branch | ||
git fetch upstream | ||
git checkout master | ||
git rebase upstream/master | ||
|
||
branch="changelog" | ||
if [ `git rev-parse --verify "$branch" 2>/dev/null` ]; then | ||
git branch -D "$branch" | ||
fi | ||
git checkout -b $branch | ||
|
||
for version in "${releases[@]}"; do | ||
# Parse minor and patch version | ||
minorPatchPattern="(^[[:digit:]]+\.[[:digit:]]+)\.([[:digit:]]+)" | ||
[[ "$version" =~ $minorPatchPattern ]] | ||
minor="${BASH_REMATCH[1]}" | ||
patch="${BASH_REMATCH[2]}" | ||
|
||
echo $repo $version $minor $patch | ||
newVer="v$minor.$patch" | ||
prevPatch="$(($patch-1))" | ||
prevVer="v$minor.$prevPatch" | ||
|
||
# Generate release notes | ||
gen_patch_relnotes $repo release-$minor $prevVer | ||
cat > tmp.md <<EOF | ||
# $newVer - Changelog since $prevVer | ||
|
||
EOF | ||
|
||
cat out.md >> tmp.md | ||
echo >> tmp.md | ||
echo >> tmp.md | ||
|
||
file="CHANGELOG-$minor.md" | ||
cat $file >> tmp.md | ||
mv tmp.md $file | ||
|
||
git add -u | ||
git commit -m "Add changelog for $version" | ||
done | ||
|
||
git push -f origin $branch | ||
|
||
popd |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1515 is technically on 1.12.4. I would either move it to 1.12.4, or change the subtitle above to "Changelog since v1.12.3"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed