From 05cb5b4112a1a445314482a668f9476f28262c48 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Tue, 23 Jul 2024 21:15:52 +0800 Subject: [PATCH] [KYUUBI #6559] Various improvments for release scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # :mag: 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 :bookmark: - [ ] 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 78aad0500 [Cheng Pan] Various improvments for release scripts Authored-by: Cheng Pan Signed-off-by: Cheng Pan --- build/release/known_translations | 10 +++ build/release/pre_gen_release_notes.py | 48 +++-------- build/release/script/announce.sh | 38 ++++----- build/release/script/dev_kyuubi_vote.sh | 80 +++++++++---------- .../release/tmpl/dev_kyuubi_cancel_vote.tmpl | 4 +- .../release/tmpl/dev_kyuubi_vote_result.tmpl | 2 +- 6 files changed, 79 insertions(+), 103 deletions(-) diff --git a/build/release/known_translations b/build/release/known_translations index b998407b9..79180baec 100644 --- a/build/release/known_translations +++ b/build/release/known_translations @@ -19,8 +19,10 @@ # The format expected on each line should be: - 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 @@ -42,16 +44,22 @@ 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 @@ -59,8 +67,10 @@ 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 diff --git a/build/release/pre_gen_release_notes.py b/build/release/pre_gen_release_notes.py index ec2fcee4b..7b86028a0 100755 --- a/build/release/pre_gen_release_notes.py +++ b/build/release/pre_gen_release_notes.py @@ -176,19 +176,9 @@ known_translations_file.close() # 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() @@ -204,21 +194,8 @@ for commit in effective_commits: # 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") @@ -232,17 +209,14 @@ commits_file.close() 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) diff --git a/build/release/script/announce.sh b/build/release/script/announce.sh index 7d8fbaba0..3e3ca933e 100755 --- a/build/release/script/announce.sh +++ b/build/release/script/announce.sh @@ -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<${DEV_VOTE}<