Skip to content
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

chore: Verbose release notes #11144

Merged
merged 8 commits into from
Jan 9, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion hack/generate-release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/$v

## Release signatures

All Argo CD container images and CLI binaries are signed by cosign. See the [documentation](https://argo-cd.readthedocs.io/en/stable/operator-manual/signed-release-assets.md/) on how to verify the signatures.
All Argo CD container images and CLI binaries are signed by cosign. See the [documentation](https://argo-cd.readthedocs.io/en/stable/operator-manual/signed-release-assets/) on how to verify the signatures.
\`\`\`shell
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEesHEB7vX5Y2RxXypjMy1nI1z7iRG
Expand Down Expand Up @@ -94,6 +94,36 @@ if [ "$new_contributors_num" -gt 0 ]; then
new_contributors_message=" ($new_contributors_num of them new)"
fi

# Adapted from https://stackoverflow.com/a/67029088/684776
less_log=$(git log --pretty="format:%s %ae" --cherry-pick --left-only --no-merges "$new_ref...$old_ref")
more_log=$(git log --pretty="format:%s %ae" "$new_ref..$old_ref")

new_commits=$(diff --new-line-format="" --unchanged-line-format="" <(echo "$less_log") <(echo "$more_log") | grep -v "Merge pull request from GHSA")
new_commits_no_email=$(echo "$new_commits" | strip_last_word)
features=$(echo "$new_commits_no_email" | grep '^feat' | to_list_items)
leoluz marked this conversation as resolved.
Show resolved Hide resolved
fixes=$(echo "$new_commits_no_email" | grep '^fix' | to_list_items)
docs=$(echo "$new_commits_no_email" | grep '^docs' | to_list_items)
other=$(echo "$new_commits_no_email" | grep -v -e '^feat' -e '^fix' -e '^docs' | to_list_items)

contributors_num=$(echo "$new_commits" | only_last_word | sort -u | nonempty_line_count)

new_commits_num=$(echo "$new_commits" | nonempty_line_count)
features_num=$(echo "$features" | nonempty_line_count)
fixes_num=$(echo "$fixes" | nonempty_line_count)
docs_num=$(echo "$docs" | nonempty_line_count)
other_num=$(echo "$other" | nonempty_line_count)

previous_contributors=$(git log --pretty="format:%an %ae" "$old_ref" | sort -uf)
all_contributors=$(git log --pretty="format:%an %ae" "$new_ref" | sort -uf)
new_contributors=$(diff --new-line-format="" --unchanged-line-format="" <(echo "$all_contributors") <(echo "$previous_contributors"))
new_contributors_num=$(echo "$new_contributors" | only_last_word | nonempty_line_count) # Count contributors by email
new_contributors_names=$(echo "$new_contributors" | strip_last_word | to_list_items)

new_contributors_message=""
if [ "$new_contributors_num" -gt 0 ]; then
new_contributors_message=" ($new_contributors_num of them new)"
fi

echo "## Changes"
echo
echo "This release includes $new_commits_num contributions from $contributors_num contributors$new_contributors_message with $features_num features and $fixes_num bug fixes."
Expand All @@ -103,3 +133,27 @@ if [ "$new_contributors_num" -lt 20 ] && [ "$new_contributors_num" -gt 0 ]; then
echo "$new_contributors_names"
echo
fi
if [ "$features_num" -gt 0 ]; then
echo "### Features"
crenshaw-dev marked this conversation as resolved.
Show resolved Hide resolved
echo
echo "$features"
echo
fi
if [ "$fixes_num" -gt 0 ]; then
echo "### Bug fixes"
echo
echo "$fixes"
echo
fi
if [ "$docs_num" -gt 0 ]; then
echo "### Documentation"
echo
echo "$docs"
echo
fi
if [ "$other_num" -gt 0 ]; then
echo "### Other"
echo
echo "$other"
echo
fi