DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • From Command Lines to Intent Interfaces: Reframing Git Workflows Using Model Context Protocol
  • How to Push Docker Images to AWS Elastic Container Repository Using GitHub Actions
  • Complete Guide: Managing Multiple GitHub Accounts on One System
  • Mastering High-Risk GitHub Pull Requests: Review, Rollout Strategies, and Lessons Learned

Trending

  • Spring AI Migration: From the Vertex AI Gemini Module to the Google GenAI SDK
  • Terry: A Live File Tree and Review Gate for Claude Code
  • The Rise of the Unsanctioned Agent Swarm
  • Building an AI-Powered Code Review Assistant in Java

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Scraping Github Pull Requests and Their Code Review Comments

Scraping Github Pull Requests and Their Code Review Comments

By 
Paul Hammant
·
Jun. 29, 15 · Opinion
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
2.1K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

Github stores its pull-request and code review data in MySql. I’d much prefer a git reperentation for both (JSON, commits, audit trail, etc). Kinda the way Github Wiki pages are stored. That’s an aside though, this article is about storing code-review comments long term. The problem I’m trying to solve is one of deletion of users thich causes their pull requenst commentary to also get deleted. Sure the commits make it back to the origin/master (in the pull request is processed), but many things are left assoctaed with the fork. If the user gets deleted such info is gone forever :(

I want a permanent copy, so the interim answer is to scrape the data I fear losing, while it still exists.

Hence a scrape-pull-requests.sh bash script (for Mac and maybe Linux). Github’s portal is written in Ruby on Rails. It is extremely fast which helps scraping generally. There’s not a lot of JavaScript and that means that Wget is a viable extraction tool. Anyway the script runs quickly, and leaves a decent HTML interface for easy access later. I’ve tested it, but won’t leave up a scraped set of pull-requests as our GH overlords might object on copyright grounds.


They can’t object for your own GithubEnterprise instance of course. Github could change the structure of their HTML, and the script might stop work so well.If that happens I’m happy to accept back pull-requests via the usual mechanism :)

Git GitHub code style Requests

Published at DZone with permission of Paul Hammant. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • From Command Lines to Intent Interfaces: Reframing Git Workflows Using Model Context Protocol
  • How to Push Docker Images to AWS Elastic Container Repository Using GitHub Actions
  • Complete Guide: Managing Multiple GitHub Accounts on One System
  • Mastering High-Risk GitHub Pull Requests: Review, Rollout Strategies, and Lessons Learned

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook