Repository: tez
Updated Branches:
  refs/heads/master a030800d9 -> 9b3f8c73d


TEZ-3913. Precommit build fails to post to JIRA (Jason Lowe via jeagles)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/9b3f8c73
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/9b3f8c73
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/9b3f8c73

Branch: refs/heads/master
Commit: 9b3f8c73d4268bfa04c2a1dc5cd5c027af888a06
Parents: a030800
Author: Jonathan Eagles <jeag...@yahoo-inc.com>
Authored: Mon Apr 9 14:44:11 2018 -0500
Committer: Jonathan Eagles <jeag...@yahoo-inc.com>
Committed: Mon Apr 9 14:44:11 2018 -0500

----------------------------------------------------------------------
 build-tools/test-patch.sh | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/9b3f8c73/build-tools/test-patch.sh
----------------------------------------------------------------------
diff --git a/build-tools/test-patch.sh b/build-tools/test-patch.sh
index e1fa0fb..7a19e2e 100755
--- a/build-tools/test-patch.sh
+++ b/build-tools/test-patch.sh
@@ -38,6 +38,7 @@ GREP=${GREP:-grep}
 PATCH=${PATCH:-patch}
 DIFF=${DIFF:-diff}
 JIRACLI=${JIRA:-jira}
+CURL=${CURL:-curl}
 FINDBUGS_HOME=${FINDBUGS_HOME}
 
 ###############################################################################
@@ -702,10 +703,24 @@ $comment"
     echo 
"======================================================================"
     echo ""
     echo ""
+
+    # RESTify the comment
+    jsoncomment=$(echo "$comment" \
+      | ${SED} -e 's,\\,\\\\,g' \
+        -e 's,\",\\\",g' \
+        -e 's,$,\\r\\n,g' \
+      | tr -d '\n')
+    jsoncomment='{"body":"'"$jsoncomment"'"}'
+
     ### Update Jira with a comment
-    export USER=hudson
-    $JIRACLI -s https://issues.apache.org/jira -a addcomment -u tezqa -p 
$JIRA_PASSWD --comment "$comment" --issue $defect
-    $JIRACLI -s https://issues.apache.org/jira -a logout -u tezqa -p 
$JIRA_PASSWD
+    ${CURL} -X POST \
+      -H "Accept: application/json" \
+      -H "Content-Type: application/json" \
+      -u "tezqa:${JIRA_PASSWD}" \
+      -d "$jsoncomment" \
+      --silent --location \
+      "https://issues.apache.org/jira/rest/api/2/issue/${defect}/comment"; \
+      >/dev/null
   fi
 }
 

Reply via email to