From f534d828e950f8d1312c61e4d1dbd5f82fa92630 Mon Sep 17 00:00:00 2001
From: Andrew Purtell <apurtell@apache.org>
Date: Fri, 16 Jun 2023 08:11:47 -0700
Subject: [PATCH] HBASE-27894 create-release is broken by recent gitbox changes
 (#5262)

Use the github webui to retrieve the project pom from the build branch
instead of gitbox.

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Xiaolin Ha <haxiaolin@apache.org>
---
 dev-support/create-release/release-util.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/dev-support/create-release/release-util.sh b/dev-support/create-release/release-util.sh
index 787ec4dac181..3a1b38644f85 100755
--- a/dev-support/create-release/release-util.sh
+++ b/dev-support/create-release/release-util.sh
@@ -146,12 +146,12 @@ function get_release_info {
   if [[ -z "${ASF_REPO}" ]]; then
     ASF_REPO="https://gitbox.apache.org/repos/asf/${PROJECT}.git"
   fi
-  if [[ -z "${ASF_REPO_WEBUI}" ]]; then
-    ASF_REPO_WEBUI="https://gitbox.apache.org/repos/asf?p=${PROJECT}.git"
-  fi
   if [[ -z "${ASF_GITHUB_REPO}" ]]; then
     ASF_GITHUB_REPO="https://github.com/apache/${PROJECT}"
   fi
+  if [[ -z "${ASF_GITHUB_WEBUI}" ]] ; then
+    ASF_GITHUB_WEBUI="https://raw.githubusercontent.com/apache/${PROJECT}"
+  fi
   if [ -z "$GIT_BRANCH" ]; then
     # If no branch is specified, find out the latest branch from the repo.
     GIT_BRANCH="$(git ls-remote --heads "$ASF_REPO" |
@@ -167,14 +167,14 @@ function get_release_info {
 
   # Find the current version for the branch.
   local version
-  version="$(curl -s "$ASF_REPO_WEBUI;a=blob_plain;f=pom.xml;hb=refs/heads/$GIT_BRANCH" |
+  version="$(curl -s "$ASF_GITHUB_WEBUI/refs/heads/$GIT_BRANCH/pom.xml" |
     parse_version)"
   # We do not want to expand ${revision} here, see https://maven.apache.org/maven-ci-friendly.html
   # If we use ${revision} as placeholder, we need to parse the revision property to
   # get maven version
   # shellcheck disable=SC2016
   if [[ "${version}" == '${revision}' ]]; then
-    version="$(curl -s "$ASF_REPO_WEBUI;a=blob_plain;f=pom.xml;hb=refs/heads/$GIT_BRANCH" |
+    version="$(curl -s "$ASF_GITHUB_WEBUI/refs/heads/$GIT_BRANCH/pom.xml" |
       parse_revision)"
   fi
   log "Current branch VERSION is $version."