At Airbnb, we’re always looking for ways to make communication easy without introducing more process than needed.

One handy trick we use for increasing the quality and visibility of GitHub Pull Requests (PRs) is a template bookmarklet we wrote. It saves developer time by providing a little structure around PRs. It’s also useful for making sure the right eyes see your stuff, especially in a really busy repository.

When you open a PR, click the JavaScript bookmarklet from your bookmarks, which will fill the body out like this:

  • What/Why?
  • How was it tested?
  • cc project_narwhal: @mLewisLogic @clizzin @Raphomet @LogicWolfe


Here’s the bookmarklet:

javascript:(function() {var e = document.getElementById('pull_request_body');if (e) {e.value += '# What? Why?\n\n\n# How was it tested?\n\n\ncc project_narhwal @mLewisLogic @clizzin @Raphomet @LogicWolfe';}})();

If you have Github teams set up, you can add them to the cc line as well.

As an added bonus, if a PR has gotten totally unwieldy with comments, this snippet will mute comment blocks by author, so you can focus on the parts that matter to you.

javascript:(function() { var username=prompt("Hide comment blocks including user:"); if (username!=null && username!="") { $(".comment-header-author:contains("+username+")").parents("tr.inline-comments").hide(); } })();

Note, these work(ish), as of the publishing of this post. Expect Github to break them at a moment’s notice as they continue to refine their website.

Want to work with us? We're hiring!