API for posting multiple comments batched into one email? and for pull request comments on a line?


#1

Hi everyone, really excited about the new API and all the new features!

I’m wondering if there’s an API yet for applications to post multple comments in one go, resulting in one email notification. A lot of third party tools such as automated linters tend to post a lot of comments at once, and it can get really annoying. But in today’s update, it’s mentioned that Pull Request Reviews post multiple comments at once and only generate one email notification. Is there a way for third partys to do this? I thought it might be possible with the new GraphQL API, but it doesn’t seem like that’s the case.

Another thing I was wondering about, there doesn’t seem to be an API for posting on a specific line of a diff like there is in the REST API. Unless I’m misunderstanding the documentation, it seems like you can only add a comment to an object, which would be something like a pull request or a commit, but there’s no position argument. I suppose the GraphQL API is just not feature complete yet, and I should probably just wait?

Thanks for all the new goodies!


#2

Hi @ibrahima, thanks for sharing your thoughts with us. I’m glad to hear you’re excited about all of these new features!

I’d like to follow-up with you here to gain a better understanding for what you’re looking for.

I’m wondering if there’s an API yet for applications to post multple comments in one go, resulting in one email notification.
[…]
Is there a way for third partys to do this? I thought it might be possible with the new GraphQL API, but it doesn’t seem like that’s the case.

Great question! When you mentioned posting multiple comments in one go, I immediately thought of this endpoint for creating a pull request review:

https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review

Are you referencing this endpoint, or something else?

There isn’t currently a way to create a pull request review and create many comments using the GraphQL API.

It’s possible that you may be referencing the endpoint for creating a comment an issue (or pull request) thread or on a portion of a pull request’s unified diff:

However, there isn’t a way to create multiple comments either.

I hope that helps, but please let me know if you have any other questions!


#3

Hi! I was indeed asking about the pull request review API, which wasn’t available at the time. Thanks for checking back!