hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject hadoop git commit: HADOOP-12336. github_jira_bridge doesn't work (Kengo Seki)
Date Thu, 03 Sep 2015 01:07:38 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-12111 b006c9a7b -> 174900da1


HADOOP-12336. github_jira_bridge doesn't work (Kengo Seki)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/174900da
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/174900da
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/174900da

Branch: refs/heads/HADOOP-12111
Commit: 174900da15e57f4521303381d3817e5f1e4f5df8
Parents: b006c9a
Author: Allen Wittenauer <aw@apache.org>
Authored: Wed Sep 2 18:06:10 2015 -0700
Committer: Allen Wittenauer <aw@apache.org>
Committed: Wed Sep 2 18:06:10 2015 -0700

----------------------------------------------------------------------
 dev-support/test-patch.d/github.sh | 7 ++-----
 dev-support/test-patch.d/jira.sh   | 8 +++++++-
 2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/174900da/dev-support/test-patch.d/github.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.d/github.sh b/dev-support/test-patch.d/github.sh
index 36c7e51..f742062 100755
--- a/dev-support/test-patch.d/github.sh
+++ b/dev-support/test-patch.d/github.sh
@@ -89,12 +89,9 @@ function github_jira_bridge
   # we use this to prevent loops later on
   GITHUB_BRIDGED=true
 
-  # the JIRA issue has already been downloaded.  So let's
-  # find the URL.  This is currently hard-coded to github.com
-  # Sorry Github Enterprise users. :(
-
+  # the JIRA issue has already been downloaded. So let's find the URL.
   # shellcheck disable=SC2016
-  urlfromjira=$(${AWK} 'match($0,"https://github.com/.*patch"){print $1}' "${PATCH_DIR}/jira"
| tail -1)
+  urlfromjira=$(${AWK} "match(\$0,\"${GITHUB_BASE_URL}/[^ ]*patch\"){print substr(\$0,RSTART,RLENGTH)}"
"${PATCH_DIR}/jira" | tail -1)
   github_breakup_url "${urlfromjira}"
   github_locate_patch "${GITHUB_ISSUE}" "${fileloc}"
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/174900da/dev-support/test-patch.d/jira.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.d/jira.sh b/dev-support/test-patch.d/jira.sh
index ca9f2bd..fc649e7 100755
--- a/dev-support/test-patch.d/jira.sh
+++ b/dev-support/test-patch.d/jira.sh
@@ -64,15 +64,20 @@ function jira_determine_issue
   declare patchnamechunk
   declare maybeissue
 
+  if [[ -n ${JIRA_ISSUE} ]]; then
+    return 0
+  fi
+
   # shellcheck disable=SC2016
   patchnamechunk=$(echo "${input}" | ${AWK} -F/ '{print $NF}')
 
   maybeissue=$(echo "${patchnamechunk}" | cut -f1,2 -d-)
 
   if [[ ${maybeissue} =~ ${JIRA_ISSUE_RE} ]]; then
+    # shellcheck disable=SC2034
     ISSUE=${maybeissue}
     JIRA_ISSUE=${maybeissue}
-    add_footer_table "JIRA Issue" "${ISSUE}"
+    add_footer_table "JIRA Issue" "${JIRA_ISSUE}"
     return 0
   fi
 
@@ -123,6 +128,7 @@ function jira_locate_patch
   # send this to the github plugin to process.
   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 $?


Mime
View raw message