-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-41679: [Release][Packaging][deb] Update package name in 01-prepare…
…sh too (#41859) ### Rationale for this change It's needed when we publish minor release. For example: ```console $ dev/release/01-prepare.sh 16.0.0 17.0.0 # Release 16.0.0 ... $ dev/release/post-11-bump-versions.sh 16.0.0 17.0.0 # Released 16.0.0 ... $ dev/release/01-prepare.sh 16.1.0 17.0.0 # Release 16.1.0: This is effected ... $ dev/release/post-11-bump-versions.sh 16.1.0 17.0.0 # Released 16.1.0 ``` We can't detect minor release in `post-11-bump-versions.sh`. ### What changes are included in this PR? Share update codes via `utils-prepare.sh` and use the same logic in `01-prepare.sh` too. Linux packages related update code are also shared but it's not related to this change. Sorry. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: #41679 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
- Loading branch information
Showing
6 changed files
with
142 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,45 @@ def prepare(*targets) | |
sh(env, "dev/release/01-prepare.sh", @release_version, @next_version, "0") | ||
end | ||
|
||
data(:release_type, [nil, :major, :minor, :patch]) | ||
def test_deb_package_names | ||
omit_on_release_branch | ||
current_commit = git_current_commit | ||
stdout = prepare("DEB_PACKAGE_NAMES") | ||
changes = parse_patch(git("log", "-p", "#{current_commit}..")) | ||
sampled_changes = changes.collect do |change| | ||
first_hunk = change[:hunks][0] | ||
first_removed_line = first_hunk.find { |line| line.start_with?("-") } | ||
first_added_line = first_hunk.find { |line| line.start_with?("+") } | ||
{ | ||
sampled_diff: [first_removed_line, first_added_line], | ||
path: change[:path], | ||
} | ||
end | ||
case release_type | ||
when :major, :minor | ||
expected_changes = [ | ||
{ | ||
sampled_diff: [ | ||
"-Package: libarrow#{@snapshot_so_version}", | ||
"+Package: libarrow#{@so_version}", | ||
], | ||
path: "dev/tasks/linux-packages/apache-arrow/debian/control.in", | ||
}, | ||
{ | ||
sampled_diff: [ | ||
"- - libarrow-acero#{@snapshot_so_version}-dbgsym_{no_rc_version}-1_[a-z0-9]+.d?deb", | ||
"+ - libarrow-acero#{@so_version}-dbgsym_{no_rc_version}-1_[a-z0-9]+.d?deb", | ||
], | ||
path: "dev/tasks/tasks.yml", | ||
}, | ||
] | ||
else | ||
expected_changes = [] | ||
end | ||
assert_equal(expected_changes, sampled_changes, "Output:\n#{stdout}") | ||
end | ||
|
||
def test_linux_packages | ||
user = "Arrow Developers" | ||
email = "[email protected]" | ||
|
@@ -96,7 +135,7 @@ def test_linux_packages | |
assert_equal(expected_changes, sampled_changes, "Output:\n#{stdout}") | ||
end | ||
|
||
data(:release_type, [:major, :minor, :patch]) | ||
data(:next_release_type, [:major, :minor, :patch]) | ||
def test_version_pre_tag | ||
omit_on_release_branch | ||
|
||
|
@@ -158,7 +197,7 @@ def test_version_pre_tag | |
], | ||
}, | ||
] | ||
unless release_type == :patch | ||
unless next_release_type == :patch | ||
expected_changes += [ | ||
{ | ||
path: "docs/source/_static/versions.json", | ||
|
@@ -236,7 +275,7 @@ def test_version_pre_tag | |
], | ||
}, | ||
] | ||
if release_type == :major | ||
if next_release_type == :major | ||
expected_changes += [ | ||
{ | ||
path: "r/pkgdown/assets/versions.json", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters