Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9D1A6200B6F for ; Wed, 24 Aug 2016 17:55:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9B970160AB1; Wed, 24 Aug 2016 15:55:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E3C68160A91 for ; Wed, 24 Aug 2016 17:55:44 +0200 (CEST) Received: (qmail 44811 invoked by uid 500); 24 Aug 2016 15:55:44 -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 44802 invoked by uid 99); 24 Aug 2016 15:55:44 -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; Wed, 24 Aug 2016 15:55:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0120FE0159; Wed, 24 Aug 2016 15:55:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aw@apache.org To: commits@yetus.apache.org Message-Id: <71745ea06aed4896adbe616820b4f726@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: yetus git commit: YETUS-442. JIRA plugin will not fallback to normal patch if it fails to find a github pull Date: Wed, 24 Aug 2016 15:55:43 +0000 (UTC) archived-at: Wed, 24 Aug 2016 15:55:45 -0000 Repository: yetus Updated Branches: refs/heads/master 0c2f54ade -> d73c0e17c YETUS-442. JIRA plugin will not fallback to normal patch if it fails to find a github pull 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/d73c0e17 Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/d73c0e17 Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/d73c0e17 Branch: refs/heads/master Commit: d73c0e17ce8fd9e773c8a5b69536de41eeea7bba Parents: 0c2f54a Author: Casey J. Brotherton Authored: Sat Aug 20 23:24:53 2016 -0500 Committer: Allen Wittenauer Committed: Wed Aug 24 08:55:34 2016 -0700 ---------------------------------------------------------------------- precommit/test-patch.d/github.sh | 1 + precommit/test-patch.d/jira.sh | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/d73c0e17/precommit/test-patch.d/github.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/github.sh b/precommit/test-patch.d/github.sh index b4f5aa0..e4b1163 100755 --- a/precommit/test-patch.d/github.sh +++ b/precommit/test-patch.d/github.sh @@ -91,6 +91,7 @@ function github_jira_bridge # the JIRA issue has already been downloaded. So let's find the URL. # shellcheck disable=SC2016 urlfromjira=$(${AWK} "match(\$0,\"${GITHUB_BASE_URL}/[^ ]*patch\"){print substr(\$0,RSTART,RLENGTH)}" "${PATCH_DIR}/jira" | tail -1) + yetus_debug "github_jira_bridge: Checking url ${urlfromjira}" github_breakup_url "${urlfromjira}" github_locate_patch "${GITHUB_ISSUE}" "${fileloc}" } http://git-wip-us.apache.org/repos/asf/yetus/blob/d73c0e17/precommit/test-patch.d/jira.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/jira.sh b/precommit/test-patch.d/jira.sh index 7da9280..37024e8 100755 --- a/precommit/test-patch.d/jira.sh +++ b/precommit/test-patch.d/jira.sh @@ -133,14 +133,21 @@ function jira_locate_patch fi # if github is configured and we see what looks like a URL, - # send this to the github plugin to process. + # check the github plugin to see if the URL is a patch or pull request + # before continuing further if [[ -n "${GITHUB_BASE_URL}" && $(${GREP} -c "${GITHUB_BASE_URL}"'[^ ]*patch' "${PATCH_DIR}/jira") != 0 ]]; then jira_determine_issue "${input}" - echo "${input} appears to be a Github PR. Switching Modes." github_jira_bridge "${fileloc}" - return $? - elif [[ $(${GREP} -c "${JIRA_STATUS_RE}" "${PATCH_DIR}/jira") == 0 ]]; then + if [[ $? -eq 0 ]]; then + echo "${input} appears to be a Github PR. Switching Modes." + return 0 + fi + yetus_debug "jira_locate_patch: ${input} seemed like a Github PR, but there was a failure." + fi + + # Not reached if there is a successful github plugin return + if [[ $(${GREP} -c "${JIRA_STATUS_RE}" "${PATCH_DIR}/jira") == 0 ]]; then if [[ ${ROBOT} == true ]]; then yetus_error "ERROR: ${input} issue status is not matched with \"${JIRA_STATUS_RE}\"." cleanup_and_exit 1