Skip to content

Commit

Permalink
GH-43284: [Release] Fix version detection timing for bump deb package…
Browse files Browse the repository at this point in the history
… names on post-12-bump-versions.sh script (#43294)

### Rationale for this change

The script fails to bump deb package names at the moment due to an unmatching if.

### What changes are included in this PR?

Use current_version before bumping the versions in order to match debian packages to be updated.

### Are these changes tested?

It has been tested locally to bump the versions for the debian package names on main for 17.0.0

### Are there any user-facing changes?

No
* GitHub Issue: #43284

Authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
raulcd authored Jul 20, 2024
1 parent ed67a42 commit fe51029
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions dev/release/post-12-bump-versions-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,15 @@ def test_version_post_tag
def test_deb_package_names
omit_on_release_branch unless bump_type.nil?
current_commit = git_current_commit
stdout = bump_versions("DEB_PACKAGE_NAMES")
changes = parse_patch(git("log", "-p", "#{current_commit}.."))
stdout = bump_versions("VERSION_POST_TAG", "DEB_PACKAGE_NAMES")
log = git("log", "-p", "#{current_commit}..")
# Remove a commit for VERSION_POST_TAG
if log.scan(/^commit/).size == 1
log = ""
else
log.gsub!(/\A(commit.*?)^commit .*\z/um, "\\1")
end
changes = parse_patch(log)
sampled_changes = changes.collect do |change|
first_hunk = change[:hunks][0]
first_removed_line = first_hunk.find { |line| line.start_with?("-") }
Expand Down
3 changes: 2 additions & 1 deletion dev/release/post-12-bump-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fi
version=$1
next_version=$2
next_version_snapshot="${next_version}-SNAPSHOT"
current_version_before_bump="$(current_version)"

case "${version}" in
*.0.0)
Expand All @@ -64,7 +65,7 @@ if [ ${BUMP_VERSION_POST_TAG} -gt 0 ]; then
fi

if [ ${BUMP_DEB_PACKAGE_NAMES} -gt 0 ] && \
[ "${next_version}" != "$(current_version)" ]; then
[ "${next_version}" != "${current_version_before_bump}" ]; then
update_deb_package_names "${version}" "${next_version}"
fi

Expand Down

0 comments on commit fe51029

Please sign in to comment.