Skip to content

Commit

Permalink
apacheGH-43878: [Go][Release] Remove Go related codes from our releas…
Browse files Browse the repository at this point in the history
…e scripts (apache#44172)

### Rationale for this change

The Go implementation is moving to apache/arrow-go from go/ in apache/arrow.

### What changes are included in this PR?

Remove go related release scripts from apache/arrow

### Are these changes tested?

The source verification is tested via archery

### Are there any user-facing changes?

Yes, Go will not be releases as part of Apache Arrow anymore.
* GitHub Issue: apache#43878

Authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
  • Loading branch information
raulcd authored Oct 3, 2024
1 parent b754d5a commit aee3078
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 252 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
75 changes: 0 additions & 75 deletions dev/release/post-12-bump-versions-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,6 @@ def test_version_post_tag
["+ (#{@next_major_version}, 0),"],
],
},
{
path: "docs/source/index.rst",
hunks: [
[
"- Go <https://pkg.go.dev/github.com/apache/arrow/go/v#{@snapshot_major_version}>",
"+ Go <https://pkg.go.dev/github.com/apache/arrow/go/v#{@next_major_version}>",
],
],
},
{
path: "r/pkgdown/assets/versions.json",
hunks: [
Expand All @@ -234,15 +225,6 @@ def test_version_post_tag
],
],
},
{
path: "r/_pkgdown.yml",
hunks: [
[
"- [Go](https://pkg.go.dev/github.com/apache/arrow/go/v#{@snapshot_major_version}) <br>",
"+ [Go](https://pkg.go.dev/github.com/apache/arrow/go/v#{@next_major_version}) <br>",
],
],
},
]
else
expected_changes += [
Expand All @@ -260,63 +242,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
34 changes: 0 additions & 34 deletions dev/release/post-13-go.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 0 additions & 15 deletions dev/release/utils-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,6 @@ update_versions() {
git add */*/*/version.rb
popd

pushd "${ARROW_DIR}/go"
find . "(" -name "*.go*" -o -name "go.mod" -o -name README.md ")" -exec sed -i.bak -E -e \
"s|(github\\.com/apache/arrow/go)/v[0-9]+|\1/v${major_version}|g" {} \;
# update parquet writer version
sed -i.bak -E -e \
"s/\"parquet-go version .+\"/\"parquet-go version ${version}\"/" \
parquet/writer_properties.go
sed -i.bak -E -e \
"s/const PkgVersion = \".*/const PkgVersion = \"${version}\"/" \
arrow/doc.go

find . -name "*.bak" -exec rm {} \;
git add .
popd

pushd "${ARROW_DIR}/docs/source"
# godoc link must reference current version, will reference v0.0.0 (2018) otherwise
sed -i.bak -E -e \
Expand Down
97 changes: 1 addition & 96 deletions dev/release/verify-release-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -389,55 +389,6 @@ install_csharp() {
CSHARP_ALREADY_INSTALLED=1
}

install_go() {
# Install go
if [ "${GO_ALREADY_INSTALLED:-0}" -gt 0 ]; then
show_info "$(go version) already installed at $(which go)"
return 0
fi

if command -v go > /dev/null; then
show_info "Found $(go version) at $(command -v go)"
export GOPATH=${ARROW_TMPDIR}/gopath
mkdir -p $GOPATH
return 0
fi

local version=1.22.6
show_info "Installing go version ${version}..."

local arch="$(uname -m)"
if [ "$arch" == "x86_64" ]; then
arch=amd64
elif [ "$arch" == "aarch64" ]; then
arch=arm64
fi

if [ "$(uname)" == "Darwin" ]; then
local os=darwin
else
local os=linux
fi

local archive="go${version}.${os}-${arch}.tar.gz"
curl -sLO https://go.dev/dl/$archive

ls -l
local prefix=${ARROW_TMPDIR}/go
mkdir -p $prefix
tar -xzf $archive -C $prefix
rm -f $archive

export GOROOT=${prefix}/go
export GOPATH=${prefix}/gopath
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH

mkdir -p $GOPATH
show_info "$(go version) installed at $(which go)"

GO_ALREADY_INSTALLED=1
}

install_conda() {
# Setup short-lived miniconda for Python and integration tests
show_info "Ensuring that Conda is installed..."
Expand Down Expand Up @@ -586,13 +537,6 @@ maybe_setup_virtualenv() {
fi
}

maybe_setup_go() {
show_info "Ensuring that Go is installed..."
if [ "${USE_CONDA}" -eq 0 ]; then
install_go
fi
}

maybe_setup_nodejs() {
show_info "Ensuring that NodeJS is installed..."
if [ "${USE_CONDA}" -eq 0 ]; then
Expand Down Expand Up @@ -951,38 +895,6 @@ test_js() {
popd
}

test_go() {
show_header "Build and test Go libraries"

maybe_setup_go
maybe_setup_conda compilers go=1.22

pushd go
go get -v ./...
if [ ${TEST_GO} -gt 0 ]; then
go test ./...
fi
go install -buildvcs=false ./...
if [ ${TEST_INTEGRATION_GO} -gt 0 ]; then
pushd arrow/internal/cdata_integration
case "$(uname)" in
Linux)
go_lib="arrow_go_integration.so"
;;
Darwin)
go_lib="arrow_go_integration.dylib"
;;
MINGW*)
go_lib="arrow_go_integration.dll"
;;
esac
CGO_ENABLED=1 go build -buildvcs=false -tags cdata_integration,assert -buildmode=c-shared -o ${go_lib} .
popd
fi
go clean -modcache
popd
}

# Run integration tests
test_integration() {
show_header "Build and execute integration tests"
Expand Down Expand Up @@ -1011,7 +923,6 @@ test_integration() {
--with-cpp=${TEST_INTEGRATION_CPP} \
--with-java=${TEST_INTEGRATION_JAVA} \
--with-js=${TEST_INTEGRATION_JS} \
--with-go=${TEST_INTEGRATION_GO} \
$INTEGRATION_TEST_ARGS
}

Expand Down Expand Up @@ -1090,9 +1001,6 @@ test_source_distribution() {

pushd $ARROW_SOURCE_DIR

if [ ${BUILD_GO} -gt 0 ]; then
test_go
fi
if [ ${TEST_CSHARP} -gt 0 ]; then
test_csharp
fi
Expand Down Expand Up @@ -1289,22 +1197,19 @@ test_jars() {
: ${TEST_RUBY:=${TEST_SOURCE}}
: ${TEST_PYTHON:=${TEST_SOURCE}}
: ${TEST_JS:=${TEST_SOURCE}}
: ${TEST_GO:=${TEST_SOURCE}}
: ${TEST_INTEGRATION:=${TEST_SOURCE}}

# For selective Integration testing, set TEST_DEFAULT=0 TEST_INTEGRATION_X=1 TEST_INTEGRATION_Y=1
: ${TEST_INTEGRATION_CPP:=${TEST_INTEGRATION}}
: ${TEST_INTEGRATION_JAVA:=${TEST_INTEGRATION}}
: ${TEST_INTEGRATION_JS:=${TEST_INTEGRATION}}
: ${TEST_INTEGRATION_GO:=${TEST_INTEGRATION}}

# Automatically build/test if its activated by a dependent
TEST_GLIB=$((${TEST_GLIB} + ${TEST_RUBY}))
BUILD_CPP=$((${TEST_CPP} + ${TEST_GLIB} + ${TEST_PYTHON} + ${TEST_INTEGRATION_CPP}))
BUILD_JAVA=$((${TEST_JAVA} + ${TEST_INTEGRATION_JAVA}))
BUILD_JS=$((${TEST_JS} + ${TEST_INTEGRATION_JS}))
BUILD_GO=$((${TEST_GO} + ${TEST_INTEGRATION_GO}))
TEST_INTEGRATION=$((${TEST_INTEGRATION} + ${TEST_INTEGRATION_CPP} + ${TEST_INTEGRATION_JAVA} + ${TEST_INTEGRATION_JS} + ${TEST_INTEGRATION_GO}))
TEST_INTEGRATION=$((${TEST_INTEGRATION} + ${TEST_INTEGRATION_CPP} + ${TEST_INTEGRATION_JAVA} + ${TEST_INTEGRATION_JS}))

# Execute tests in a conda environment
: ${USE_CONDA:=0}
Expand Down
22 changes: 6 additions & 16 deletions docs/source/developers/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ Be sure to go through on the following checklist:
git remote add <YOUR_GITHUB_ID> [email protected]:<YOUR_GITHUB_ID>/homebrew-core.git
cd -
# dev/release/post-15-homebrew.sh 10.0.0 kou
dev/release/post-15-homebrew.sh X.Y.Z <YOUR_GITHUB_ID>
# dev/release/post-14-homebrew.sh 10.0.0 kou
dev/release/post-14-homebrew.sh X.Y.Z <YOUR_GITHUB_ID>
This script pushes a ``apache-arrow-X.Y.Z`` branch to your ``Homebrew/homebrew-core`` fork. You need to create a pull request from the ``apache-arrow-X.Y.Z`` branch with ``apache-arrow, apache-arrow-glib: X.Y.Z`` title on your Web browser.

Expand All @@ -455,8 +455,8 @@ Be sure to go through on the following checklist:
git remote add upstream https://github.com/msys2/MINGW-packages.git
cd -
# dev/release/post-14-msys2.sh 10.0.0 ../MINGW-packages
dev/release/post-14-msys2.sh X.Y.Z <YOUR_MINGW_PACKAGES_FORK>
# dev/release/post-13-msys2.sh 10.0.0 ../MINGW-packages
dev/release/post-13-msys2.sh X.Y.Z <YOUR_MINGW_PACKAGES_FORK>
This script pushes a ``arrow-X.Y.Z`` branch to your ``msys2/MINGW-packages`` fork. You need to create a pull request from the ``arrow-X.Y.Z`` branch with ``arrow: Update to X.Y.Z`` title on your Web browser.

Expand Down Expand Up @@ -602,8 +602,8 @@ Be sure to go through on the following checklist:
git remote add upstream https://github.com/microsoft/vcpkg.git
cd -
# dev/release/post-16-vcpkg.sh 10.0.0 ../vcpkg
dev/release/post-16-vcpkg.sh X.Y.Z <YOUR_VCPKG_FORK>
# dev/release/post-15-vcpkg.sh 10.0.0 ../vcpkg
dev/release/post-15-vcpkg.sh X.Y.Z <YOUR_VCPKG_FORK>
This script pushes a ``arrow-X.Y.Z`` branch to your ``microsoft/vcpkg`` fork. You need to create a pull request from the ``arrow-X.Y.Z`` branch with ``[arrow] Update to X.Y.Z`` title on your Web browser.

Expand Down Expand Up @@ -646,16 +646,6 @@ Be sure to go through on the following checklist:
# dev/release/post-12-bump-versions.sh 10.0.0 11.0.0
dev/release/post-12-bump-versions.sh X.Y.Z NEXT_X.NEXT_Y.NEXT_Z
.. dropdown:: Update tags for Go modules
:animate: fade-in-slide-down
:class-title: sd-fs-5
:class-container: sd-shadow-md

.. code-block:: Bash
# dev/release/post-13-go.sh 10.0.0
dev/release/post-13-go.sh X.Y.Z
.. dropdown:: Update docs
:animate: fade-in-slide-down
:class-title: sd-fs-5
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Implementations
C/GLib <c_glib/index>
C++ <cpp/index>
C# <https://github.com/apache/arrow/blob/main/csharp/README.md>
Go <https://pkg.go.dev/github.com/apache/arrow/go/v18>
Go <https://arrow.apache.org/go/>
Java <java/index>
JavaScript <js/index>
Julia <https://arrow.apache.org/julia/>
Expand Down
2 changes: 1 addition & 1 deletion r/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ home:
[C GLib](https://arrow.apache.org/docs/c_glib) <br>
[C++](https://arrow.apache.org/docs/cpp) <br>
[C#](https://github.com/apache/arrow/blob/main/csharp/README.md) <br>
[Go](https://pkg.go.dev/github.com/apache/arrow/go/v18) <br>
[Go](https://arrow.apache.org/go/) <br>
[Java](https://arrow.apache.org/docs/java) <br>
[JavaScript](https://arrow.apache.org/docs/js) <br>
[Julia](https://github.com/apache/arrow-julia/blob/main/README.md) <br>
Expand Down

0 comments on commit aee3078

Please sign in to comment.