From 99f514dc5ef5f0cbad9eb89808681acae65df735 Mon Sep 17 00:00:00 2001 From: Kim Morrison Date: Tue, 4 Feb 2025 10:46:26 +1100 Subject: [PATCH] chore: release_checklist.py checks for bump/v4.X.0 branches (#6933) Some downstream repositories require a `bump/v4.X.0` branch to exist for their integration CI. This PR updates `release_checklist.py` to check for the existence of these branches, when needed. --- doc/dev/release_checklist.md | 2 +- script/release_checklist.py | 26 ++++++++++++++++++++++---- script/release_repos.yml | 2 ++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/doc/dev/release_checklist.md b/doc/dev/release_checklist.md index 80c40ba5d6..7680d0c10a 100644 --- a/doc/dev/release_checklist.md +++ b/doc/dev/release_checklist.md @@ -199,7 +199,7 @@ We'll use `v4.7.0-rc1` as the intended release version in this example. - We do this for the same list of repositories as for stable releases, see above. As above, there are dependencies between these, and so the process above is iterative. It greatly helps if you can merge the `bump/v4.7.0` PRs yourself! - It is essential for Mathlib CI that you then create the next `bump/v4.8.0` branch + - It is essential for Mathlib and Batteries CI that you then create the next `bump/v4.8.0` branch for the next development cycle. Set the `lean-toolchain` file on this branch to same `nightly` you used for this release. - (Note: we're currently uncertain if we really want to do this step. Check with Kim Morrison if you're unsure.) diff --git a/script/release_checklist.py b/script/release_checklist.py index 3968a77ff4..d716d97d40 100755 --- a/script/release_checklist.py +++ b/script/release_checklist.py @@ -142,6 +142,14 @@ def extract_org_repo_from_url(repo_url): return repo_url.replace("https://github.com/", "").rstrip("/") return repo_url +def get_next_version(version): + """Calculate the next version number, ignoring RC suffix.""" + # Strip v prefix and RC suffix if present + base_version = strip_rc_suffix(version.lstrip('v')) + major, minor, patch = map(int, base_version.split('.')) + # Next version is always .0 + return f"v{major}.{minor + 1}.0" + def main(): github_token = get_github_token() @@ -201,6 +209,7 @@ def main(): branch = repo["branch"] check_stable = repo["stable-branch"] check_tag = repo.get("toolchain-tag", True) + check_bump = repo.get("bump-branch", False) print(f"\nRepository: {name}") @@ -220,15 +229,24 @@ def main(): if check_tag: if not tag_exists(url, toolchain, github_token): print(f" ❌ Tag {toolchain} does not exist. Run `script/push_repo_release_tag.py {extract_org_repo_from_url(url)} {branch} {toolchain}`.") - continue - print(f" ✅ Tag {toolchain} exists") + else: + print(f" ✅ Tag {toolchain} exists") # Only check merging into stable if stable-branch is true and not a release candidate if check_stable and not is_release_candidate(toolchain): if not is_merged_into_stable(url, toolchain, "stable", github_token): print(f" ❌ Tag {toolchain} is not merged into stable") - continue - print(f" ✅ Tag {toolchain} is merged into stable") + else: + print(f" ✅ Tag {toolchain} is merged into stable") + + # Check for bump branch if configured + if check_bump: + next_version = get_next_version(toolchain) + bump_branch = f"bump/{next_version}" + if branch_exists(url, bump_branch, github_token): + print(f" ✅ Bump branch {bump_branch} exists") + else: + print(f" ❌ Bump branch {bump_branch} does not exist") if __name__ == "__main__": main() diff --git a/script/release_repos.yml b/script/release_repos.yml index 4246f1c36a..e59f05e449 100644 --- a/script/release_repos.yml +++ b/script/release_repos.yml @@ -4,6 +4,7 @@ repositories: toolchain-tag: true stable-branch: true branch: main + bump-branch: true dependencies: [] - name: lean4checker @@ -76,6 +77,7 @@ repositories: toolchain-tag: true stable-branch: true branch: master + bump-branch: true dependencies: - Aesop - ProofWidgets4