From f6865431d29d57a8638a0171ca115c05ecda22ef Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Jul 2026 12:44:58 -0700 Subject: [PATCH 1/4] Fix step --- dev/release/07-flightsqlodbc-upload.sh | 11 ++++-- dev/release/utils-watch-gh-workflow.sh | 48 ++++++++++++++++---------- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/dev/release/07-flightsqlodbc-upload.sh b/dev/release/07-flightsqlodbc-upload.sh index c823bc84ae5..df3d95ac94d 100755 --- a/dev/release/07-flightsqlodbc-upload.sh +++ b/dev/release/07-flightsqlodbc-upload.sh @@ -137,14 +137,19 @@ fi if [ "${PHASE_BUILD_MSI}" -gt 0 ]; then echo "[4/8] Triggering odbc_release_step in package_odbc.yml workflow..." - gh workflow run package_odbc.yml \ + workflow_url=$(gh workflow run package_odbc.yml \ --repo "${GITHUB_REPOSITORY}" \ --ref "${tag}" \ - --field odbc_release_step=true + --field odbc_release_step=true) + echo "${workflow_url}" + # Extract run ID from `gh workflow run` output. The output is structured like, + # https://github.com/apache/arrow/actions/runs/28679576610 and we just need + # the id. + run_id=$(echo "${workflow_url}" | grep -Eo 'actions/runs/[0-9]+' | grep -Eo '[0-9]+$' || true) echo "[5/8] Waiting for workflow to complete. This can take a very long time..." REPOSITORY="${GITHUB_REPOSITORY}" \ - "${SOURCE_DIR}/utils-watch-gh-workflow.sh" "${tag}" package_odbc.yml + "${SOURCE_DIR}/utils-watch-gh-workflow.sh" "${tag}" package_odbc.yml "${run_id}" fi if [ "${PHASE_SIGN_MSI}" -gt 0 ]; then diff --git a/dev/release/utils-watch-gh-workflow.sh b/dev/release/utils-watch-gh-workflow.sh index 163f30251fb..c08ce6f78de 100755 --- a/dev/release/utils-watch-gh-workflow.sh +++ b/dev/release/utils-watch-gh-workflow.sh @@ -21,33 +21,43 @@ set -e set -u set -o pipefail -if [ "$#" -ne 2 ]; then - echo "Usage: $0 " +if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then + echo "Usage: $0 [run-id]" exit 1 fi TAG=$1 WORKFLOW=$2 +RUN_ID="${3:-}" : "${REPOSITORY:=${GITHUB_REPOSITORY:-apache/arrow}}" -echo "Looking for GitHub Actions workflow on ${REPOSITORY}:${TAG}" -RUN_ID="" -while true; do - echo "Waiting for run to start..." - RUN_ID=$(gh run list \ - --branch "${TAG}" \ - --jq '.[].databaseId' \ - --json databaseId \ - --limit 1 \ - --repo "${REPOSITORY}" \ - --workflow "${WORKFLOW}") - if [ -n "${RUN_ID}" ]; then - break - fi - sleep 60 -done +if [ -z "${RUN_ID}" ]; then + echo "Looking for GitHub Actions workflow on ${REPOSITORY}:${TAG} (any ID)" +else + echo "Looking for GitHub Actions workflow on ${REPOSITORY}:${TAG} with run ID ${RUN_ID}" +fi +if [ -z "${RUN_ID}" ]; then + while true; do + echo "Waiting for run to start..." + RUN_ID=$(gh run list \ + --branch "${TAG}" \ + --jq '.[].databaseId' \ + --json databaseId \ + --limit 1 \ + --repo "${REPOSITORY}" \ + --status "in_progress" \ + --workflow "${WORKFLOW}") + if [ -n "${RUN_ID}" ]; then + break + fi + sleep 60 + done + echo "Found GitHub Actions workflow with ID: ${RUN_ID}" +else + echo "Using provided run ID: ${RUN_ID}. Sleeping for 10 seconds to let the job become available..." + sleep 10 +fi -echo "Found GitHub Actions workflow with ID: ${RUN_ID}" gh run watch \ --exit-status \ --interval 60 \ From 8b447a9d24c028c895b538eaf434319644bf3c3b Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Jul 2026 14:09:06 -0700 Subject: [PATCH 2/4] Remove filter of in_progress I guess runs can be queued too so we can capture that now with this fix. --- dev/release/utils-watch-gh-workflow.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/release/utils-watch-gh-workflow.sh b/dev/release/utils-watch-gh-workflow.sh index c08ce6f78de..b86286e7e2c 100755 --- a/dev/release/utils-watch-gh-workflow.sh +++ b/dev/release/utils-watch-gh-workflow.sh @@ -45,7 +45,6 @@ if [ -z "${RUN_ID}" ]; then --json databaseId \ --limit 1 \ --repo "${REPOSITORY}" \ - --status "in_progress" \ --workflow "${WORKFLOW}") if [ -n "${RUN_ID}" ]; then break From 2c9d7a1ef6bd6203173a34e258afc449d89e5343 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Jul 2026 14:20:26 -0700 Subject: [PATCH 3/4] catch empty run_id --- dev/release/07-flightsqlodbc-upload.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dev/release/07-flightsqlodbc-upload.sh b/dev/release/07-flightsqlodbc-upload.sh index df3d95ac94d..025449a0747 100755 --- a/dev/release/07-flightsqlodbc-upload.sh +++ b/dev/release/07-flightsqlodbc-upload.sh @@ -146,6 +146,12 @@ if [ "${PHASE_BUILD_MSI}" -gt 0 ]; then # https://github.com/apache/arrow/actions/runs/28679576610 and we just need # the id. run_id=$(echo "${workflow_url}" | grep -Eo 'actions/runs/[0-9]+' | grep -Eo '[0-9]+$' || true) + if [ -z "${run_id}" ]; then + echo "Failed to extract run ID from the above output. This is probably a" \ + "bug. If the workflow was started, you can watch it manually and" \ + "move onto the PHASE_SIGN_MSI step once it's done." + exit 1 + fi echo "[5/8] Waiting for workflow to complete. This can take a very long time..." REPOSITORY="${GITHUB_REPOSITORY}" \ From b89bab42dcb37c1801dbb1a6685e409357c260c8 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Fri, 3 Jul 2026 14:24:44 -0700 Subject: [PATCH 4/4] shfmt --- dev/release/07-flightsqlodbc-upload.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/release/07-flightsqlodbc-upload.sh b/dev/release/07-flightsqlodbc-upload.sh index 025449a0747..68d609e8823 100755 --- a/dev/release/07-flightsqlodbc-upload.sh +++ b/dev/release/07-flightsqlodbc-upload.sh @@ -148,8 +148,8 @@ if [ "${PHASE_BUILD_MSI}" -gt 0 ]; then run_id=$(echo "${workflow_url}" | grep -Eo 'actions/runs/[0-9]+' | grep -Eo '[0-9]+$' || true) if [ -z "${run_id}" ]; then echo "Failed to extract run ID from the above output. This is probably a" \ - "bug. If the workflow was started, you can watch it manually and" \ - "move onto the PHASE_SIGN_MSI step once it's done." + "bug. If the workflow was started, you can watch it manually and" \ + "move onto the PHASE_SIGN_MSI step once it's done." exit 1 fi