From commits-return-1050-archive-asf-public=cust-asf.ponee.io@yetus.apache.org Thu Feb 22 03:00:19 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 13FBB18061A for ; Thu, 22 Feb 2018 03:00:18 +0100 (CET) Received: (qmail 2145 invoked by uid 500); 22 Feb 2018 02:00:18 -0000 Mailing-List: contact commits-help@yetus.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@yetus.apache.org Delivered-To: mailing list commits@yetus.apache.org Received: (qmail 2136 invoked by uid 99); 22 Feb 2018 02:00:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Feb 2018 02:00:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4387CDFC3E; Thu, 22 Feb 2018 02:00:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aajisaka@apache.org To: commits@yetus.apache.org Message-Id: <7e6034fc2ba343ecabbc65297bbcc0da@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: yetus git commit: YETUS-614. github_jira_bridge is not working after the update of ASF JIRA Date: Thu, 22 Feb 2018 02:00:15 +0000 (UTC) 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 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 Authored: Sun Feb 18 22:42:22 2018 +0900 Committer: Akira Ajisaka 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