Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1816#discussion_r15977620
  
    --- Diff: dev/run-tests-jenkins ---
    @@ -24,62 +24,110 @@
     FWDIR="$(cd `dirname $0`/..; pwd)"
     cd "$FWDIR"
     
    +function get_jq () {
    +  # Get jq so we can parse some JSON, man.
    +  # Essential if we want to do anything with the GitHub API responses.
    +  local 
JQ_EXECUTABLE_URL="http://stedolan.github.io/jq/download/linux64/jq";
    +
    +  echo "Fetching jq from ${JQ_EXECUTABLE_URL}"
    +  curl --silent --output "$FWDIR/dev/jq" "$JQ_EXECUTABLE_URL"
    +  local curl_status=$?
    +
    +  if [ $curl_status -ne 0 ]; then
    +      echo "Failed to get jq." >&2
    +      return $curl_status
    +  fi
    +
    +  chmod u+x "$FWDIR/dev/jq"
    +}
    +
     
COMMENTS_URL="https://api.github.com/repos/apache/spark/issues/$ghprbPullId/comments";
     
    -function post_message {
    -  message=$1
    -  data="{\"body\": \"$message\"}"
    +function post_message () {
    +  local message=$1
    +  local data="{\"body\": \"$message\"}"
       echo "Attempting to post to Github:"
       echo "$data"
    -
    -  curl -D- -u x-oauth-basic:$GITHUB_OAUTH_KEY -X POST --data "$data" -H \
    -    "Content-Type: application/json" \
    -    $COMMENTS_URL | head -n 8
    +  
    +  # comment_id=$(
    +  curl `#--dump-header -` \
    +    --silent \
    +    --user x-oauth-basic:$GITHUB_OAUTH_KEY \
    +    --request POST \
    +    --data-urlencode ="$data" `# for make benefit @, &, and other 
annoyances` \
    +    --write-out "HTTP Response: %{http_code}" \
    +    --header "Content-Type: application/json" \
    +    "$COMMENTS_URL" #> /dev/null #| "$FWDIR/dev/jq" .id #| head -n 8
    +  # )
    +  local curl_status=${PIPESTATUS[0]}
    --- End diff --
    
    Is it necessary to do this tracking of the return status? In cases where 
we've seen failures here curl has printed a very clear failure message, so it's 
pretty obvious. Also, this will cause the build to fail in Jenkins if the curl 
can't happen, I'm not sure that's a great idea - it might be better to have it 
show as green in jenkins if the tests pass, even if the curl fails.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to