Subscribed unsubscribe Subscribe Subscribe

@kyanny's blog

Write down what I learnt. Opinions are my own.

You can review "bundle update" efficiently with Compare Linker

Usually Ruby projects use Bundler to manage dependent gems. You probably put a Gemfile.lock in version control system like Git. You will run bundle update to upgrade dependent gems.

If you are a member of software development team and your team is using GitHub, I guess that you'd like to open pull request and review the result of bundle update.

But a diff of Gemfile.lock isn't easy to review. Let's see below screenshots.

Problem

screenshot of Gemfile.lock

For example, byebug gem is upgraded from 2.5.0 to 2.6.0. But if you want to know what is changed by this upgrade, you have to find a changelog file by yourself.

Fortunately byebug has changelog, but it's not enough to review whole of changes between 2.5.0 and 2.6.0. There are 32 commits, 19 changed files with 449 additions and 356 deletions between 2.5.0 to 2.6.0 but only one line is added to changelog.

Unfortunately, some gems don't have changelog. You sometimes have to read each commit log to know what is changed.

screenshot of Gemfile.lock

If you are using gem from Git repository, it's more hard to investigate changes. In second screenshot, simplecov is upgraded from revision 5703690241a1df6525ce61bf3ec2eda813760237 to revision 5e2b5b39ef46be1187fde9e5b92f320be3f21934. It's totally useless information for human's eyes.

Solution

I was bothered by such a annoying diffs many times. One day, I noticed that I often make GitHub's compare view URL for each gems to read diffs with nice user interface. So I came up with to automate making compare URLs.

Compare Linker is a solution. This library analyses diff of Gemfile.lock, detects upgraded gems and makes compare URLs for each gems.

screenshot of compare linker

This library is designed to work well with GitHub's pull request, so I wrote tiny Rack application to receive webhook of pull request from GitHub. You can run this rack application on Heroku by a few steps setup, and will get a neat comment like above screenshot.

I'm going to launch a web service that provides this function for open source Ruby projects. This library is still under development. Any feedbacks are welcome.