-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PullRequestResource functionality for updating labels and comments.
Missing from this change: * Statuses, since this might involve more discussion on the set of statuses that we want to support. * Updating from changes to the raw payloads. Unclear how we want to handle these at the moment. Punting on this for now. First step for supporting #778. Co-authored-by: Dan Lorenc <[email protected]> Co-authored-by: Billy Lynch <[email protected]>
- Loading branch information
Showing
14 changed files
with
6,098 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# pullrequest-init | ||
|
||
pullrequest-init fetches pull request data from the given URL and places it in | ||
the provided path. | ||
|
||
This binary outputs a generic pull request object into `pr.json`, as well as | ||
provider specific payloads. | ||
|
||
Currently supported providers: | ||
|
||
* GitHub | ||
|
||
## Generic pull request payload | ||
|
||
The payload generated by default aims to abstract the base features of any | ||
pull request provider. Since there is no one true spec for pull requests, not | ||
every feature may be available. The payload is output to `$PATH/pr.json` and | ||
looks like: | ||
|
||
```json | ||
{ | ||
"Type": "github", | ||
"ID": 188184279, | ||
"Head": { | ||
"Repo": "https://github.com/wlynch/test.git", | ||
"Branch": "dev", | ||
"SHA": "9bcde245572c74329827acdcab88792ebb84d578" | ||
}, | ||
"Base": { | ||
"Repo": "https://github.com/wlynch/test.git", | ||
"Branch": "master", | ||
"SHA": "1e80c83ed01e187669b836096335d1c8a2c57182" | ||
}, | ||
"Comments": [ | ||
{ | ||
"Text": "test comment", | ||
"Author": "wlynch", | ||
"ID": 494418247, | ||
"Raw": "/tmp/prtest/github/comments/494418247.json" | ||
} | ||
], | ||
"Labels": [ | ||
{ | ||
"Text": "my-label" | ||
} | ||
], | ||
"Raw": "/tmp/prtest/github/pr.json" | ||
} | ||
``` | ||
|
||
## GitHub | ||
|
||
GitHub pull requests will output these additional files: | ||
|
||
* `$PATH/github/pr.json`: The raw GitHub payload as specified by | ||
https://developer.github.com/v3/pulls/#get-a-single-pull-request | ||
* `$PATH/github/comments/#.json`: Comments associated to the PR as specified by | ||
https://developer.github.com/v3/issues/comments/#get-a-single-comment |
Oops, something went wrong.