jsjolen / smallest-java-ci

CI that we made for edu. purposes.
0 stars 0 forks source link

MAIN FEATURES (P1, P2, P3): Compile and test on PullRequestEvent #5

Open jsjolen opened 5 years ago

jsjolen commented 5 years ago

Many sub-issues can be created from this feature, please create such sub-issues and reference this main issue. This is meant to be a more formalized version of the features described in the assignment.

We should utilize the X-GitHub-Event parameter to dispatch on the type of event the webhook will handle.

This feature represents our support for the pull_request event type.

When such an event is received the server should:

  1. Parse the JSON body
  2. Check if the action == "opened"
  3. If so pull out the merge_commit_sha SHA
  4. Do a git checkout of the hash

4a. Do a gradle compileJava of the checked out hash 5a. Save results of build to disk 6a. Post comment of results to the pull request page.

4b. Do a gradle test of the checked out hash 5b. Save results of build to disk 6b. Post comment of results to the pull request page.

References: https://developer.github.com/v3/activity/events/types/#pullrequestevent https://developer.github.com/webhooks/ https://developer.github.com/v3/issues/comments/#create-a-comment