Skip to content

Commit

Permalink
[KYUUBI #6559] Various improvments for release scripts
Browse files Browse the repository at this point in the history
# 🔍 Description

This PR contains various improvement for Kyuubi release scripts:

- update known_translations
- improve `pre_gen_release_notes.py` to generate the copy-paste contributor list
- update vote and announcement mail templates

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

Manually tested and self reviewed.

---

# Checklist 📝

- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6559 from pan3793/rel-scripts.

Closes #6559

78aad05 [Cheng Pan] Various improvments for release scripts

Authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
pan3793 committed Jul 23, 2024
1 parent 0f6d764 commit 05cb5b4
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 105 deletions.
10 changes: 10 additions & 0 deletions build/release/known_translations
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
# The format expected on each line should be: <GitHub ID> - <Full Name>
AngersZhuuuu - Yi Zhu
ASiegeLion - Peiyue Liu
bkyryliuk - Bogdan Kyryliuk
bowenliang123 - Bowen Liang
BruceWong96 - Bruce Wong
camper42 - Fengyu Cao
CavemanIV - Liang Zhang
cxzl25 - Shaoyun Chen
davidyuan1223 - David Yuan
Expand All @@ -42,25 +44,33 @@ lightning_L - Tianlin Liao
liunaijie - Naijie Liu
liuxiaocs7 - Xiao Liu
lsm1 - Senmiao Liu
jiaoqingbo - Qingbo Jiao
junjiem - Junjie Ma
mattshma - Ming Ma
merrily01 - Ruilei Ma
minyk - Drake Youngkun Min
packyan - Deng An
panbingkun - BingKun Pan
dupen01 - Perl Du
QianyongY - Yong Qian
SteNicholas - Nicholas Jiang
sudohainguyen - Harry
thomasg19930417 - Xu Guo
turboFei - Fei Wang
ulysses-you - Xiduo You
vinoyang - Vino Yang
Wang, Fei - Fei Wang
wangmiao1002 - Miao Wang
waywtdcc - Chao Chen
wForget - Zhen Wang
Xieming LI - Xieming Li
XorSum - Baokun Han
yabola - Chenliang Lu
yanghua - Vino Yang
yikf - Kaifei Yi
Yikf - Kaifei Yi
ymZhao1001 - Yangming Zhao
Z1Wu - Ziyi Wu
zhaohehuhu - He Zhao
zhaomin1423 - Min Zhao
zhouyifan279 - Yifan Zhou
Expand Down
48 changes: 11 additions & 37 deletions build/release/pre_gen_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,9 @@ def is_revert(commit_title):
# Keep track of warnings to tell the user at the end
warnings = []

# Mapping from the invalid author name to its associated tickets
# E.g. pan3793 -> set("[KYUUBI #1234]", "[KYUUBI #1235]")
invalid_authors = {}

# Populate a map that groups issues and components by author
# It takes the form: Author Name -> set()
# For instance,
# {
# 'Cheng Pan' -> set('[KYUUBI #1234]', '[KYUUBI #1235]'),
# 'Fu Chen' -> set('[KYUUBI #2345]')
# }
#
author_info = {}
# The author name that needs to translate
invalid_authors = set()
authors = set()
print("\n=========================== Compiling contributor list ===========================")
for commit in effective_commits:
_hash = commit.get_hash()
Expand All @@ -204,21 +194,8 @@ def is_revert(commit_title):
# with all associated issues so we can translate it later
author = capitalize_author(author)
else:
if author not in invalid_authors:
invalid_authors[author] = set()
for issue in issues:
invalid_authors[author].add(issue)
# Populate or merge an issue into author_info[author]
def populate(issues):
if author not in author_info:
author_info[author] = set()
for issue in issues:
author_info[author].add(issue)
# Find issues associated with this commit
try:
populate(issues)
except Exception as e:
print("Unexpected error:", e)
invalid_authors.add(author)
authors.add(author)
print(" Processed commit %s authored by %s on %s" % (_hash, author, date))
print("==================================================================================\n")

Expand All @@ -232,17 +209,14 @@ def populate(issues):
print("Commits list is successfully written to %s!" % commits_file_name)

# Write to contributors file ordered by author names
# Each line takes the format " * Author Name -- tickets"
# e.g. * Cheng Pan -- [KYUUBI #1234][KYUUBI #1235]
# e.g. * Fu Chen -- [KYUUBI #2345]
# Each line takes the format " * Author Name"
# e.g. * Cheng Pan
# e.g. * Fu Chen
contributors_file = open(os.path.join(release_dir, contributors_file_name), "w")
authors = list(author_info.keys())
authors.sort(key=lambda author: author.split(" ")[-1])
author_max_len = max(len(author) for author in authors)
sorted_authors = list(authors)
sorted_authors.sort(key=lambda author: author.split(" ")[-1])
for author in authors:
contribution = "".join(author_info[author])
line = ("* {:<%s}" % author_max_len).format(author) + " -- " + contribution
contributors_file.write(line + "\n")
contributors_file.write("* %s\n" % author)
contributors_file.close()
print("Contributors list is successfully written to %s!" % contributors_file_name)

Expand Down
38 changes: 15 additions & 23 deletions build/release/script/announce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,53 +24,45 @@ RELEASE_DIR="$(cd "$(dirname "$0")"/..; pwd)"

######### Please modify the variables ##########
# release version, e.g. 1.7.0
release_version=${release_version:-""}
RELEASE_VERSION=${RELEASE_VERSION:-""}
################################################

if [[ -z $release_version ]]; then
echo "Please input release version"
if [[ -z $RELEASE_VERSION ]]; then
echo "Please input release version, e.g. 1.7.0"
exit 1
fi

echo "Release version: ${release_version}"
echo "Release version: ${RELEASE_VERSION}"

RELEASE_TEMP_DIR=${RELEASE_DIR}/tmp
mkdir -p ${RELEASE_TEMP_DIR}
ANNOUNCE=${RELEASE_TEMP_DIR}/${release_version}_announce.temp
ANNOUNCE=${RELEASE_TEMP_DIR}/v${RELEASE_VERSION}_announce.temp

cat >$ANNOUNCE<<EOF
Title: [ANNOUNCE] Apache Kyuubi released ${release_version}
Title: [ANNOUNCE] Apache Kyuubi v${RELEASE_VERSION} is available
Content:
Hi all,
The Apache Kyuubi community is pleased to announce that
Apache Kyuubi ${release_version} has been released!
Apache Kyuubi v${RELEASE_VERSION} has been released!
Apache Kyuubi is a distributed and multi-tenant gateway to provide
serverless SQL on data warehouses and lakehouses.
Apache Kyuubi is a distributed and multi-tenant gateway to provide
serverless SQL on Data Warehouses and Lakehouses.
Kyuubi provides a pure SQL gateway through Thrift JDBC/ODBC interface
for end-users to manipulate large-scale data with pre-programmed and
extensible Spark SQL engines.
We are aiming to make Kyuubi an "out-of-the-box" tool for data warehouses
and lakehouses.
This "out-of-the-box" model minimizes the barriers and costs for end-users
to use Spark at the client side.
At the server-side, Kyuubi server and engine's multi-tenant architecture
provides the administrators a way to achieve computing resource isolation,
data security, high availability, high client concurrency, etc.
Kyuubi builds distributed SQL query engines on top of various kinds of
modern computing frameworks, e.g., Apache Spark, Apache Flink, Apache
Doris, Apache Hive, Trino, and StarRocks, etc., to query massive datasets
distributed over fleets of machines from heterogeneous data sources.
The full release notes and download links are available at:
Release Notes: https://kyuubi.apache.org/release/${release_version}.html
Release Notes: https://kyuubi.apache.org/release/${RELEASE_VERSION}.html
To learn more about Apache Kyuubi, please see
https://kyuubi.apache.org/
Kyuubi Resources:
- Documentation: https://kyuubi.readthedocs.io/en/v${RELEASE_VERSION}/
- Issue: https://github.com/apache/kyuubi/issues
- Mailing list: [email protected]
Expand Down
84 changes: 42 additions & 42 deletions build/release/script/dev_kyuubi_vote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,89 +23,89 @@ set -e
RELEASE_DIR="$(cd "$(dirname "$0")"/..; pwd)"

######### Please modify the variables ##########
# release version, e.g. v1.7.0
release_version=${release_version:-""}
# release candidate number, e.g. rc2
release_rc_no=${release_rc_no:-""}
# previous release candidate number, e.g. rc1, could be empty if it is the first vote
prev_release_rc_no=${prev_release_rc_no:-""}
# previous release version, e.g. v1.7.0, this is used to generate change log
prev_release_version=${prev_release_version:-""}
# release version, e.g. 1.7.1
RELEASE_VERSION=${RELEASE_VERSION:-""}
# release candidate number, e.g. 2
RELEASE_RC_NO=${RELEASE_RC_NO:-""}
# previous release candidate number, e.g. 1, could be empty if it is the first vote
PREV_RELEASE_RC_NO=${PREV_RELEASE_RC_NO:-""}
# previous release version, e.g. 1.7.0, this is used to generate change log
PREV_RELEASE_VERSION=${PREV_RELEASE_VERSION:-""}
# staging repository number, check it under https://repository.apache.org/content/repositories
repo_no=${repo_no:-""}
REPO_NO=${REPO_NO:-""}
################################################

if [[ -z $release_version ]]; then
echo "Please input release version"
if [[ -z $RELEASE_VERSION ]]; then
echo "Please input RELEASE_VERSION, e.g. 1.7.1"
exit 1
fi
if [[ -z $release_rc_no ]]; then
echo "Please input release rc number"
if [[ -z $RELEASE_RC_NO ]]; then
echo "Please input RELEASE_RC_NO, e.g. 2"
exit 1
fi
if [[ -z $prev_release_version ]]; then
echo "Please input prev release version which is used to generate change log"
if [[ -z $PREV_RELEASE_VERSION ]]; then
echo "Please input PREV_RELEASE_VERSION which is used to generate change log, e.g. 1.7.0"
exit 1
fi
if [[ -z $repo_no ]]; then
if [[ -z $REPO_NO ]]; then
echo "Please input staging repository number, check it under https://repository.apache.org/content/repositories "
exit 1
fi

release_rc_tag=${release_version}-${release_rc_no}
git_commit_hash=$(git rev-list -n 1 $release_rc_tag)

echo "Release version: ${release_version}"
echo "Release candidate number: ${release_rc_no}"
echo "Previous release candidate number: ${prev_release_rc_no}"
echo "Staging repository number: ${repo_no}"
echo "Release candidate tag: ${release_rc_tag}"
echo "Release candidate tag commit hash: ${git_commit_hash}"

if [[ ! -z "$prev_release_rc_no" ]]; then
prev_release_rc_tag=${release_version}-${prev_release_rc_no}
change_from_pre_commit="
The commit list since the ${prev_release_rc_no}:
https://github.com/apache/kyuubi/compare/${prev_release_rc_tag}...${release_rc_tag}
RELEASE_RC_TAG=v${RELEASE_VERSION}-rc${RELEASE_RC_NO}
GIT_COMMIT_HASH=$(git rev-list -n 1 $RELEASE_RC_TAG)

echo "Release version: v${RELEASE_VERSION}"
echo "Release candidate number: RC${RELEASE_RC_NO}"
echo "Previous release candidate number: RC${PREV_RELEASE_RC_NO}"
echo "Staging repository number: ${REPO_NO}"
echo "Release candidate tag: ${RELEASE_RC_TAG}"
echo "Release candidate tag commit hash: ${GIT_COMMIT_HASH}"

if [[ ! -z "$PREV_RELEASE_RC_NO" ]]; then
PREV_RELEASE_RC_TAG=v${RELEASE_VERSION}-rc${PREV_RELEASE_RC_NO}
CHANGE_FROM_PRE_COMMIT="
The commit list since the previous RC:
https://github.com/apache/kyuubi/compare/${PREV_RELEASE_RC_TAG}...${RELEASE_RC_TAG}
"
fi

RELEASE_TEMP_DIR=${RELEASE_DIR}/tmp
mkdir -p ${RELEASE_TEMP_DIR}
DEV_VOTE=${RELEASE_TEMP_DIR}/${release_rc_tag}_dev_vote.temp
DEV_VOTE=${RELEASE_TEMP_DIR}/${RELEASE_RC_TAG}_dev_vote.temp

cat >${DEV_VOTE}<<EOF
Title: [VOTE] Release Apache Kyuubi ${release_version} ${release_rc_no}
Title: [VOTE] Release Apache Kyuubi v${RELEASE_VERSION} RC${RELEASE_RC_NO}
Content:
Hello Apache Kyuubi PMC and Community,
Please vote on releasing the following candidate as
Apache Kyuubi version ${release_version}.
Apache Kyuubi v${RELEASE_VERSION}.
The VOTE will remain open for at least 72 hours.
[ ] +1 Release this package as Apache Kyuubi ${release_version}
[ ] +1 Release this package as Apache Kyuubi v${RELEASE_VERSION}
[ ] +0
[ ] -1 Do not release this package because ...
To learn more about Apache Kyuubi, please see
https://kyuubi.apache.org/
The tag to be voted on is ${release_rc_tag} (commit ${git_commit_hash}):
https://github.com/apache/kyuubi/tree/${release_rc_tag}
The tag to be voted on is ${RELEASE_RC_TAG} (commit ${GIT_COMMIT_HASH}):
https://github.com/apache/kyuubi/tree/${RELEASE_RC_TAG}
The release files, including signatures, digests, etc. can be found at:
https://dist.apache.org/repos/dist/dev/kyuubi/${release_rc_tag}/
https://dist.apache.org/repos/dist/dev/kyuubi/${RELEASE_RC_TAG}/
Signatures used for Kyuubi RCs can be found in this file:
https://downloads.apache.org/kyuubi/KEYS
The staging repository for this release can be found at:
https://repository.apache.org/content/repositories/orgapachekyuubi-${repo_no}/
${change_from_pre_commit}
The release note is available in:
https://github.com/apache/kyuubi/compare/${prev_release_version}...${release_rc_tag}
https://repository.apache.org/content/repositories/orgapachekyuubi-${REPO_NO}/
${CHANGE_FROM_PRE_COMMIT}
The commit list since the latest released version:
https://github.com/apache/kyuubi/compare/v${PREV_RELEASE_VERSION}...${RELEASE_RC_TAG}
Thanks,
On behalf of Apache Kyuubi community
Expand Down
4 changes: 2 additions & 2 deletions build/release/tmpl/dev_kyuubi_cancel_vote.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
# limitations under the License.
#

Title: [CANCEL][VOTE] Release Apache Kyuubi {release_version} {release_rc_no}
Title: [CANCEL][VOTE] Release Apache Kyuubi {RELEASE_VERSION} {RELEASE_RC_NO}

Content:
Hello Apache Kyuubi PMC and Community,

We need to cancel the {release_rc_no} due to {issue_description}[1],
We need to cancel the {RELEASE_RC_NO} due to {issue_description}[1],
and thank everyone who helped vote.

[1] https://github.com/apache/kyuubi/issues/{issue_number}
Expand Down
2 changes: 1 addition & 1 deletion build/release/tmpl/dev_kyuubi_vote_result.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#

Title: [RESULT][VOTE] Release Apache Kyuubi {release_version} {release_rc_no}
Title: [RESULT][VOTE] Release Apache Kyuubi {RELEASE_VERSION} {RELEASE_RC_NO}

Content:
Hello Apache Kyuubi PMC and Community,
Expand Down

0 comments on commit 05cb5b4

Please sign in to comment.