Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-3601

in PR comments, switch from comments API to review-comments so we can update 'job started' to 'job done' messages

XMLWordPrintable

    • False
    • None
    • False

      Continuation of https://github.com/eclipse/che/issues/21795

      Enhancement: switch from comments to review-comments so we can update 'job started' to 'job done' messages.

      This will declutter the PRs and make it more obvious when a job has failed, because there will be no success badge.

      +   // switch from /issues/ISSUENUM/comments to /pulls/PULLNUM/reviews
      +   comments_url=comments_url.replace("/issues/([0-9]+)/comments","/pulls/\$1/reviews")
      
      # POST a comment on a PR using review API
      # get "id": 1191606906
      reviewID=$(curl   -H "Accept: application/vnd.github+json"   -H "Authorization: Bearer $GITHUB_TOKEN" -X POST https://api.github.com/repos/eclipse-che/che-machine-exec/pulls/231/reviews -d '{"body":"testing pr review message #foo","event":"COMMENT"}' | jq -r .id)
      
      reviewBody=$(curl   -H "Accept: application/vnd.github+json"   -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/eclipse-che/che-machine-exec/pulls/231/reviews/${reviewID} | jq -r '.body')
      
      # PUT an updated comment on a PR using review API
      curl   -H "Accept: application/vnd.github+json"   -H "Authorization: Bearer $GITHUB_TOKEN" -X  PUT https://api.github.com/repos/eclipse-che/che-machine-exec/pulls/231/reviews/${reviewID} -d '{"body":"'"${reviewBody}"'<br />updated message #foo"}'
      

              nickboldt Nick Boldt
              nickboldt Nick Boldt
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: