Skip to content

Commit

Permalink
Remove bump go versions from test bump scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
raulcd committed Sep 19, 2024
1 parent afc4096 commit 42dd7f3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 71 deletions.
14 changes: 0 additions & 14 deletions dev/release/01-prepare-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,6 @@ def test_version_pre_tag
]
end
expected_changes += [
{
path: "go/arrow/doc.go",
hunks: [
["-const PkgVersion = \"#{@snapshot_version}\"",
"+const PkgVersion = \"#{@release_version}\""],
],
},
{
path: "go/parquet/writer_properties.go",
hunks: [
["-\tDefaultCreatedBy = \"parquet-go version #{@snapshot_version}\"",
"+\tDefaultCreatedBy = \"parquet-go version #{@release_version}\""],
],
},
{
path: "js/package.json",
hunks: [
Expand Down
57 changes: 0 additions & 57 deletions dev/release/post-12-bump-versions-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,63 +260,6 @@ def test_version_post_tag
]
end

Dir.glob("go/**/{go.mod,*.go,*.go.*,README.md}") do |path|
if path == "go/arrow/doc.go"
expected_changes << {
path: path,
hunks: [
[
"-const PkgVersion = \"#{@snapshot_version}\"",
"+const PkgVersion = \"#{@next_snapshot_version}\"",
],
]
}
next
end

import_path = "github.com/apache/arrow/go/v#{@snapshot_major_version}"
hunks = []
if next_release_type == :major
lines = File.readlines(path, chomp: true)
target_lines = lines.each_with_index.select do |line, i|
line.include?(import_path)
end
next if target_lines.empty?
n_context_lines = 3 # The default of Git's diff.context
target_hunks = [[target_lines.first[0]]]
previous_i = target_lines.first[1]
target_lines[1..-1].each do |line, i|
if i - previous_i < n_context_lines
target_hunks.last << line
else
target_hunks << [line]
end
previous_i = i
end
target_hunks.each do |lines|
hunk = []
lines.each do |line,|
hunk << "-#{line}"
end
lines.each do |line|
new_line = line.gsub("v#{@snapshot_major_version}") do
"v#{@next_major_version}"
end
hunk << "+#{new_line}"
end
hunks << hunk
end
end
if path == "go/parquet/writer_properties.go"
hunks << [
"-\tDefaultCreatedBy = \"parquet-go version #{@snapshot_version}\"",
"+\tDefaultCreatedBy = \"parquet-go version #{@next_snapshot_version}\"",
]
end
next if hunks.empty?
expected_changes << {hunks: hunks, path: path}
end

Dir.glob("java/**/pom.xml") do |path|
version = "<version>#{@snapshot_version}</version>"
lines = File.readlines(path, chomp: true)
Expand Down

0 comments on commit 42dd7f3

Please sign in to comment.