You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2025/07/24 06:11:25 UTC

[PR] GH-47075: [Release][Dev] Use GH_TOKEN as GitHub token environment variable [arrow]

kou opened a new pull request, #47181:
URL: https://github.com/apache/arrow/pull/47181

   ### Rationale for this change
   
   We have many environment variables for GitHub token: `GH_TOKEN`, `ARROW_GITHUB_API_TOKEN` and `CROSSBOW_GITHUB_TOKEN`
   
   It's difficult to maintain. For example, we may forget to define one of them. 
   
   ### What changes are included in this PR?
   
   Use `GH_TOKEN` as unified environment variable for GitHub token.
   
   We can still use `ARROW_GITHUB_API_TOKEN` and `CROSSBOW_GITHUB_TOKEN` for backward compatibility but `GH_TOKEN` is recommended.
   
   ### Are these changes tested?
   
   Yes.
   
   ### Are there any user-facing changes?
   
   No.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-47075: [Release][Dev] Use GH_TOKEN as GitHub token environment variable [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #47181:
URL: https://github.com/apache/arrow/pull/47181#issuecomment-3112149866

   :warning: GitHub issue #47075 **has been automatically assigned in GitHub** to PR creator.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-47075: [Release][Dev] Use GH_TOKEN as GitHub token environment variable [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #47181:
URL: https://github.com/apache/arrow/pull/47181#issuecomment-3130217718

   I'll merge this.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-47075: [Release][Dev] Use GH_TOKEN as GitHub token environment variable [arrow]

Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #47181:
URL: https://github.com/apache/arrow/pull/47181#issuecomment-3138755992

   After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit ea5dad5fb0ead086878addaaf8473cf623c41005.
   
   There weren't enough matching historic benchmark results to make a call on whether there were regressions.
   
   The [full Conbench report](https://github.com/apache/arrow/runs/47093911674) has more details.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-47075: [Release][Dev] Use GH_TOKEN as GitHub token environment variable [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #47181:
URL: https://github.com/apache/arrow/pull/47181#discussion_r2230092551


##########
dev/merge_arrow_pr.py:
##########
@@ -254,10 +255,13 @@ def __init__(self, project_name, cmd):
         config = load_configuration()
         if "github" in config.sections():
             token = config["github"]["api_token"]
+        if not token:
+            token = os.environ.get('GH_TOKEN')
         if not token:

Review Comment:
   Good point. I've added warning message.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-47075: [Release][Dev] Use GH_TOKEN as GitHub token environment variable [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #47181:
URL: https://github.com/apache/arrow/pull/47181


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-47075: [Release][Dev] Use GH_TOKEN as GitHub token environment variable [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on PR #47181:
URL: https://github.com/apache/arrow/pull/47181#issuecomment-3133114150

   Thanks for your work on this @kou.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-47075: [Release][Dev] Use GH_TOKEN as GitHub token environment variable [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #47181:
URL: https://github.com/apache/arrow/pull/47181#discussion_r2230072796


##########
dev/release/post-05-update-gh-release-notes.sh:
##########
@@ -20,21 +20,23 @@
 set -e
 set -o pipefail
 
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
 if [ "$#" -ne 1 ]; then
     echo "Usage: $0 <version>"
     exit 1
 fi
 
+. "${SOURCE_DIR}/utils-env.sh"
 
 VERSION=$1
 REPOSITORY="apache/arrow"
 TAG="apache-arrow-${VERSION}"
 WORKFLOW="release.yml"
-SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
 # Wait for the GitHub Workflow that creates the GitHub Release
 # to finish before updating the release notes.
-. $SOURCE_DIR/utils-watch-gh-workflow.sh ${TAG} ${WORKFLOW}
+$SOURCE_DIR/utils-watch-gh-workflow.sh ${TAG} ${WORKFLOW}

Review Comment:
   Good point. I've applied your suggestions.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-47075: [Release][Dev] Use GH_TOKEN as GitHub token environment variable [arrow]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #47181:
URL: https://github.com/apache/arrow/pull/47181#discussion_r2228928165


##########
dev/release/post-05-update-gh-release-notes.sh:
##########
@@ -20,21 +20,23 @@
 set -e
 set -o pipefail
 
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
 if [ "$#" -ne 1 ]; then
     echo "Usage: $0 <version>"
     exit 1
 fi
 
+. "${SOURCE_DIR}/utils-env.sh"
 
 VERSION=$1
 REPOSITORY="apache/arrow"
 TAG="apache-arrow-${VERSION}"
 WORKFLOW="release.yml"
-SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
 # Wait for the GitHub Workflow that creates the GitHub Release
 # to finish before updating the release notes.
-. $SOURCE_DIR/utils-watch-gh-workflow.sh ${TAG} ${WORKFLOW}
+$SOURCE_DIR/utils-watch-gh-workflow.sh ${TAG} ${WORKFLOW}

Review Comment:
   Can this benefit from quotes?
   
   ```suggestion
   "$SOURCE_DIR/utils-watch-gh-workflow.sh" "${TAG}" "${WORKFLOW}"
   ```



##########
dev/release/utils-env.sh:
##########
@@ -0,0 +1,29 @@
+# shellcheck shell=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.
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+if [ ! -f "${SOURCE_DIR}/.env" ]; then
+  echo "You must create ${SOURCE_DIR}/.env"
+  echo "You can use ${SOURCE_DIR}/.env.example as template"
+  exit 1
+fi
+# shellcheck source=SCRIPTDIR/.env.example
+. ${SOURCE_DIR}/.env

Review Comment:
   ```suggestion
   . "${SOURCE_DIR}/.env"
   ```



##########
dev/merge_arrow_pr.py:
##########
@@ -254,10 +255,13 @@ def __init__(self, project_name, cmd):
         config = load_configuration()
         if "github" in config.sections():
             token = config["github"]["api_token"]
+        if not token:
+            token = os.environ.get('GH_TOKEN')
         if not token:

Review Comment:
   Do we want to warn people they're still using `ARROW_GITHUB_API_TOKEN` to allow us to fully deprecate it at some point?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org