From 76bd90b84425a1e9fd702ac0c78770ce412d1ce6 Mon Sep 17 00:00:00 2001 From: AllyW Date: Mon, 18 Mar 2024 10:59:32 +0800 Subject: [PATCH 1/2] add init module versionb --- scripts/ci/release_version_cal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/ci/release_version_cal.py b/scripts/ci/release_version_cal.py index 381099f622e..236cd56544d 100644 --- a/scripts/ci/release_version_cal.py +++ b/scripts/ci/release_version_cal.py @@ -24,6 +24,7 @@ pr_label_list = [name.lower() for name in pr_label_list] DEFAULT_VERSION = "0.0.0" +INIT_RELEASE_VERSION = "1.0.0b1" def get_module_metadata_of_max_version(mod): @@ -70,7 +71,7 @@ def gen_comment_message(mod, next_version, comment_message): comment_message.append("### Module: {0}".format(mod)) comment_message.append(" - Update version to `{0}` in setup.py".format(next_version.get("version", "-"))) if next_version.get("has_preview_tag", False): - comment_message.append(' - Set `azext.isPreview` to `true` in azext_{0}/azext_metadata.json'.format(mod)) + comment_message.append(' - Set `azext.isPreview` to `true` in azext_{0}/azext_metadata.json if not exists'.format(mod)) def add_label_hint_message(comment_message): @@ -114,6 +115,7 @@ def main(): diff_meta_file = os.path.join(cli_ext_path, diff_meta_path, "az_" + mod + "_meta.json") if not os.path.exists(base_meta_file): print("no base meta file found for {0}".format(mod)) + gen_comment_message(mod, {"version": INIT_RELEASE_VERSION}, comment_message) continue if not os.path.exists(diff_meta_file): print("no diff meta file found for {0}".format(mod)) From ea407099cb377a6e4107c654dfdcd5298e005075 Mon Sep 17 00:00:00 2001 From: AllyW Date: Mon, 18 Mar 2024 11:08:14 +0800 Subject: [PATCH 2/2] fix file check --- scripts/ci/release_version_cal.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/ci/release_version_cal.py b/scripts/ci/release_version_cal.py index 236cd56544d..e6e5d5b7f30 100644 --- a/scripts/ci/release_version_cal.py +++ b/scripts/ci/release_version_cal.py @@ -113,11 +113,14 @@ def main(): for mod in changed_module_list: base_meta_file = os.path.join(cli_ext_path, base_meta_path, "az_" + mod + "_meta.json") diff_meta_file = os.path.join(cli_ext_path, diff_meta_path, "az_" + mod + "_meta.json") - if not os.path.exists(base_meta_file): + if not os.path.exists(base_meta_file) and not os.path.exists(diff_meta_file): + print("no base and diff meta file found for {0}".format(mod)) + continue + elif not os.path.exists(base_meta_file) and os.path.exists(diff_meta_file): print("no base meta file found for {0}".format(mod)) gen_comment_message(mod, {"version": INIT_RELEASE_VERSION}, comment_message) continue - if not os.path.exists(diff_meta_file): + elif not os.path.exists(diff_meta_file): print("no diff meta file found for {0}".format(mod)) continue