Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
tools: Update version along with feature level.
Vector7342439b8f0980
diff --git a/tools/merge-api-changelogs b/tools/merge-api-changelogsindex 1276ca42e3a..2de2e40a8f3 100755--- a/tools/merge-api-changelogs+++ b/tools/merge-api-changelogs@@ -57,6 +57,16 @@ def increment_and_get_feature_level() -> int:return new_feature_level+def get_current_major_version() -> str | None:+ changelog_path = Path("api_docs/changelog.md")+ with open(changelog_path) as file:+ for line in file:+ match = re.search(r"## Changes in Zulip (\d+\.\d+)", line)+ if match:+ return match.group(1)+ return None++def merge_changelogs(changelogs: str, new_feature_level: int) -> None:changelogs_merged = Falsechangelog_path = Path("api_docs/changelog.md")@@ -83,6 +93,7 @@ def update_feature_level_in_api_docs(new_feature_level: int) -> None:changelog_files_list = get_changelog_files_list()num_replaces = 0api_docs_path = Path("zerver/openapi/zulip.yaml")+ current_version = get_current_major_version()with open(api_docs_path) as file:lines = file.readlines()@@ -94,7 +105,10 @@ def update_feature_level_in_api_docs(new_feature_level: int) -> None:old_line = linefor file_name in changelog_files_list:temporary_feature_level = file_name[: -len(".md")]- line = line.replace(temporary_feature_level, str(new_feature_level))++ pattern = rf"Zulip \d+\.\d+ \(feature level {temporary_feature_level}\)"+ replacement = f"Zulip {current_version} (feature level {new_feature_level})"+ line = re.sub(pattern, replacement, line)if old_line != line:num_replaces += 1