Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-13485: [Release] Replace ${PREVIOUS_RELEASE}.9000 in r/NEWS.md by post-12-bump-versions.sh #10828

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
91 changes: 44 additions & 47 deletions dev/release/01-prepare-test.rb
Expand Up @@ -341,201 +341,198 @@ def test_version_pre_tag
end

def test_version_post_tag
if on_release_branch?
bump_versions("VERSION_POST_TAG")
else
prepare("VERSION_PRE_TAG")
bump_versions("VERSION_POST_TAG")
end
omit_on_release_branch
bump_versions("VERSION_POST_TAG")
assert_equal([
{
path: "c_glib/meson.build",
hunks: [
["-version = '#{@release_version}'",
["-version = '#{@snapshot_version}'",
"+version = '#{@next_snapshot_version}'"],
],
},
{
path: "ci/scripts/PKGBUILD",
hunks: [
["-pkgver=#{@release_version}",
["-pkgver=#{@previous_version}.9000",
"+pkgver=#{@release_version}.9000"],
],
},
{
path: "cpp/CMakeLists.txt",
hunks: [
["-set(ARROW_VERSION \"#{@release_version}\")",
["-set(ARROW_VERSION \"#{@snapshot_version}\")",
"+set(ARROW_VERSION \"#{@next_snapshot_version}\")"],
],
},
{
path: "cpp/vcpkg.json",
hunks: [
["- \"version-string\": \"#{@release_version}\",",
["- \"version-string\": \"#{@snapshot_version}\",",
"+ \"version-string\": \"#{@next_snapshot_version}\","],
],
},
{
path: "csharp/Directory.Build.props",
hunks: [
["- <Version>#{@release_version}</Version>",
["- <Version>#{@snapshot_version}</Version>",
"+ <Version>#{@next_snapshot_version}</Version>"],
],
},
{
path: "dev/tasks/homebrew-formulae/apache-arrow.rb",
hunks: [
["- url \"https://www.apache.org/dyn/closer.lua?path=arrow/arrow-#{@release_version}/apache-arrow-#{@release_version}.tar.gz\"",
["- url \"https://www.apache.org/dyn/closer.lua?path=arrow/arrow-#{@snapshot_version}/apache-arrow-#{@snapshot_version}.tar.gz\"",
"+ url \"https://www.apache.org/dyn/closer.lua?path=arrow/arrow-#{@next_snapshot_version}/apache-arrow-#{@next_snapshot_version}.tar.gz\""],
],
},
{
path: "dev/tasks/homebrew-formulae/autobrew/apache-arrow.rb",
hunks: [
["- url \"https://www.apache.org/dyn/closer.lua?path=arrow/arrow-#{@release_version}/apache-arrow-#{@release_version}.tar.gz\"",
["- url \"https://www.apache.org/dyn/closer.lua?path=arrow/arrow-#{@previous_version}.9000/apache-arrow-#{@previous_version}.9000.tar.gz\"",
"+ url \"https://www.apache.org/dyn/closer.lua?path=arrow/arrow-#{@release_version}.9000/apache-arrow-#{@release_version}.9000.tar.gz\""],
],
},
{ path: "java/adapter/avro/pom.xml",
hunks: [["- <version>#{@release_version}</version>",
hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]] },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/adapter/jdbc/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/adapter/orc/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/algorithm/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/compression/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/dataset/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/flight/flight-core/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/flight/flight-grpc/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>", "+ <version>#{@next_snapshot_version}</version>"]],
{ hunks: [["- <version>#{@snapshot_version}</version>", "+ <version>#{@next_snapshot_version}</version>"]],
path: "java/format/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/gandiva/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/memory/memory-core/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/memory/memory-netty/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/memory/memory-unsafe/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/memory/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"],
["- <version>#{@release_version}</version>",
["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/performance/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/plasma/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>", "+ <version>#{@next_snapshot_version}</version>"]],
{ hunks: [["- <version>#{@snapshot_version}</version>", "+ <version>#{@next_snapshot_version}</version>"]],
path: "java/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/tools/pom.xml" },
{ hunks: [["- <version>#{@release_version}</version>",
{ hunks: [["- <version>#{@snapshot_version}</version>",
"+ <version>#{@next_snapshot_version}</version>"]],
path: "java/vector/pom.xml" },
{
path: "js/package.json",
hunks: [
["- \"version\": \"#{@release_version}\"",
["- \"version\": \"#{@snapshot_version}\"",
"+ \"version\": \"#{@next_snapshot_version}\""],
],
},
{
path: "matlab/CMakeLists.txt",
hunks: [
["-set(MLARROW_VERSION \"#{@release_version}\")",
["-set(MLARROW_VERSION \"#{@snapshot_version}\")",
"+set(MLARROW_VERSION \"#{@next_snapshot_version}\")"],
],
},
{
path: "python/setup.py",
hunks: [
["-default_version = '#{@release_version}'",
["-default_version = '#{@snapshot_version}'",
"+default_version = '#{@next_snapshot_version}'"],
],
},
{
path: "r/DESCRIPTION",
hunks: [
["-Version: #{@release_version}",
["-Version: #{@previous_version}.9000",
"+Version: #{@release_version}.9000"],
],
},
{
path: "r/NEWS.md",
# Note that these are additions only, no replacement
hunks: [
["+# arrow #{@release_version}.9000",
"+"],
["-# arrow #{@previous_version}.9000",
"+# arrow #{@release_version}.9000",
"+",
"+# arrow #{@release_version}",],
],
},
{
path: "ruby/red-arrow-cuda/lib/arrow-cuda/version.rb",
hunks: [
["- VERSION = \"#{@release_version}\"",
["- VERSION = \"#{@snapshot_version}\"",
"+ VERSION = \"#{@next_snapshot_version}\""],
],
},
{
path: "ruby/red-arrow-dataset/lib/arrow-dataset/version.rb",
hunks: [
["- VERSION = \"#{@release_version}\"",
["- VERSION = \"#{@snapshot_version}\"",
"+ VERSION = \"#{@next_snapshot_version}\""],
],
},
{
path: "ruby/red-arrow-flight/lib/arrow-flight/version.rb",
hunks: [
["- VERSION = \"#{@release_version}\"",
["- VERSION = \"#{@snapshot_version}\"",
"+ VERSION = \"#{@next_snapshot_version}\""],
],
},
{
path: "ruby/red-arrow/lib/arrow/version.rb",
hunks: [
["- VERSION = \"#{@release_version}\"",
["- VERSION = \"#{@snapshot_version}\"",
"+ VERSION = \"#{@next_snapshot_version}\""],
],
},
{
path: "ruby/red-gandiva/lib/gandiva/version.rb",
hunks: [
["- VERSION = \"#{@release_version}\"",
["- VERSION = \"#{@snapshot_version}\"",
"+ VERSION = \"#{@next_snapshot_version}\""],
],
},
{
path: "ruby/red-parquet/lib/parquet/version.rb",
hunks: [
["- VERSION = \"#{@release_version}\"",
["- VERSION = \"#{@snapshot_version}\"",
"+ VERSION = \"#{@next_snapshot_version}\""],
],
},
{
path: "ruby/red-plasma/lib/plasma/version.rb",
hunks: [
["- VERSION = \"#{@release_version}\"",
["- VERSION = \"#{@snapshot_version}\"",
"+ VERSION = \"#{@next_snapshot_version}\""],
],
},
Expand Down
11 changes: 4 additions & 7 deletions dev/release/utils-prepare.sh
Expand Up @@ -121,18 +121,15 @@ update_versions() {
DESCRIPTION
rm -f DESCRIPTION.bak
git add DESCRIPTION
# Replace dev version with release version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's another gap here with regards to patch releases since that version bump goes on top of the previous major release branch. It's fine as long as there is a news entry corresponding to the patch release before the script is run, but if not, this will overwrite the current release version entry. I'm not sure there's a great solution to this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't confirm carefully but this will work well by running the following command on maint-X.Y.x branch after we release X.Y.0:

BUMP_DEFAULT=0 BUMP_VERSION_POST_TAG=1 dev/release/post-12-bump-versions.sh X.Y.0 X.Y.1

sed -i.bak -E -e \
"0,/^# arrow /s/^# arrow .+/# arrow ${base_version}/" \
NEWS.md
if [ ${type} = "snapshot" ]; then
# Add a news entry for the new dev version
echo "dev"
sed -i.bak -E -e \
"0,/^# arrow /s/^(# arrow .+)/# arrow ${r_version}\n\n\1/" \
NEWS.md
else
# Replace dev version with release version
echo "release"
sed -i.bak -E -e \
"0,/^# arrow /s/^# arrow .+/# arrow ${r_version}/" \
NEWS.md
fi
rm -f NEWS.md.bak
git add NEWS.md
Expand Down