From f571cece80a0a47cea0cc30b8b9005f50ff8228e Mon Sep 17 00:00:00 2001 From: pulpbot Date: Sun, 6 Oct 2024 02:03:47 +0000 Subject: [PATCH] Update CI files --- .ci/scripts/check_release.py | 11 ++++++++--- .ci/scripts/pr_labels.py | 2 +- .github/template_gitref | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.ci/scripts/check_release.py b/.ci/scripts/check_release.py index e5c5bd8..b35a9f0 100755 --- a/.ci/scripts/check_release.py +++ b/.ci/scripts/check_release.py @@ -64,6 +64,7 @@ def main(): for branch in branches: if branch != DEFAULT_BRANCH: # Check if a Z release is needed + reasons = [] changes = repo.git.ls_tree("-r", "--name-only", f"origin/{branch}", "CHANGES/") z_changelog = False for change in changes.split("\n"): @@ -76,23 +77,27 @@ def main(): ) elif ext in Z_CHANGELOG_EXTS: z_changelog = True + if z_changelog: + reasons.append("Backports") last_tag = repo.git.describe("--tags", "--abbrev=0", f"origin/{branch}") req_txt_diff = repo.git.diff( f"{last_tag}", f"origin/{branch}", "--name-only", "--", "requirements.txt" ) - if z_changelog or req_txt_diff: + if req_txt_diff: + reasons.append("requirements.txt") + + if reasons: curr_version = Version(last_tag) assert curr_version.base_version.startswith( branch ), "Current-version has to belong to the current branch!" next_version = Version(f"{branch}.{curr_version.micro + 1}") - reason = "CHANGES" if z_changelog else "requirements.txt" print( f"A Z-release is needed for {branch}, " f"Prev: {last_tag}, " f"Next: {next_version.base_version}, " - f"Reason: {reason}" + f"Reason: {','.join(reasons)}" ) releases.append(next_version) else: diff --git a/.ci/scripts/pr_labels.py b/.ci/scripts/pr_labels.py index 24edc73..0c478a2 100755 --- a/.ci/scripts/pr_labels.py +++ b/.ci/scripts/pr_labels.py @@ -23,7 +23,7 @@ def main(): f".{item['directory']}" for item in PYPROJECT_TOML["tool"]["towncrier"]["type"] } except KeyError: - CHANGELOG_EXTS = {"feature", "bugfix", "doc", "removal", "misc"} + CHANGELOG_EXTS = {".feature", ".bugfix", ".doc", ".removal", ".misc"} repo = Repo(".") diff --git a/.github/template_gitref b/.github/template_gitref index 1691300..a743dd7 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-383-gc4cd2b8 +2021.08.26-385-g17472a1