blob: ae2622d7b66db7520acf371da91048251950376f [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Apache Flink: How to Review a Pull Request</title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/flink.css">
<link rel="stylesheet" href="/css/syntax.css">
<!-- Blog RSS feed -->
<link href="/blog/feed.xml" rel="alternate" type="application/rss+xml" title="Apache Flink Blog: RSS feed" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!-- We need to load Jquery in the header for custom google analytics event tracking-->
<script src="/js/jquery.min.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Main content. -->
<div class="container">
<div class="row">
<div id="sidebar" class="col-sm-3">
<!-- Top navbar. -->
<nav class="navbar navbar-default">
<!-- The logo. -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-logo">
<a href="/">
<img alt="Apache Flink" src="/img/flink-header-logo.svg" width="147px" height="73px">
</a>
</div>
</div><!-- /.navbar-header -->
<!-- The navigation links. -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-main">
<!-- First menu section explains visitors what Flink is -->
<!-- What is Stream Processing? -->
<!--
<li><a href="/streamprocessing1.html">What is Stream Processing?</a></li>
-->
<!-- What is Flink? -->
<li><a href="/flink-architecture.html">What is Apache Flink?</a></li>
<!-- What is Stateful Functions? -->
<li><a href="/stateful-functions.html">What is Stateful Functions?</a></li>
<!-- Use cases -->
<li><a href="/usecases.html">Use Cases</a></li>
<!-- Powered by -->
<li><a href="/poweredby.html">Powered By</a></li>
&nbsp;
<!-- Second menu section aims to support Flink users -->
<!-- Downloads -->
<li><a href="/downloads.html">Downloads</a></li>
<!-- Getting Started -->
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Getting Started<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://ci.apache.org/projects/flink/flink-docs-release-1.11/getting-started/index.html" target="_blank">With Flink <small><span class="glyphicon glyphicon-new-window"></span></small></a></li>
<li><a href="https://ci.apache.org/projects/flink/flink-statefun-docs-release-2.1/getting-started/project-setup.html" target="_blank">With Flink Stateful Functions <small><span class="glyphicon glyphicon-new-window"></span></small></a></li>
<li><a href="/training.html">Training Course</a></li>
</ul>
</li>
<!-- Documentation -->
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Documentation<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://ci.apache.org/projects/flink/flink-docs-release-1.11" target="_blank">Flink 1.11 (Latest stable release) <small><span class="glyphicon glyphicon-new-window"></span></small></a></li>
<li><a href="https://ci.apache.org/projects/flink/flink-docs-master" target="_blank">Flink Master (Latest Snapshot) <small><span class="glyphicon glyphicon-new-window"></span></small></a></li>
<li><a href="https://ci.apache.org/projects/flink/flink-statefun-docs-release-2.1" target="_blank">Flink Stateful Functions 2.1 (Latest stable release) <small><span class="glyphicon glyphicon-new-window"></span></small></a></li>
<li><a href="https://ci.apache.org/projects/flink/flink-statefun-docs-master" target="_blank">Flink Stateful Functions Master (Latest Snapshot) <small><span class="glyphicon glyphicon-new-window"></span></small></a></li>
</ul>
</li>
<!-- getting help -->
<li><a href="/gettinghelp.html">Getting Help</a></li>
<!-- Blog -->
<li><a href="/blog/"><b>Flink Blog</b></a></li>
<!-- Flink-packages -->
<li>
<a href="https://flink-packages.org" target="_blank">flink-packages.org <small><span class="glyphicon glyphicon-new-window"></span></small></a>
</li>
&nbsp;
<!-- Third menu section aim to support community and contributors -->
<!-- Community -->
<li><a href="/community.html">Community &amp; Project Info</a></li>
<!-- Roadmap -->
<li><a href="/roadmap.html">Roadmap</a></li>
<!-- Contribute -->
<li><a href="/contributing/how-to-contribute.html">How to Contribute</a></li>
<ul class="nav navbar-nav navbar-subnav">
<li >
<a href="/contributing/contribute-code.html">Contribute Code</a>
</li>
<li class="active">
<a href="/contributing/reviewing-prs.html">Review Pull Requests</a>
</li>
<li >
<a href="/contributing/code-style-and-quality-preamble.html">Code Style and Quality Guide</a>
</li>
<li >
<a href="/contributing/contribute-documentation.html">Contribute Documentation</a>
</li>
<li >
<a href="/contributing/docs-style.html">Documentation Style Guide</a>
</li>
<li >
<a href="/contributing/improve-website.html">Contribute to the Website</a>
</li>
</ul>
<!-- GitHub -->
<li>
<a href="https://github.com/apache/flink" target="_blank">Flink on GitHub <small><span class="glyphicon glyphicon-new-window"></span></small></a>
</li>
&nbsp;
<!-- Language Switcher -->
<li>
<a href="/zh/contributing/reviewing-prs.html">中文版</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-bottom">
<hr />
<!-- Twitter -->
<li><a href="https://twitter.com/apacheflink" target="_blank">@ApacheFlink <small><span class="glyphicon glyphicon-new-window"></span></small></a></li>
<!-- Visualizer -->
<li class=" hidden-md hidden-sm"><a href="/visualizer/" target="_blank">Plan Visualizer <small><span class="glyphicon glyphicon-new-window"></span></small></a></li>
<hr />
<li><a href="https://apache.org" target="_blank">Apache Software Foundation <small><span class="glyphicon glyphicon-new-window"></span></small></a></li>
<li>
<style>
.smalllinks:link {
display: inline-block !important; background: none; padding-top: 0px; padding-bottom: 0px; padding-right: 0px; min-width: 75px;
}
</style>
<a class="smalllinks" href="https://www.apache.org/licenses/" target="_blank">License</a> <small><span class="glyphicon glyphicon-new-window"></span></small>
<a class="smalllinks" href="https://www.apache.org/security/" target="_blank">Security</a> <small><span class="glyphicon glyphicon-new-window"></span></small>
<a class="smalllinks" href="https://www.apache.org/foundation/sponsorship.html" target="_blank">Donate</a> <small><span class="glyphicon glyphicon-new-window"></span></small>
<a class="smalllinks" href="https://www.apache.org/foundation/thanks.html" target="_blank">Thanks</a> <small><span class="glyphicon glyphicon-new-window"></span></small>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
</div>
<div class="col-sm-9">
<div class="row-fluid">
<div class="col-sm-12">
<h1>How to Review a Pull Request</h1>
<hr />
<p>This guide is for all committers and contributors that want to help with reviewing code contributions. Thank you for your effort - good reviews are one of the most important and crucial parts of an open source project. This guide should help the community to make reviews such that:</p>
<ul>
<li>Contributors have a good contribution experience.</li>
<li>Our reviews are structured and check all important aspects of a contribution.</li>
<li>We make sure to keep a high code quality in Flink.</li>
<li>We avoid situations where contributors and reviewers spend a lot of time refining a contribution that gets rejected later.</li>
</ul>
<hr />
<div class="page-toc">
<ul id="markdown-toc">
<li><a href="#review-checklist" id="markdown-toc-review-checklist">Review Checklist</a> <ul>
<li><a href="#is-the-contribution-well-described" id="markdown-toc-is-the-contribution-well-described">1. Is the Contribution Well-Described?</a></li>
<li><a href="#is-there-consensus-that-the-change-or-feature-should-go-into-flink" id="markdown-toc-is-there-consensus-that-the-change-or-feature-should-go-into-flink">2. Is There Consensus that the Change or Feature Should Go into Flink?</a></li>
<li><a href="#does-the-contribution-need-attention-from-some-specific-committers-and-is-there-time-commitment-from-these-committers" id="markdown-toc-does-the-contribution-need-attention-from-some-specific-committers-and-is-there-time-commitment-from-these-committers">3. Does the Contribution Need Attention from some Specific Committers and Is There Time Commitment from These Committers?</a></li>
<li><a href="#does-the-implementation-follow-the-agreed-upon-overall-approacharchitecture" id="markdown-toc-does-the-implementation-follow-the-agreed-upon-overall-approacharchitecture">4. Does the Implementation Follow the Agreed Upon Overall Approach/Architecture?</a></li>
<li><a href="#is-the-overall-code-quality-good-meeting-standard-we-want-to-maintain-in-flink" id="markdown-toc-is-the-overall-code-quality-good-meeting-standard-we-want-to-maintain-in-flink">5. Is the Overall Code Quality Good, Meeting Standard we Want to Maintain in Flink?</a></li>
<li><a href="#are-the-english-and-chinese-documentation-updated" id="markdown-toc-are-the-english-and-chinese-documentation-updated">6. Are the English and Chinese documentation updated?</a></li>
</ul>
</li>
<li><a href="#review-with-the-flinkbot" id="markdown-toc-review-with-the-flinkbot">Review with the @flinkbot</a></li>
</ul>
</div>
<h2 id="review-checklist">Review Checklist</h2>
<p>Every review needs to check the following six aspects. <strong>We encourage to check these aspects in order, to avoid spending time on detailed code quality reviews when formal requirements are not met or there is no consensus in the community to accept the change.</strong></p>
<h3 id="is-the-contribution-well-described">1. Is the Contribution Well-Described?</h3>
<p>Check whether the contribution is sufficiently well-described to support a good review. Trivial changes and fixes do not need a long description. If the implementation is exactly <a href="/contributing/contribute-code.html#consensus">according to a prior discussion on Jira or the development mainling list</a>, only a short reference to that discussion is needed.
If the implementation is different from the agreed approach in the consensus discussion, a detailed description of the implementation is required for any further review of the contribution.</p>
<p>Any pull request that changes functionality or behavior needs to describe the big picture of these changes, so that reviews know what to look for (and don’t have to dig through the code to hopefully understand what the change does).</p>
<p><strong>A contribution is well-described if the following questions 2, 3, and 4 can be answered without looking at the code.</strong></p>
<hr />
<h3 id="is-there-consensus-that-the-change-or-feature-should-go-into-flink">2. Is There Consensus that the Change or Feature Should Go into Flink?</h3>
<p>This question can be directly answered from the linked Jira issue. For pull requests that are created without prior consensus, a <a href="/contributing/contribute-code.html#consensus">discussion in Jira to seek consensus</a> will be needed.</p>
<p>For <code>[hotfix]</code> pull requests, consensus needs to be checked in the pull request.</p>
<hr />
<h3 id="does-the-contribution-need-attention-from-some-specific-committers-and-is-there-time-commitment-from-these-committers">3. Does the Contribution Need Attention from some Specific Committers and Is There Time Commitment from These Committers?</h3>
<p>Some changes require attention and approval from specific committers. For example, changes in parts that are either very performance sensitive, or have a critical impact on distributed coordination and fault tolerance need input by a committer that is deeply familiar with the component.</p>
<p>As a rule of thumb, special attention is required when the Pull Request description answers one of the questions in the template section “Does this pull request potentially affect one of the following parts” with ‘yes’.</p>
<p>This question can be answered with</p>
<ul>
<li><em>Does not need specific attention</em></li>
<li><em>Needs specific attention for X (X can be for example checkpointing, jobmanager, etc.).</em></li>
<li><em>Has specific attention for X by @commiterA, @contributorB</em></li>
</ul>
<p><strong>If the pull request needs specific attention, one of the tagged committers/contributors should give the final approval.</strong></p>
<hr />
<h3 id="does-the-implementation-follow-the-agreed-upon-overall-approacharchitecture">4. Does the Implementation Follow the Agreed Upon Overall Approach/Architecture?</h3>
<p>In this step, we check if a contribution folllows the agreed upon approach from the previous discussion in Jira or the mailing lists.</p>
<p>This question should be answerable from the Pull Request description (or the linked Jira) as much as possible.</p>
<p>We recommend to check this before diving into the details of commenting on individual parts of the change.</p>
<hr />
<h3 id="is-the-overall-code-quality-good-meeting-standard-we-want-to-maintain-in-flink">5. Is the Overall Code Quality Good, Meeting Standard we Want to Maintain in Flink?</h3>
<p>This is the detailed code review of the actual changes, covering:</p>
<ul>
<li>Are the changes doing what is described in the Jira ticket or design document?</li>
<li>Does the code follow the right software engineering practices? Is the code correct, robust, maintainable, testable?</li>
<li>Are the changes performance aware, when changing a performance sensitive part?</li>
<li>Are the changes sufficiently covered by tests?</li>
<li>Are the tests executing fast, i.e., are heavy-weight integration tests only used when necessary?</li>
<li>Does the code format follow Flink’s checkstyle pattern?</li>
<li>Does the code avoid to introduce additional compiler warnings?</li>
<li>If dependencies have been changed, were the NOTICE files updated?</li>
</ul>
<p>Code guidelines can be found in the <a href="/contributing/code-style-and-quality-preamble.html">Flink Code Style and Quality Guide</a>.</p>
<hr />
<h3 id="are-the-english-and-chinese-documentation-updated">6. Are the English and Chinese documentation updated?</h3>
<p>If the pull request introduces a new feature, the feature should be documented. The Flink community is maintaining both an English and a Chinese documentation. So both documentations should be updated. If you are not familiar with the Chinese language, please open a Jira assigned to the <code>chinese-translation</code> component for Chinese documentation translation and link it with current Jira issue. If you are familiar with Chinese language, you are encouraged to update both sides in one pull request.</p>
<p>See more about how to <a href="/contributing/contribute-documentation.html">contribute documentation</a>.</p>
<h2 id="review-with-the-flinkbot">Review with the @flinkbot</h2>
<p>The Flink community is using a service called <a href="https://github.com/flinkbot">@flinkbot</a> to help with the review of the pull requests.</p>
<p>The bot automatically posts a comment tracking the review progress for each new pull request:</p>
<div class="highlight"><pre><code>### Review Progress
* [ ] 1. The description looks good.
* [ ] 2. There is consensus that the contribution should go into to Flink.
* [ ] 3. [Does not need specific attention | Needs specific attention for X | Has attention for X by Y]
* [ ] 4. The architectural approach is sound.
* [ ] 5. Overall code quality is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) if you have questions about the review process.
</code></pre></div>
<p>Reviewers can instruct the bot to tick off the boxes (in order) to indicate the progress of the review.</p>
<p>For approving the description of the contribution, mention the bot with <code>@flinkbot approve description</code>. This works similarly with <code>consensus</code>, <code>architecture</code> and <code>quality</code>.</p>
<p>For approving all aspects, put a new comment with <code>@flinkbot approve all</code> into the pull request.</p>
<p>The syntax for requiring attention is <code>@flinkbot attention @username1 [@username2 ..]</code>.</p>
</div>
</div>
</div>
</div>
<hr />
<div class="row">
<div class="footer text-center col-sm-12">
<p>Copyright © 2014-2019 <a href="http://apache.org">The Apache Software Foundation</a>. All Rights Reserved.</p>
<p>Apache Flink, Flink®, Apache®, the squirrel logo, and the Apache feather logo are either registered trademarks or trademarks of The Apache Software Foundation.</p>
<p><a href="/privacy-policy.html">Privacy Policy</a> &middot; <a href="/blog/feed.xml">RSS feed</a></p>
</div>
</div>
</div><!-- /.container -->
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.matchHeight/0.7.0/jquery.matchHeight-min.js"></script>
<script src="/js/codetabs.js"></script>
<script src="/js/stickysidebar.js"></script>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-52545728-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>