Skip to content

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.

2 participants