From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web11.445.1589225954166283464 for ; Mon, 11 May 2020 12:39:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E68sT3OL; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589225953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DVzMNl5ZBDX8gU1E+IBBwdMheuCoXC4PACKNkqdxKPA=; b=E68sT3OLmnR2kOBeCcT12k6mCQAxViKl4aMbJwLFuNdlQFKYDYJC4CO9lVRYgDf6WQffbr 24LXCwLn6NeNRi0yTeraXjSmV5fboTyhCHGjm6Zy4kzXDmTgp/J0Kld6uoDz0IbZbcyh2O l4A2AKOmWLtCN46Osxa96PS7KaGvHq0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-219-PWcxsN0MPzqEQxJnLyR60g-1; Mon, 11 May 2020 15:39:03 -0400 X-MC-Unique: PWcxsN0MPzqEQxJnLyR60g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D77651005510; Mon, 11 May 2020 19:39:02 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-11.ams2.redhat.com [10.36.113.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB2635C1D2; Mon, 11 May 2020 19:39:01 +0000 (UTC) Subject: Re: [edk2-devel] [edk2-rfc] GitHub Pull Request based Code Review Process To: devel@edk2.groups.io, michael.d.kinney@intel.com, "rfc@edk2.groups.io" References: From: "Laszlo Ersek" Message-ID: <8389d6a6-aaf5-3c0e-904f-84f814c9d385@redhat.com> Date: Mon, 11 May 2020 21:39:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 05/09/20 04:59, Michael D Kinney wrote: > Hello, > > This is a proposal to change from the current email-based code review process to > a GitHub pull request-based code review process for all repositories maintained > in TianoCore. The current email-based code review process and commit message > requirements are documented in Readme.md or Readme.rst at the root of > repositories along with a few Wiki pages: > > * https://github.com/tianocore/edk2/blob/master/ReadMe.rst > * https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process > * https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers > * https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format > * https://github.com/tianocore/tianocore.github.io/wiki/Commit-Signature-Format > > The goal is to post changes by opening a GitHub pull request and perform all > code review activity using the GitHub web interface. This proposal does not > change any licenses or commit message requirements. It does require all > developers, maintainers, and reviewers to have GitHub accounts. > > One requirement that was collected from previous discussions on this topic is > the need for an email archive of all patches and code review activities. The > existing GitHub features to produce an email archive were deemed insufficient. > A proof of concept of a GitHub webhook has been implemented to provide the email > archive service. This email archive is read-only. You will not be able to send > emails to this archive or reply to emails in the archive. > > The sections below provide more details on the proposed GitHub pull request > based code review process, details on the email archive service, and a set of > remaining tasks make the email archive service production quality. It does not > make sense to support both the existing email-based code review and the GitHub > pull request-based code review at the same time. Instead, this proposal is to > switch to the GitHub pull request-based code review and retire the email based > code review process on the same date. > > The edk2 repository is using GitHub pull requests today to run automated > CI checks on the code changes and allows a maintainer to set the `push` label to > request the changes to be merged if all CI checks pass. With this proposal, > once the code review is complete and the commit messages have been updated, the > same pull request can be used to perform a final set of CI checks and merge the > changes into the master branch. > > I would like to collect feedback on this proposal and the email archive service > over the next two weeks with close of comments on Friday May 22, 2020. If all > issues and concerns can be addressed, then I would like to see the community > agree to make this change as soon as all remaining tasks are completed. > > # TianoCore Repositories to enable > > * [edk2](https://github.com/tianocore/edk2) > * [edk2-platforms](https://github.com/tianocore/edk2-platforms) > * [edk2-non-osi](https://github.com/tianocore/edk2-non-osi) > * [edk2-test](https://github.com/tianocore/edk2-test) > * [edk2-libc](https://github.com/tianocore/edk2-libc) > * [edk2-staging](https://github.com/tianocore/edk2-staging) > > # GitHub Pull Request Code Review Process > > **NOTE**: All steps below use [edk2](https://github.com/tianocore/edk2) as an > example. Several repositories are supported. > > ## Author/Developer Steps > * Create a personal fork of [edk2](https://github.com/tianocore/edk2) > > https://help.github.com/en/github/getting-started-with-github/fork-a-repo > > * Create a new branch from edk2/master in personal fork of edk2 repository. > > * Add set of commits for new feature or bug fix to new branch. Make sure to > follow the commit message format requirements. The only change with this > RFC is that the Cc: lines to maintainers/reviewers should **not** be added. > The Cc: lines are still supported, but they should only be used to add > reviewers that do not have GitHub IDs or are not members of TianoCore. > > * Push branch with new commits to personal fork > * Create a pull request against TianoCore edk2/master > > https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request > > * If pull request has more than 1 commit, then fill in the pull request title > and decryption information for Patch #0. Do not leave defaults. s/decryption/description/ (Because I'm assuming this will turn into a wiki article at some point.) > > * Do not assign reviewers. The webhook assigns maintainers and reviewers to > the pull request and each commit in the pull request. > > * If maintainers/reviewers provide feedback that requires changes, then make > add commits to the current branch with the requested changes. Once all s/make add/add/ > changes are accepted on the current branch, reformulate the patch series and > commit comments as needed for perform a forced push to the branch in the > personal fork of the edk2 repository. This step may be repeated if multiple > versions of the patch series are required to address all code review > feedback. Do I understand correctly that this recommends the contributor first push incremental patches on top of the series, then do a rebase (squashing updates as necessary) and finally do a force-push, for the next round of review? To me as a reviewer, that's extra work. I'm used to locally comparing the v(n) patch set to v(n+1) with git-range-diff, and/or with some personal scripts. I wouldn't encourage incremental patches appended -- even temporarily -- to the branch, because (a) it's extra review work (it requires me to review something that has zero chance to get into the git history as-is), and (b) it superficially resembles the github.com-specific bad practice called "squash on merge", and (c) it runs the risk that the maintainer responsible for ultimately merging the series ends up actually merging the incremental (= "fixup") patches in isolation (without squashing them). > > **OPEN**: How should minimum review period be set? Labels? Not sure about the best tooling. My recommendation would be to require reviewers to start providing their feedback within one week. One thing that I find important is that a maintainer can signal "I got your work in my queue, but I may need more time". And a special case of that are automated out-of-office responses. I think they are very helpful (when a contributor feels they are bottlenecked on review), but I'm not sure how one can configure that via github. I certainly would not share my out-of-office times with github. (I set the start/end dates in my email infrastructure, at the moment, but the out-of-office messages it sends do not contain the dates either, on purpose.) > > ## TianoCore GitHub Email Archive Webhook Service Steps > * Receive an event that a new pull request was opened > * Evaluate the files modified by the entire pull request and each commit in > the pull request and cross references against `Maintainters.txt` in the root s/cross references/cross reference them/ ? > of the repository to assign maintainers/reviewers to the pull request and > each commit in the pull request. Individual commit assignments are performed > by adding a commit comment of the following form: > > [CodeReview] Review-request @mdkinney > > * Generate and sends git patch review emails to the email archive. Emails s/sends/send/ > are also sent to any Cc: tags in the commit messages. > > * If the author/developer performs a forced push to the branch in their > personal fork of the edk2 repository, then a new set of patch review emails > with patch series Vx is sent to the email archive and any Cc: tags in commit > messages. > > * Receive events associated with all code review activities and generate > and send emails to the email archive that shows all review comments and > all responses closely matching the email contents seen in the current email > based code review process. > > * Generate and send email when pull request is merged or closed. > > ## Maintainer/Reviewer Steps > > * Make sure GitHub configuration is setup to 'Watch' the repositories that > you have maintainer ship or review responsibilities and that email s/maintainer ship/maintainership/ > notifications from GitHub are enabled. This enables email notifications > when a maintainer/reviewer is assigned to a pull request and individual > commits. > > https://help.github.com/en/github/managing-subscriptions-and-notifications-on-github/configuring-notifications > > * Subscribe to the email archive associated with the TianoCore GitHub Email > Archive Webhook Service. > > https://www.redhat.com/mailman/listinfo/tianocore-code-review-poc Important: as the name says ("-poc"), this is a Proof of Concept list, for now. Once we're ready to switch over, I'll file an internal ticket at RH to either rename the list, or (which is probably better) to create a new list (no "-poc" suffix). The second option seems more useful because then the webhook development / bugfixing (if any) could perhaps occur in parallel to the normal edk2 workflow. > > * Review pull requests and commits assigned by the TianoCore GitHub Email > Archive Webhook Service and use the GitHub web UI to provide all review > feedback. > > https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/reviewing-changes-in-pull-requests > > * Wait for Author/Developer to respond to all feedback and add commits with > code changes as needed to resolve all feedback. This step may be repeated > if the developer/author need to produce multiple versions of the patch > series to address all feedback. (same question about the incremental fixup patches as above) > > * Once all feedback is addressed, add Reviewed-by, Acked-by, and Tested-by > responses on individual commits. Or add Series-reviewed-by, Series-acked-by, > or Series-Tested-by responses to the entire pull request. > > * Wait for Developer/Author to add tags to commit messages in the pull request. > > * Perform final review of patches and commit message tags. If there are not > issues, set the `push` label to run final set of CI checks and auto merge > the pull request into master. > > # Maintainers.txt Format Changes > > Add GitHub IDs of all maintainers and reviewers at the end of M: and R: lines > in []. For example: > > M: Michael D Kinney [mdkinney] > > # TianoCore GitHub Email Archive Webhook Service > > Assign reviewers to commits in a GitHub pull request based on assignments > documented in Maintainers.txt and generates an email archive of all pull request > and code review activities. s/generates/generate/ (or s/Assign/Assigns/) > > https://github.com/mdkinney/edk2-email-archive-webhook > > # Email Archive Subscription Service > > The emails are being delivered to the following RedHat email subscription > service. Please subscribe to receive the emails and to be able to view the > email archives. > > https://www.redhat.com/mailman/listinfo/tianocore-code-review-poc > > The email archives are at this link: > > https://www.redhat.com/mailman/private/tianocore-code-review-poc/index.html > > The following sections show some example pull requests and code reviews to > help review the generated emails, their contents, and threading. > > ## Email Achieve Thread View > > https://www.redhat.com/mailman/private/tianocore-code-review-poc/2020-May/thread.html#00289 > > ## Example patch series with 1 patch > > https://www.redhat.com/mailman/private/tianocore-code-review-poc/2020-May/thread.html#00340 > > ## Example patch series with < 10 patches > > * https://www.redhat.com/mailman/private/tianocore-code-review-poc/2020-May/msg00289.html > * https://www.redhat.com/mailman/private/tianocore-code-review-poc/2020-May/msg00030.html > * https://www.redhat.com/mailman/private/tianocore-code-review-poc/2020-May/msg00018.html > * https://www.redhat.com/mailman/private/tianocore-code-review-poc/2020-May/msg00008.html > > ## Example patch series with > 80 patches > > * https://www.redhat.com/mailman/private/tianocore-code-review-poc/2020-May/msg00198.html > * https://www.redhat.com/mailman/private/tianocore-code-review-poc/2020-May/msg00116.html > * https://www.redhat.com/mailman/private/tianocore-code-review-poc/2020-May/msg00035.html > > # Tasks to Complete > > * Create edk2-codereview repository for evaluation of new code review process. > * Add GitHub IDs to Maintainers.txt in edk2-codereview repository > * Update BaseTools/Scripts/GetMaintainer.py to be compatible with GitHub IDs at > the end of M: and R: statements > * Update webhook to use Rabbit MQ to manage requests and emails > * Determine if webhook requests must be serialized? Current POC is serialized. > * Make sure webhook has error handling for all unexpected events/states. > * Add logging of all events and emails to webhook The logging sounds very useful, thank you. Whenever a log message relates to an email, please consider logging the message-id of that email, if possible. > * Add admin interface to webhook > * Deploy webhook on a production server with 24/7 support > > # Ideas for Future Enhancements > > * Run PatchCheck.py before assigning maintainers/reviewers. > * Add a simple check that fails if a single patch spans more than one package. Hmmm, good idea in general, but there have been valid exceptions to this rule. > * Monitor comments for Reviewed-by, Acked-by, Tested-by, Series-Reviewed-by, > Series-Acked-by, Series-Tested-by made by assigned maintainers/reviewers. > Once all commits have required tags, auto update commit messages in the > branch and wait for maintainer to set the `Push` label to run CI and auto > merge if all CI checks pass. Thank you for writing this up (and for implementing the webhook)! Laszlo