Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PullRequest Reviews may not have submitted_at field #450

Closed
wants to merge 2 commits into from

Conversation

ssanj
Copy link
Contributor

@ssanj ssanj commented Aug 2, 2020

The submitted_at field in the PullRequest Review is currently decoded as mandatory:

instance FromJSON Review where
    parseJSON =
        withObject "Review" $ \o ->
            Review <$> o .: "body" <*> o .: "commit_id" <*> o .: "state" <*>
            o .: "submitted_at" <*>
            o .: "pull_request_url" <*>
            o .: "html_url" <*>
            o .: "user" <*>
            o .: "id"

https://github.com/phadej/github/blob/1119ad464706810e9b7db47b93d0b6a46dafbda8/src/GitHub/Data/Reviews.hs#L50

The Github API documentation states that:

Pull request reviews created in the PENDING state do not include the submitted_at property in the response.
https://docs.github.com/en/rest/reference/pulls#create-a-review-for-a-pull-request

I was bitten by this bug on Friday, where I was retrieving a Review in PENDING state.

I'm happy to get some pointers on the implementation.

@phadej
Copy link
Contributor

phadej commented Oct 9, 2021

I rebased and merged in #462, thanks

@phadej phadej closed this Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants