xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Lars Kurth <lars.kurth@citrix.com>
To: Rich Persaud <persaur@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jan Beulich <JBeulich@suse.com>
Cc: Lars Kurth <lars.kurth@xenproject.org>,
	"xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>,
	"minios-devel@lists.xenproject.org"
	<minios-devel@lists.xenproject.org>,
	"committers@xenproject.org" <committers@xenproject.org>,
	"mirageos-devel@lists.xenproject.org"
	<mirageos-devel@lists.xenproject.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [MirageOS-devel] [PATCH v2 4/6] Add Code Review Guide
Date: Thu, 5 Dec 2019 23:41:19 +0000	[thread overview]
Message-ID: <97079765-88F1-4F0C-95B1-B729B4AA93AA@citrix.com> (raw)
In-Reply-To: <FDC64A08-D894-44CB-9244-9752D0FD17CD@citrix.com>



From: Lars Kurth <lars.kurth@citrix.com>
Date: Thursday, 28 November 2019 at 19:39
To: Rich Persaud <persaur@gmail.com>
Cc: 'Jan Beulich' <JBeulich@suse.com>, "lars.kurth@xenproject.org" <lars.kurth@xenproject.org>, Stefano Stabellini <sstabellini@kernel.org>, "xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>, "minios-devel@lists.xenproject.org" <minios-devel@lists.xenproject.org>, "committers@xenproject.org" <committers@xenproject.org>, "mirageos-devel@lists.xenproject.org" <mirageos-devel@lists.xenproject.org>, xen-devel <xen-devel@lists.xenproject.org>, "win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
Subject: Re: [MirageOS-devel] [PATCH v2 4/6] Add Code Review Guide

 
 
From: Rich Persaud <persaur@gmail.com>
Date: Thursday, 28 November 2019 at 12:21
To: Lars Kurth <lars.kurth@citrix.com>
Cc: 'Jan Beulich' <JBeulich@suse.com>, "lars.kurth@xenproject.org" <lars.kurth@xenproject.org>, Stefano Stabellini <sstabellini@kernel.org>, "xen-api@lists.xenproject.org" <xen-api@lists.xenproject.org>, "minios-devel@lists.xenproject.org" <minios-devel@lists.xenproject.org>, "committers@xenproject.org" <committers@xenproject.org>, "mirageos-devel@lists.xenproject.org" <mirageos-devel@lists.xenproject.org>, xen-devel <xen-devel@lists.xenproject.org>, "win-pv-devel@lists.xenproject.org" <win-pv-devel@lists.xenproject.org>
Subject: Re: [MirageOS-devel] [PATCH v2 4/6] Add Code Review Guide
 
On Nov 28, 2019, at 09:05, Lars Kurth <lars.kurth@citrix.com> wrote:
 
On 28/11/2019, 07:37, "Jan Beulich" <jbeulich@suse.com> wrote:

   On 28.11.2019 14:06, Lars Kurth wrote:


I can certainly add something on the timing , along the lines of
* For complex series, consider the time it takes to do reviews (maybe with a guide of LOC per hour) and give reviewers enough time to
* For series with design issues or large questions, try and highlight the key open issues in cover letters clearly and solicit feedback from key maintainers who can comment on the open issue. The idea is to save both the contributor and the reviewers time by focussing on what needs to be resolved 
* Don’t repost a series, unless all review comments are addressed
or the reviewers asked you to do so. The problem with this is that
this is somewhat in conflict with the "let's focus on the core
issues and not get distracted by details early on in a review cycle".
In other words, this can only work, if reviewers focus on major
issues in early reviews only and do not focus on style, coding
standards, etc.

   But this doesn't make much sense either, because then full re-reviews
   need to happen anyway on later versions, to also deal with the minor
   issues. For RFC kind of series omitting style and alike feedback
   certainly makes sense, but as soon as a patch is non-RFC, it should
   be considered good to go in by the submitter.

OK, I think we have a disconnect between ideal and reality. 

I see two issues today
* Key maintainers don't always review RFC series [they end up at the bottom of the priority list, even though spending time on RFCs will save time elsewhere later]. So the effect is that then the contributor assumes there are no major issues and ends it as a proper series
* In practice what has happened often in the past is that design, architecture, assumption flaws are found in early versions of a series.
  - This usually happens because of an oversight or because there was no design discussion prior to the series being posted and agreed
  - Common sense would dictate that the biggest benefit for both the reviewer, the contributor and the community as a whole would be to try and focus on such flaws and leave everything aside
  - Of course there may be value in doing a detailed review of parts of such a series as there may be bits that are unaffected by such a flaw
  - But there will likely be parts which are not: doing a detailed review of such portions wastes everyone's time

So coming back to your point. Ideally, it would be nice if we had the capability to call out parts of a series as "problematic" and treating such parts differently.
 
  We may be able to reuse some "Shift Left" terminology, including citations of previous Xen code reviews to illustrate categories of design issues that can be shifted left:
  
    https://devopedia.org/shift-left
  
I like that idea. We seem to not have come to a conclusion on this specific topic, but maybe for now it is sufficient to call this out as a potential issue in the guide.
 
Before I send out a new version, it would be good to get at least Jan’s view on the issue. 
 
Lars

I have a draft version of  this series ready, but wanted to check how some of it resonates. Also, I do have open questions, where I am looking for input from seasoned reviewers

I propose to add the following section to code-review-guide.md

----
## <a name="problems"></a>Problematic Patch Reviews

A typical waterfall software development process is sequential with the following 
steps: define requirements, analyse, design, code, test and deploy. Problems 
uncovered by code review or testing at such a late stage can cause costly redesign 
and delays. The principle of **[Shift Left](https://devopedia.org/shift-left)** is to take a 
task that is traditionally performed at a late stage in the process and perform that task 
at earlier stages. The goal is to save time by avoiding refactoring.

Typically, problematic patch reviews uncover issues such as wrong or missed 
assumptions, a problematic architecture or design, or other bugs that require 
significant re-implementation of a patch series to fix the issue.

The principle of **Shift Left** also applies in code reviews. Let's assume a series has
a major flaw: ideally, this flaw would be picked up in the **first or second iteration** of 
the code review. As significant parts of the code may have to be re-written, it does not 
make sense for reviewers to highlight minor issues (such as style issues) until major 
flaws have been addressed. By providing feedback on minor issues reviewers cause 
the code author and themselves extra work by asking for changes to code, which 
ultimately may be changed later.

The question then becomes, how do code reviewers identify major issues early? 
----
This is where I really need help. Are there any tips and recommendations that we could give?
I can clearly highlight that we have RFC series, but in practice that does not solve the problem as RFCs don’t get prioritized
How do reviewers normally approach a series: do you a) take a big picture view first, or b) do most of you work through a series sequentially

I then propose to change the following section in communication-practice.md
----
### Prioritize significant flaws
If a patch or patch series has significant flaws, such as
* It is built on wrong assumptions
* There are issues with the architecture or the design

it does not make sense to do a detailed code review. In such cases, it is best to
focus on the major issues first and deal with style and minor issues in a subsequent
review. Not all series have significant flaws, but most series have different classes of 
changes that are required for acceptance: covering a range of major code 
modifications to minor code style fixes. To avoid misunderstandings between 
reviewers and contributors, it is important to establish and agree whether a series or 
part of a series has a significant flaw and agree a course of action. 

A pragmatic approach would be to
* Highlight problematic portions of a series in the cover letter 
* For the patch author and reviewer(s) to agree that for problematic to omit style and
minor issues in the review, until the significant flaw is addressed

This saves both the patch author and reviewer(s) time. Note that some background
is covered in detail in [Problematic Patch Reviews](resolving-disagreement.md#problems).
----
I think is a pragmatic approach that addresses some of Jan's concerns

Best Regards
Lars


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-12-05 23:42 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26 19:39 [Xen-devel] [PATCH v2 0/6] Code of Conduct + Extra Guides and Best Practices Lars Kurth
2019-09-26 19:39 ` [Xen-devel] [PATCH v2 1/6] Import v1.4 of Contributor Covenant CoC Lars Kurth
2019-10-07 11:06   ` George Dunlap
2019-10-07 11:27     ` Lars Kurth
2019-09-26 19:39 ` [Xen-devel] [PATCH v2 2/6] Xen Project Code of Conduct Lars Kurth
2019-09-26 19:39 ` [Xen-devel] [PATCH v2 3/6] Add Communication Guide Lars Kurth
2019-09-26 19:39 ` [Xen-devel] [PATCH v2 4/6] Add Code Review Guide Lars Kurth
2019-11-28  0:54   ` Stefano Stabellini
2019-11-28 10:09     ` Jan Beulich
2019-11-28 13:06       ` Lars Kurth
2019-11-28 13:37         ` Jan Beulich
2019-11-28 14:02           ` Lars Kurth
2019-11-28 18:20             ` [Xen-devel] [MirageOS-devel] " Rich Persaud
2019-11-29  1:39               ` Lars Kurth
2019-12-05 23:41                 ` Lars Kurth [this message]
2019-12-06  9:51                   ` [Xen-devel] " Jan Beulich
2019-12-09 11:02                     ` Lars Kurth
2019-12-09 15:58                       ` Lars Kurth
2019-11-28 18:12       ` Rich Persaud
2019-11-29  1:50         ` Lars Kurth
2019-11-28 18:19       ` Stefano Stabellini
2019-09-26 19:39 ` [Xen-devel] [PATCH v2 5/6] Add guide on Communication Best Practice Lars Kurth
2019-09-27  8:59   ` Jan Beulich
2019-09-27  9:53     ` Lars Kurth
2019-09-27  9:14   ` Jan Beulich
2019-09-27 10:17     ` Lars Kurth
2019-09-27 10:22       ` Lars Kurth
2019-09-27 14:19       ` Jan Beulich
2019-10-07 16:13     ` George Dunlap
2019-10-08  7:29       ` Jan Beulich
2019-11-28  1:06     ` Stefano Stabellini
2019-11-29  0:02       ` Lars Kurth
2019-10-07 15:29   ` George Dunlap
2019-11-28  0:57   ` Stefano Stabellini
2019-11-29  0:00     ` Lars Kurth
2019-09-26 19:39 ` [Xen-devel] [PATCH v2 6/6] Added Resolving Disagreement Lars Kurth
2019-11-28  0:56   ` Stefano Stabellini
2019-11-28 10:18     ` Jan Beulich
2019-11-28 18:50       ` Stefano Stabellini
2019-11-29  2:10         ` Lars Kurth
2019-11-29  1:42     ` Lars Kurth
2019-10-24  7:51 ` [Xen-devel] [PATCH v2 0/6] Code of Conduct + Extra Guides and Best Practices Felipe Huici

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97079765-88F1-4F0C-95B1-B729B4AA93AA@citrix.com \
    --to=lars.kurth@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=committers@xenproject.org \
    --cc=lars.kurth@xenproject.org \
    --cc=minios-devel@lists.xenproject.org \
    --cc=mirageos-devel@lists.xenproject.org \
    --cc=persaur@gmail.com \
    --cc=sstabellini@kernel.org \
    --cc=win-pv-devel@lists.xenproject.org \
    --cc=xen-api@lists.xenproject.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).