| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| | PullRequestUnassigned | ||
| | PullRequestLabeled | ||
| | PullRequestUnlabeled | ||
| | PullRequestReviewRequested |
There was a problem hiding this comment.
added these because the API docs list them.
Not sure if it makes sense to make a catch-all OtherPullRequestEventType Text which might make the library a little more future-proof.
Sorry, something went wrong.
|
Not sure why the PR builder is unable to find fixtures/pull-request.json; it's in the same directory as other fixtures and it worked locally |
Sorry, something went wrong.
There was a problem hiding this comment.
Please, use real world response as fixture (the more recent, the better!)
Sorry, something went wrong.
| <*> o .: "html_url" | ||
| <*> o .: "updated_at" | ||
| <*> o .:? "body" | ||
| <*> o .: "assignees" |
There was a problem hiding this comment.
I'm 100% sure that API returns a list, and GitHub docs are wrong. You can have multiple assignees for PR/Issue.
Sorry, something went wrong.
There was a problem hiding this comment.
Check: https://api.github.com/repos/phadej/github/pulls/285, there are both keys "assignee" and "assignees"
Sorry, something went wrong.
|
What do you mean by using the real world response as a fixture? |
Sorry, something went wrong.
|
@adnelson e.g. the current version of result for that the PR in your fixture https://api.github.com/repos/baxterthehacker/public-repo/pulls/1 has assignees list. Real-world: don't copy old fixtures from somewhere, grab new ones from the API. |
Sorry, something went wrong.
|
@phadej I think the problem was that I was confusing the PullRequest and PullRequestEvent types. I'll add fixtures for each case and test them separately |
Sorry, something went wrong.
|
Alright, so I added three more fixtures, one that I had of the pull request event, and the two that you had given for pull requests, making four test cases in total. I added some logic which allows either the assignee or assignees keys, or both, to be present in a pull request blob. |
Sorry, something went wrong.
| , pullRequestCommits :: !Count | ||
| , pullRequestMerged :: !Bool | ||
| , pullRequestMergeable :: !(Maybe Bool) | ||
| , pullRequestMergeableState :: !MergeableState |
There was a problem hiding this comment.
why this is removed? (and review comments?)
Sorry, something went wrong.
There was a problem hiding this comment.
ah sorry, that was due to my confusion between pull request / pull request event. I'll put it back in
Sorry, something went wrong.
|
|
||
| -- | Helper function, reads either the "assignee" OR "assigneed" OR | ||
| -- both from a JSON object. | ||
| getAssignees :: Object -> Parser (Vector SimpleUser) |
There was a problem hiding this comment.
I'd trust there's always assignees, if there and endpoint which doesn't return plural assignees?
Sorry, something went wrong.
There was a problem hiding this comment.
this example has an assignee key but no assignees keys.
Sorry, something went wrong.
There was a problem hiding this comment.
But its current variant https://api.github.com/repos/octocat/Hello-World/pulls does have assignees. GitHub documentation is outdated, because examples are manually written.
Sorry, something went wrong.
There was a problem hiding this comment.
Is there a downside to including both? If we include both then it will work either way. You yourself earlier posted an example which contained both keys (as does the one in that link). I'm fine removing it but this seems like the way to accommodate all configurations which are likely to appear.
Sorry, something went wrong.
There was a problem hiding this comment.
@phadej if it's a dealbreaker for getting this merged then I can remove the assignee part
Sorry, something went wrong.
|
@adnelson : New maintainer here. |
Sorry, something went wrong.
There was a problem hiding this comment.
Please resolve conflicts.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
I'm not positive this covers every variant of a pull request event, but prior to this change the FromJSON instance failed to decode the example json (which is where the JSON I included here comes from) in the API docs, and now it does.