KAFKA-19166: Fix RC tag in release script (#19518)

The release script was pushing the RC tag off of a temporary branch that
was never merged back into the release branch. This meant that our RC
and release tags were detached from the rest of the repository.

This patch changes the release script to merge the RC tag back into the
release branch and pushes both the tag and the branch.

Reviewers: Luke Chen <showuon@gmail.com>
This commit is contained in:
David Arthur 2025-04-22 05:04:22 -04:00 committed by GitHub
parent 070892dafc
commit 11904c74e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -128,8 +128,12 @@ def create_tag(tag, **kwargs):
cmd(f"Creating git tag {tag}", ["git", "tag", "-a", tag, "-m", tag], **kwargs)
def push_tag(tag, remote=push_remote_name, **kwargs):
def push_ref(ref, remote=push_remote_name, **kwargs):
__defaults(kwargs)
cmd("Pushing tag {tag} to {remote}", f"git push {remote} {tag}")
cmd(f"Pushing ref {ref} to {remote}", f"git push {remote} {ref}")
def merge_ref(ref, **kwargs):
__defaults(kwargs)
cmd(f"Merging ref {ref}", f"git merge {ref}")

View File

@ -297,6 +297,7 @@ textfiles.replace(f"{repo_dir}/docs/js/templateData.js", "-SNAPSHOT", "", regex=
git.commit(f"Bump version to {release_version}")
git.create_tag(rc_tag)
git.switch_branch(starting_branch)
git.merge_ref(rc_tag)
# Note that we don't use tempfile here because mkdtemp causes problems with being able to determine the absolute path to a file.
# Instead we rely on a fixed path
@ -367,7 +368,8 @@ confirm_or_fail("Have you sufficiently verified the release artifacts?")
print(templates.deploy_instructions())
confirm_or_fail("Have you successfully deployed the artifacts?")
confirm_or_fail(f"Ok to push RC tag {rc_tag}?")
git.push_tag(rc_tag)
git.push_ref(rc_tag)
git.push_ref(starting_branch)
# Move back to starting branch and clean out the temporary release branch (e.g. 1.0.0) we used to generate everything
git.reset_hard_head()