<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>code review Archives &#8211; Structured Procrastination</title>
	<atom:link href="https://blog.adamspiers.org/tag/code-review/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.adamspiers.org/tag/code-review/</link>
	<description>because there&#039;s always something more interesting than what you should be doing</description>
	<lastBuildDate>Sun, 12 May 2013 11:47:20 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://blog.adamspiers.org/wp-content/uploads/2018/12/cropped-IMG_20160907_193859-PANO-c-7-32x32.jpg</url>
	<title>code review Archives &#8211; Structured Procrastination</title>
	<link>https://blog.adamspiers.org/tag/code-review/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>in partial defense of GitHub&#8217;s review system</title>
		<link>https://blog.adamspiers.org/2013/05/12/in-partial-defense-of-githubs-review-system/</link>
					<comments>https://blog.adamspiers.org/2013/05/12/in-partial-defense-of-githubs-review-system/#comments</comments>
		
		<dc:creator><![CDATA[Adam]]></dc:creator>
		<pubDate>Sun, 12 May 2013 11:47:20 +0000</pubDate>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[code review]]></category>
		<category><![CDATA[Gerrit]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[rants]]></category>
		<guid isPermaLink="false">http://blog.adamspiers.org/?p=934</guid>

					<description><![CDATA[<p>Julien Danjou recently posted a thought-provoking rant about GitHub&#8217;s pull request workflow implementation. His main point is essentially that Gerrit provides a more sophisticated review system. Of course I&#8217;m not going to disagree with that 😉 I am generally a big fan of Julien&#8217;s work and I&#8217;m very excited for the future of OpenStack Ceilometer [&#8230;]</p>
<p>The post <a href="https://blog.adamspiers.org/2013/05/12/in-partial-defense-of-githubs-review-system/">in partial defense of GitHub&#8217;s review system</a> appeared first on <a href="https://blog.adamspiers.org">Structured Procrastination</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://julien.danjou.info">Julien Danjou</a> recently posted a thought-provoking <a href="http://julien.danjou.info/blog/2013/rant-about-github-pull-request-workflow-implementation">rant about GitHub&#8217;s pull request workflow implementation</a>. His main point is essentially that Gerrit provides a more sophisticated review system. Of course I&#8217;m not going to disagree with that <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>I am generally a big fan of Julien&#8217;s work and I&#8217;m very excited for the future of <a href="http://launchpad.net/ceilometer">OpenStack Ceilometer</a> of which he is the current <a href="https://wiki.openstack.org/wiki/Governance/Foundation/TechnicalCommittee">PTL</a>. However, in this case I think his views are understandably biased towards review workflows on very large projects like OpenStack, and I found the length of the rant slightly disproportionate to the actual substance of the points made within it. Somewhat ironically, AFAICS his blog&#8217;s own review process could use some improvement due to comments currently being disabled <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> So here are my thoughts.</p>
<p><em>Disclaimer: currently I use GitHub for reviews more regularly than Gerrit, so my views are likely to be biased at least as much as Julien&#8217;s, but in the opposite direction <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></em></p>
<p><span id="more-934"></span></p>
<h2>Barrier to entry too low?</h2>
<p>Julien says:</p>
<blockquote><p>The pull-request system looks like an incredible easy way to contribute to any project hosted on Github. You&#8217;re a click away to send your contribution to any software. But the problem is that any worthy contribution isn&#8217;t an effort of a single click.</p>
<p>Doing any proper and useful contribution to a software is never done right the first time.</p></blockquote>
<p>That&#8217;s an unhelpful over-generalization. There are <em>plenty</em> of cases where the low barrier to entry of a single click means the difference between a worthy contribution being merged and it never being sent. Fixing typos is the classic example, but there are others &#8211; small tweaks to comments and docs, one-line bug fixes etc. I work on several small projects for which setting up Gerrit would be complete overkill, and GitHub&#8217;s PR mechanism is a godsend in this regard.</p>
<p>So I&#8217;d suggest that one size does not fit all, and the larger the project, the higher the barrier to entry should be. </p>
<h2>Preserving rewritten history</h2>
<blockquote><p>The problem is that if your contributor does this <em>[history rewriting via <code>git rebase --interactive</code>]</em> and then repush the branch composing your pull-request to Github, you will both lose the previous review done, each time. There&#8217;s no history on the different versions of the branch that has been pushed.</p></blockquote>
<p>This is not quite correct.  Julien is right to point out that GitHub doesn&#8217;t provide history of the commit SHA1s via the web UI or via the <a href="http://developer.github.com/v3/pulls/#list-commits-on-a-pull-request">API</a>.  This is indeed a crucial flaw <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" />  I have not seen any evidence that GitHub exposes anything akin to <a href="https://www.kernel.org/pub/software/scm/git/docs/git-reflog.html">reflogs</a>, and this flaw aligns with that, so it may be a deliberate design trade-off they decided in order to save on disk space (although that doesn&#8217;t sound like a big saving to me).</p>
<p>However, let&#8217;s give credit where it&#8217;s due: GitHub does provide history of the review <em>discussion</em>, and in particular has quite a nice feature for handling comments on outdated diff hunks.  If someone submitted a pull request with (say) two diff hunks, you provided feedback on both, and then they force-pushed new history which only changes one of those hunks, then the pull request page will now only show one of the hunks as outdated, so both the contributor and the reviewer can see that one hunk needs a fresh review, and the other still contains unresolved issues.  Here&#8217;s <a href="https://github.com/aspiers/test/pull/1">an example pull request</a> I just made to illustrate it.  GitHub presents a chronological history of the review:</p>
<ul>
<li>the first version of the patch is lamentably missing from near the top,
<li>the final version of the patch is near the bottom, and
<li>discussion over now-outdated diff hunks are initially collapsed for brevity.
</ul>
<p>You can click to expand the discussion over points which are outdated.  For comparison, here&#8217;s the <a href="https://api.github.com/repos/aspiers/test/pulls/1/commits">JSON returned by the API for the same view</a>.</p>
<h2>Gate testing</h2>
<p>Gate testing is very easy to set up on GitHub projects using <a href="https://travis-ci.org/">Travis CI</a>, and integration between the two systems is very nice.</p>
<p>Again, I agree with Julien that the weakness of this approach is that (AFAIK) Travis only runs the tests against the tip of each pull request branch, rather than for each commit within it, and this leaves the project <em>more</em> vulnerable to pull requests which contain broken commits.  I am every bit as passionate about history cleanliness as Julien, as you can see from <a href="/7-principles-for-contributing-patches-to-software-projects/#cleanliness">my previous blog on the subject</a>.  However, this assertion is inaccurate:</p>
<blockquote><p>
With such a restriction, it&#8217;s impossible to have &#8220;fixup commits&#8221; merged in your project and pollute the history and the testability of the project.  [&#8230;]  This implies that no broken patchset can ever sneak in, [&#8230;]
</p></blockquote>
<p>Even if the tests pass for every commit, that does not prove that the pull request contains no fixup commits.  For example, a fixup commit might fix a typo in a comment introduced by a previous commit in the same series.  The typo won&#8217;t break any tests, but it will pollute the history.  So testing every commit is very good (if you can afford it), but it&#8217;s not a panacea.</p>
<h2>Other opinions</h2>
<p>I am an occasional contributor to <code>git</code> itself, and I find it interesting to note that those folks are absolutely religious about reviewing patches via the mailing list, using <code>git format-patch</code> and <code>git send-email</code>, rather than via an external tool such as GitHub or Gerrit.  Although the maintainer does an incredibly good job, there are occasions where patches can get accidentally dropped or the wrong version taken, and my personal preference would be to use a more structured system like Gerrit to defend against this.  However every system has its strengths and weaknesses, and I&#8217;m fairly sure they have good reasons for deliberately choosing not to use Gerrit.</p>
<p>Additionally, <a href="https://github.com/torvalds/linux/pull/17#issuecomment-5654674">Linus absolutely hates GitHub pull requests</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<h2>Conclusion</h2>
<p>Yes, GitHub has some crucial deficiencies in its pull request review workflow.  But nevertheless, for small to medium-size projects, what it offers for free can be incredibly useful, and I for one am very grateful.</p>
<p>In the future I hope to use Gerrit more often than GitHub, but I thought it was worth partially defending the underdog here <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.adamspiers.org%2F2013%2F05%2F12%2Fin-partial-defense-of-githubs-review-system%2F&#038;title=in%20partial%20defense%20of%20GitHub%E2%80%99s%20review%20system" data-a2a-url="https://blog.adamspiers.org/2013/05/12/in-partial-defense-of-githubs-review-system/" data-a2a-title="in partial defense of GitHub’s review system"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://blog.adamspiers.org/2013/05/12/in-partial-defense-of-githubs-review-system/">in partial defense of GitHub&#8217;s review system</a> appeared first on <a href="https://blog.adamspiers.org">Structured Procrastination</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.adamspiers.org/2013/05/12/in-partial-defense-of-githubs-review-system/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
