Generating PDF report for a code review application with GitHub API - timeline to list conversation?

Hi -

I’m developing an app that should have part of it show a listing like a PR page listing with pull comments, diff_hunks and review comments. Basically, I want to see the conversation around a PR. Would I use the event timeline to generate this?

Currently, I’m getting the PR comments from the …/issues/:n/comments, diff_hunk from a …/pulls/:n/comments call, and the review comments from the events timeline events[‘event’][‘review’] from …/issues/:n/timeline. I can’t seem to align the data as the GitHub PR page has the review code under the appropriate code_hunk and PR comments dispersed appropriately. How would I approach looping through what data to recreate this? (ie - like PR image below - General PR comment, comment, diff_hunk, review comments.

Edited: I did find on SO: tells how to get the comments associated with the diff_hunk, but it’s not clear how to integrate the issue comments for the general PR comments.

Thanks for any advice/pointers!

Hi @emmtqg,

This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information.

As you’ll notice, your Topic is now in the How to use Git and GitHub board. No action is needed on your part; you can continue the conversation as normal here.

Let me know if you have any other questions or if I can help with anything else.


Hi that-pat!

Thanks - I’m glad someone read the post! It’s not really a general use of the board question, but I’m programming a report application using the GitHub API. I reached out to GitHub support and got some great guidance, so I’m implementing that. Don’t know if it belongs in how you use GitHub, but that’s your discretion! Thanks, you guys do an awesome job!

Best regards!