From 2a36248200499b8b9f926285de671de08ef8d4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Le=C5=9Bniak?= Date: Tue, 23 Dec 2025 14:03:24 +0100 Subject: [PATCH] RDoc-3626 Fixed build_whats_new.py --- scripts/build_whats_new.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/scripts/build_whats_new.py b/scripts/build_whats_new.py index 2acc74397d..ab9dae619b 100644 --- a/scripts/build_whats_new.py +++ b/scripts/build_whats_new.py @@ -67,7 +67,6 @@ "breadcrumbs: false\n" "pagination_next: null\n" "pagination_prev: null\n" - "hide_table_of_contents: true\n" "---\n\n" ) @@ -93,13 +92,6 @@ def get_api_page(branch: str, page: int = 1) -> Dict[str, Any]: response.raise_for_status() return response.json() - -def api_latest_branch() -> str: - """The newest branch announced by the API (e.g. "6.2").""" - probe = get_api_page("6.0", 1) # 6.0 endpoint is guaranteed to exist - return sorted(probe["availableVersionsAndKeys"])[-1] - - def fetch_branch_entries(branch: str) -> List[Dict[str, Any]]: """Download *all* changelog entries for a given branch. @@ -242,9 +234,14 @@ def main() -> None: script_name = Path(sys.argv[0]).name sys.exit(f"Usage: python {script_name} [ ...]") - primary_branch = api_latest_branch() requested_branches = sys.argv[1:] + if len(requested_branches) < 1: + sys.exit("What's new has to be generated for at least one documentation version.") + + # Based on assumption that most recent version given in script parameters matches current version in Docusaurus config + primary_branch = sorted(requested_branches)[-1] + for branch in requested_branches: # reset log for this branch _ESCAPED_TAG_EVENTS.clear()