kou commented on code in PR #249:
URL: https://github.com/apache/arrow-go/pull/249#discussion_r1913959441


##########
dev/release/post-website.sh:
##########
@@ -0,0 +1,138 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -u
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ARROW_DIR="${SOURCE_DIR}/../../"
+: ${ARROW_SITE_DIR:="${ARROW_DIR}/../arrow-site"}
+
+if [ "$#" -ne 2 ]; then
+  echo "Usage: $0 <previous-version> <version>"
+  exit 1
+fi
+
+previous_version=$1
+version=$2
+
+branch_name=release-note-arrow-go-${version}
+release_dir="${ARROW_SITE_DIR}/_posts"
+announce_file="${release_dir}/$(date +%Y-%m-%d)-arrow-go-${version}.md"
+
+pushd "${ARROW_SITE_DIR}"
+DEFAULT_BRANCH="$(git rev-parse --abbrev-ref origin/HEAD | sed s@origin/@@)"
+git fetch --all --prune --tags --force -j$(nproc)
+git checkout ${DEFAULT_BRANCH}
+git branch -D ${branch_name} || :
+git checkout -b ${branch_name}
+popd
+
+pushd "${ARROW_DIR}"
+
+previous_major_version="$(echo v${previous_version} | grep -o '^[0-9]*')"
+major_version="$(echo v${version} | grep -o '^[0-9]*')"
+if [ ${previous_major_version} -eq ${major_version} ]; then
+  release_type=patch
+else
+  release_type=major
+fi
+
+export TZ=UTC
+release_date=$(LC_TIME=C date "+%-d %B %Y")
+release_date_iso8601=$(LC_TIME=C date "+%Y-%m-%d")
+previous_tag_date=$(git log -n 1 --pretty=%aI v${previous_version})
+rough_previous_release_date=$(date --date "${previous_tag_date}" +%s)
+rough_release_date=$(date +%s)
+rough_n_development_months=$(((\
+  ${rough_release_date} - ${rough_previous_release_date}) / (60 * 60 * 24 * 
30)))
+
+git_tag=v${version}
+git_range=v${previous_version}..v${version}
+
+contributors_command_line="git shortlog -sn ${git_range}"
+contributors=$(${contributors_command_line} | grep -v dependabot)
+
+n_commits=$(git log --pretty=oneline ${git_range} | grep -i -v "chore: Bump" | 
wc -l)
+n_contributors=$(${contributors_command_line} | grep -v dependabot | wc -l)
+
+git_tag_hash=$(git log -n 1 --pretty=%H ${git_tag})
+git_changelog="$(gh release view --json body --jq .body | grep -v 
'@dependabot')"
+popd
+
+pushd "${ARROW_SITE_DIR}"
+
+cat <<ANNOUNCE >>"${announce_file}"
+---
+layout: post
+title: "Apache Arrow Go ${version} Release"
+date: "${release_date_iso8601} 00:00:00"
+author: pmc
+categories: [release]
+---
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+-->
+
+The Apache Arrow team is pleased to announce the v${version} release ofApache 
Arrow Go. 

Review Comment:
   ```suggestion
   The Apache Arrow team is pleased to announce the v${version} release of 
Apache Arrow Go. 
   ```



##########
dev/release/release.sh:
##########
@@ -57,7 +57,7 @@ gh release download "${rc_tag}" \
 
 echo "Uploading to release/"
 pushd "${dist_base_dir}"
-svn add .
+svn add "${release_id}"

Review Comment:
   Oh. I thought that "." also works.
   Do you still have an actual error message?



##########
dev/release/post-website.sh:
##########
@@ -0,0 +1,138 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -u
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ARROW_DIR="${SOURCE_DIR}/../../"
+: ${ARROW_SITE_DIR:="${ARROW_DIR}/../arrow-site"}
+
+if [ "$#" -ne 2 ]; then
+  echo "Usage: $0 <previous-version> <version>"
+  exit 1
+fi
+
+previous_version=$1
+version=$2
+
+branch_name=release-note-arrow-go-${version}
+release_dir="${ARROW_SITE_DIR}/_posts"
+announce_file="${release_dir}/$(date +%Y-%m-%d)-arrow-go-${version}.md"
+
+pushd "${ARROW_SITE_DIR}"
+DEFAULT_BRANCH="$(git rev-parse --abbrev-ref origin/HEAD | sed s@origin/@@)"
+git fetch --all --prune --tags --force -j$(nproc)
+git checkout ${DEFAULT_BRANCH}
+git branch -D ${branch_name} || :
+git checkout -b ${branch_name}
+popd
+
+pushd "${ARROW_DIR}"
+
+previous_major_version="$(echo v${previous_version} | grep -o '^[0-9]*')"
+major_version="$(echo v${version} | grep -o '^[0-9]*')"
+if [ ${previous_major_version} -eq ${major_version} ]; then
+  release_type=patch
+else
+  release_type=major
+fi
+
+export TZ=UTC
+release_date=$(LC_TIME=C date "+%-d %B %Y")
+release_date_iso8601=$(LC_TIME=C date "+%Y-%m-%d")
+previous_tag_date=$(git log -n 1 --pretty=%aI v${previous_version})
+rough_previous_release_date=$(date --date "${previous_tag_date}" +%s)
+rough_release_date=$(date +%s)
+rough_n_development_months=$(((\
+  ${rough_release_date} - ${rough_previous_release_date}) / (60 * 60 * 24 * 
30)))
+
+git_tag=v${version}
+git_range=v${previous_version}..v${version}
+
+contributors_command_line="git shortlog -sn ${git_range}"
+contributors=$(${contributors_command_line} | grep -v dependabot)
+
+n_commits=$(git log --pretty=oneline ${git_range} | grep -i -v "chore: Bump" | 
wc -l)
+n_contributors=$(${contributors_command_line} | grep -v dependabot | wc -l)
+
+git_tag_hash=$(git log -n 1 --pretty=%H ${git_tag})
+git_changelog="$(gh release view --json body --jq .body | grep -v 
'@dependabot')"

Review Comment:
   Could you replace `##` section markup to `###` because we use `## Changelog` 
section?
   
   ```suggestion
   git_changelog="$(gh release view --json body --jq .body | grep -v 
'@dependabot' | sed -e 's/^#/##/g')"
   ```



##########
dev/release/post-website.sh:
##########
@@ -0,0 +1,138 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -u
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ARROW_DIR="${SOURCE_DIR}/../../"
+: ${ARROW_SITE_DIR:="${ARROW_DIR}/../arrow-site"}
+
+if [ "$#" -ne 2 ]; then
+  echo "Usage: $0 <previous-version> <version>"
+  exit 1
+fi
+
+previous_version=$1
+version=$2
+
+branch_name=release-note-arrow-go-${version}
+release_dir="${ARROW_SITE_DIR}/_posts"
+announce_file="${release_dir}/$(date +%Y-%m-%d)-arrow-go-${version}.md"
+
+pushd "${ARROW_SITE_DIR}"
+DEFAULT_BRANCH="$(git rev-parse --abbrev-ref origin/HEAD | sed s@origin/@@)"
+git fetch --all --prune --tags --force -j$(nproc)
+git checkout ${DEFAULT_BRANCH}
+git branch -D ${branch_name} || :
+git checkout -b ${branch_name}

Review Comment:
   ```suggestion
   git switch -c ${branch_name}
   ```



##########
dev/release/post-website.sh:
##########
@@ -0,0 +1,138 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -u
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ARROW_DIR="${SOURCE_DIR}/../../"
+: ${ARROW_SITE_DIR:="${ARROW_DIR}/../arrow-site"}
+
+if [ "$#" -ne 2 ]; then
+  echo "Usage: $0 <previous-version> <version>"
+  exit 1
+fi
+
+previous_version=$1
+version=$2
+
+branch_name=release-note-arrow-go-${version}
+release_dir="${ARROW_SITE_DIR}/_posts"
+announce_file="${release_dir}/$(date +%Y-%m-%d)-arrow-go-${version}.md"
+
+pushd "${ARROW_SITE_DIR}"
+DEFAULT_BRANCH="$(git rev-parse --abbrev-ref origin/HEAD | sed s@origin/@@)"
+git fetch --all --prune --tags --force -j$(nproc)

Review Comment:
   Could you add a check whether this working copy is a fork not 
apache/arrow-site?



##########
dev/release/post-website.sh:
##########
@@ -0,0 +1,138 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -u
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ARROW_DIR="${SOURCE_DIR}/../../"
+: ${ARROW_SITE_DIR:="${ARROW_DIR}/../arrow-site"}
+
+if [ "$#" -ne 2 ]; then
+  echo "Usage: $0 <previous-version> <version>"
+  exit 1
+fi
+
+previous_version=$1
+version=$2
+
+branch_name=release-note-arrow-go-${version}
+release_dir="${ARROW_SITE_DIR}/_posts"
+announce_file="${release_dir}/$(date +%Y-%m-%d)-arrow-go-${version}.md"
+
+pushd "${ARROW_SITE_DIR}"
+DEFAULT_BRANCH="$(git rev-parse --abbrev-ref origin/HEAD | sed s@origin/@@)"
+git fetch --all --prune --tags --force -j$(nproc)
+git checkout ${DEFAULT_BRANCH}
+git branch -D ${branch_name} || :
+git checkout -b ${branch_name}
+popd
+
+pushd "${ARROW_DIR}"
+
+previous_major_version="$(echo v${previous_version} | grep -o '^[0-9]*')"
+major_version="$(echo v${version} | grep -o '^[0-9]*')"
+if [ ${previous_major_version} -eq ${major_version} ]; then
+  release_type=patch
+else
+  release_type=major
+fi

Review Comment:
   Can we add "minor" release detection?



##########
dev/release/post-website.sh:
##########
@@ -0,0 +1,138 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -u
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ARROW_DIR="${SOURCE_DIR}/../../"
+: ${ARROW_SITE_DIR:="${ARROW_DIR}/../arrow-site"}
+
+if [ "$#" -ne 2 ]; then
+  echo "Usage: $0 <previous-version> <version>"
+  exit 1
+fi
+
+previous_version=$1
+version=$2
+
+branch_name=release-note-arrow-go-${version}
+release_dir="${ARROW_SITE_DIR}/_posts"
+announce_file="${release_dir}/$(date +%Y-%m-%d)-arrow-go-${version}.md"
+
+pushd "${ARROW_SITE_DIR}"
+DEFAULT_BRANCH="$(git rev-parse --abbrev-ref origin/HEAD | sed s@origin/@@)"
+git fetch --all --prune --tags --force -j$(nproc)
+git checkout ${DEFAULT_BRANCH}
+git branch -D ${branch_name} || :
+git checkout -b ${branch_name}
+popd
+
+pushd "${ARROW_DIR}"
+
+previous_major_version="$(echo v${previous_version} | grep -o '^[0-9]*')"
+major_version="$(echo v${version} | grep -o '^[0-9]*')"

Review Comment:
   ```suggestion
   previous_major_version="$(echo ${previous_version} | grep -o '^[0-9]*')"
   major_version="$(echo ${version} | grep -o '^[0-9]*')"
   ```
   
   BTW, `cut` may be better:
   
   ```shell
   previous_major_version="$(echo ${previous_version} | cut -d. -f1)"
   major_version="$(echo ${version} | cut -d. -f1)"
   ```



##########
dev/release/post-website.sh:
##########
@@ -0,0 +1,138 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -u
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ARROW_DIR="${SOURCE_DIR}/../../"
+: ${ARROW_SITE_DIR:="${ARROW_DIR}/../arrow-site"}
+
+if [ "$#" -ne 2 ]; then
+  echo "Usage: $0 <previous-version> <version>"
+  exit 1
+fi
+
+previous_version=$1
+version=$2
+
+branch_name=release-note-arrow-go-${version}
+release_dir="${ARROW_SITE_DIR}/_posts"
+announce_file="${release_dir}/$(date +%Y-%m-%d)-arrow-go-${version}.md"
+
+pushd "${ARROW_SITE_DIR}"
+DEFAULT_BRANCH="$(git rev-parse --abbrev-ref origin/HEAD | sed s@origin/@@)"
+git fetch --all --prune --tags --force -j$(nproc)
+git checkout ${DEFAULT_BRANCH}

Review Comment:
   `switch` is better with recent Git:
   
   ```suggestion
   git switch ${DEFAULT_BRANCH}
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to