Skip to content

Commit 11904c7

Browse files
authored
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 <[email protected]>
1 parent 070892d commit 11904c7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Diff for: release/git.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,12 @@ def create_tag(tag, **kwargs):
128128
cmd(f"Creating git tag {tag}", ["git", "tag", "-a", tag, "-m", tag], **kwargs)
129129

130130

131-
def push_tag(tag, remote=push_remote_name, **kwargs):
131+
def push_ref(ref, remote=push_remote_name, **kwargs):
132132
__defaults(kwargs)
133-
cmd("Pushing tag {tag} to {remote}", f"git push {remote} {tag}")
133+
cmd(f"Pushing ref {ref} to {remote}", f"git push {remote} {ref}")
134134

135135

136+
def merge_ref(ref, **kwargs):
137+
__defaults(kwargs)
138+
cmd(f"Merging ref {ref}", f"git merge {ref}")
139+

Diff for: release/release.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ def delete_gitrefs():
297297
git.commit(f"Bump version to {release_version}")
298298
git.create_tag(rc_tag)
299299
git.switch_branch(starting_branch)
300+
git.merge_ref(rc_tag)
300301

301302
# Note that we don't use tempfile here because mkdtemp causes problems with being able to determine the absolute path to a file.
302303
# Instead we rely on a fixed path
@@ -367,7 +368,8 @@ def delete_gitrefs():
367368
print(templates.deploy_instructions())
368369
confirm_or_fail("Have you successfully deployed the artifacts?")
369370
confirm_or_fail(f"Ok to push RC tag {rc_tag}?")
370-
git.push_tag(rc_tag)
371+
git.push_ref(rc_tag)
372+
git.push_ref(starting_branch)
371373

372374
# Move back to starting branch and clean out the temporary release branch (e.g. 1.0.0) we used to generate everything
373375
git.reset_hard_head()

0 commit comments

Comments
 (0)