Splashed Pull Requests

David Calavera
3 min readFeb 7, 2019

--

A few years ago, an ex-coworker mentioned that at the company he worked for had a curious Pull Request template. At the bottom, the template suggested people to include a picture of a cute animal. He mentioned that everyone at the company loved the small addition to their code review process.

I took that idea for Docker’s Pull Request template, and you still can see people adding cute kittens to Moby’s PRs. That actually became a Twitter account where you can see only the pictures!

At Netlify, our Pull Request templates also include a similar suggestion:

Relevant links (GH issues, traces, etc.) or a picture of a cute animal

What started as a way to break the monotony of reviewing code, has become a recurrent topic that we have conversations about. Some people discover new repositories because they want to see all the pictures we post. Others talks about how they need to “level up” their picture game:

Looking for the perfect picture for a new Pull Requests is quite entertaining. Your mind wonders about which kind of animal that PR with three hundred new lines of code and no tests is. Those minutes are precious. Unfortunately, I’m usually annoyed with repetitive tasks, and this feels more like a chore some times.

So I woke up last Monday and I decided to automate the picture selection for our Pull Requests, and I probably took all the fun out of it, sorry.

I wrote a GitHub Action that gets random beautiful pictures from Unsplash’s API. If you’ve never heard of Unsplash, it’s fantastic place where amazing photographers post gorgeous free pictures for you to use anywhere. I called this project Splashed Pull Requests. You can see it in action in the Pull Requests that I opened in private while I was writing the code. And now it’s open source, so you can enhance all your PRs.

Sadly, there are a bunch of caveats I have to tell you about before you start splashing all your code changes. At the time of writing this, GitHub Actions is still in private beta, so you might not have access to it yet. Actions only receive Pull Requests events in private repositories, so forget about getting 1 million stars in your open source project because it’s full of gorgeous puppy pictures. Unsplash doesn’t really allow automated use of their API, and your application won’t probably be promoted to their production status, so you’ll have to live with only getting 50 pictures per hour.

But besides all those problems, I’m super excited to see more cute animal pictures all over GitHub!

--

--