Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change(pr): Add an author checklist to the PR template #7832

Merged
merged 9 commits into from
Nov 2, 2023
Merged

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Oct 25, 2023

Motivation

What are the most important goals of the ticket or PR?

We've had a few discussions over the last few months about the PR review process. I've tried to find the top 5 things that authors and reviewers need to check, based on our discussions. (And comments on PRs from reviewers and PR authors.)

This is part of ticket #7738.

PR Author Checklist

Check before marking the PR as ready for review:

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info?
    • Does the PR have a priority label?
  • Have you added or updated tests?
  • Is the documentation up to date?

This is an internal GitHub change, so it doesn't need most of these things.

Specifications

https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository

Complex Code or Requirements

Not really, but finding the top 5 things is tricky. Let's see how it goes and update it over time?

Solution

  • Add a PR author checklist, and move some reviewer tasks into it
  • Update the reviewer checklist
  • Add a testing section
  • Remove some redundant or unused comments from other sections

Testing

I manually checked the preview looks ok:
https://github.com/ZcashFoundation/zebra/blob/pr-checklist/.github/pull_request_template.md

This template will be fully tested when it is merged.

Review

This is a routine change that every Zebra developer should review.

Reviewer Checklist

Check before approving the PR:

  • Does the PR scope match the ticket?
  • How do you know it works? Do the tests cover the PR motivation?
  • Are there any blockers to merging this PR?
    • Can some changes go in new tickets or PRs?

And check the PR Author checklist is complete.

Follow Up Work

Ticket #7738 lists some other ticket templates and docs, but I did this one first, because everything in here doesn't need to go in the ticket templates.

@teor2345 teor2345 added P-Medium ⚡ C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG extra-reviews This PR needs at least 2 reviews to merge labels Oct 25, 2023
@teor2345 teor2345 self-assigned this Oct 25, 2023
@teor2345 teor2345 requested a review from a team as a code owner October 25, 2023 23:10
@teor2345 teor2345 requested review from upbqdn and removed request for a team October 25, 2023 23:10
Copy link
Member

@upbqdn upbqdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it hard to express the answers to some questions in their checkboxes. For example, the checkboxes of the following two questions

  • Does the PR have a priority label?
  • Does it need extra CHANGELOG info?

seem to have the opposite behavior because:

  • The answer to the first q is "yes" for a correct PR, so I would intuitively check the box.
  • However, the answer to the second q is "no" for a correct PR, and now I'm stuck thinking about whether I should check the box or not.
  • Also, the answer to the second q is "yes" for an incorrect PR, and I'm stuck again thinking of the implications of checking the box.

One solution that comes to my mind is to phrase the questions so that the respondent can indicate the correctness of the PR by checking the box. A checked box means "yes, all good", and an unchecked box means "no, something bad", or vice versa.

Besides the two questions above, I also got stuck on these:

  • Have you added or updated tests? (Some PRs don't need any.)
  • How do you know it works?
  • Are there any blockers to merging this PR?
  • Can some changes go in new tickets or PRs?

@teor2345
Copy link
Contributor Author

One solution that comes to my mind is to phrase the questions so that the respondent can indicate the correctness of the PR by checking the box. A checked box means "yes, all good", and an unchecked box means "no, something bad", or vice versa.

I rephrased all the checkboxes in commit 2dff2b3 (#7832) including the others you had concerns about.

@teor2345
Copy link
Contributor Author

  • Have you added or updated tests? (Some PRs don't need any.)

I added a note that irrelevant boxes should be checked. But really it doesn't matter because they are irrelevant, and both the author and reviewer will make sure they are irrelevant.

There's no way to phrase all the items so they are relevant or conditional, unless we want to make the phrasing really complex, or repeat relevance in each one.

Copy link
Member

@upbqdn upbqdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good. Thank you for the refactor. I'm not approving so that we don't merge the PR before others review it.

@teor2345 teor2345 added the A-devops Area: Pipelines, CI/CD and Dockerfiles label Oct 31, 2023
arya2
arya2 previously approved these changes Nov 1, 2023
.github/pull_request_template.md Show resolved Hide resolved
.github/pull_request_template.md Outdated Show resolved Hide resolved
@teor2345
Copy link
Contributor Author

teor2345 commented Nov 1, 2023

@oxarbitrage @gustavovalverde @mpguerra just checking if you have any feedback on the new PR template before it merges?

We can change it later if you don't have time to review now.

Copy link
Contributor

@mpguerra mpguerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teor2345 teor2345 removed the extra-reviews This PR needs at least 2 reviews to merge label Nov 2, 2023
@teor2345
Copy link
Contributor Author

teor2345 commented Nov 2, 2023

We've had 2 reviews, so let's move on with this, and change it later if needed.

mergify bot added a commit that referenced this pull request Nov 2, 2023
@mergify mergify bot merged commit 089f41c into main Nov 2, 2023
69 checks passed
@mergify mergify bot deleted the pr-checklist branch November 2, 2023 21:56
@teor2345 teor2345 mentioned this pull request Nov 5, 2023
41 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-devops Area: Pipelines, CI/CD and Dockerfiles C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants