You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@yetus.apache.org by aa...@apache.org on 2018/02/22 02:00:15 UTC
yetus git commit: YETUS-614. github_jira_bridge is not working after
the update of ASF JIRA
Repository: yetus
Updated Branches:
refs/heads/master cf2ce0fff -> cdb41916c
YETUS-614. github_jira_bridge is not working after the update of ASF JIRA
Signed-off-by: Allen Wittenauer <aw...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/cdb41916
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/cdb41916
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/cdb41916
Branch: refs/heads/master
Commit: cdb41916c6571121b14a7cbd9b76914c0acb29d4
Parents: cf2ce0f
Author: Akira Ajisaka <aa...@apache.org>
Authored: Sun Feb 18 22:42:22 2018 +0900
Committer: Akira Ajisaka <aa...@apache.org>
Committed: Thu Feb 22 10:57:31 2018 +0900
----------------------------------------------------------------------
precommit/test-patch.d/github.sh | 5 ++---
precommit/test-patch.d/jira.sh | 8 +++++++-
2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/yetus/blob/cdb41916/precommit/test-patch.d/github.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/github.sh b/precommit/test-patch.d/github.sh
index f2c2d10..c84fcca 100755
--- a/precommit/test-patch.d/github.sh
+++ b/precommit/test-patch.d/github.sh
@@ -99,13 +99,12 @@ function github_parse_args
function github_jira_bridge
{
declare fileloc=$1
+ declare jsonloc=$2
declare urlfromjira
- # the JIRA issue has already been downloaded. So let's find the URL.
# shellcheck disable=SC2016
-
urlfromjira=$(${AWK} "match(\$0,\"${GITHUB_BASE_URL}/[^ ]*patch[ &\\\"]\"){url=substr(\$0,RSTART,RLENGTH-1)}
- END{if (url) print url}" "${PATCH_DIR}/jira" )
+ END{if (url) print url}" "${jsonloc}" )
if [[ -z $urlfromjira ]]; then
# This is currently the expected path, as github pull requests are not common
return 1
http://git-wip-us.apache.org/repos/asf/yetus/blob/cdb41916/precommit/test-patch.d/jira.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/jira.sh b/precommit/test-patch.d/jira.sh
index e107cb5..f68c5f5 100755
--- a/precommit/test-patch.d/jira.sh
+++ b/precommit/test-patch.d/jira.sh
@@ -153,6 +153,7 @@ function jira_locate_patch
{
declare input=$1
declare fileloc=$2
+ declare jsonloc
declare relativeurl
declare retval
declare found=false
@@ -174,7 +175,12 @@ function jira_locate_patch
# that is a github patch file or pull request
if [[ -n "${GITHUB_BASE_URL}" ]]; then
jira_determine_issue "${input}"
- github_jira_bridge "${fileloc}"
+ # Download information via REST API
+ jsonloc="${PATCH_DIR}/jira-json"
+ jira_http_fetch "rest/api/2/issue/${input}" "${jsonloc}"
+ # Parse the downloaded information to check if the issue is
+ # just a pointer to GitHub.
+ github_jira_bridge "${fileloc}" "${jsonloc}"
if [[ $? -eq 0 ]]; then
echo "${input} appears to be a Github PR. Switching Modes."
return 0