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

Add review guidelines to the default PR template #1177

Closed
wants to merge 7 commits into from

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Oct 19, 2020

Motivation

In the Zebra development process, we haven't made explicit decisions about:

  • what should go in a pull request
  • what to do about follow-up tasks
  • what it means for code, documentation, and tests to be complete
  • how we make sure the PR matches any design RFCs
  • what things a reviewer should check

So we've been operating off conventions and assumptions we've learned from previous work.
Usually that works. But sometimes our assumptions clash, and we experience conflicts or confusion.

Solution

This change adds reviewer guidelines, a follow-up section, and design RFC questions to the default GitHub pull request template.

In reviews, we want to focus on this overall goal, so it appears first, in bold:
Does this pull request improve Zebra?

The rest of the change is a list of useful things to check, split up into categories. Each category starts with a key question in bold. These checklists are based on my experience writing and reviewing PRs - please feel free to suggest changes.

I tried to keep each checklist to 3-7 items, so that they are readable.
(I have left the part of the checklist in this PR, so you can see how it is rendered.)

Related Issues

Review Guidelines (for Reviewer)

Does this pull request improve Zebra?

  • Pull Request

    • The pull request is complete
    • The PR contains changes to related code (unrelated changes can be split into another PR)
    • Any follow-up tasks are listed in a GitHub issue
  • Documentation

    • Docs summarise how the template should be used
    • Docs reference specifications or design documents

Zebra Team Approval

Since this is a process change, let's make sure the whole team has reviewed it:

@teor2345 teor2345 added the A-infrastructure Area: Infrastructure changes label Oct 19, 2020
@teor2345 teor2345 added this to Review in progress in 🦓 via automation Oct 19, 2020
@teor2345 teor2345 self-assigned this Oct 19, 2020
Co-authored-by: teor <teor@riseup.net>
oxarbitrage
oxarbitrage previously approved these changes Oct 19, 2020
Copy link
Contributor

@oxarbitrage oxarbitrage left a comment

Choose a reason for hiding this comment

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

I am ok in general as the reviewer guidelines are part of a flexible checklist and they are suggestions we will try to follow, not rules to apply to every PR.

@teor2345
Copy link
Contributor Author

I added design RFC questions, and follow-up work sections, so I've reset everyone's approvals.

Copy link
Contributor

@yaahc yaahc left a comment

Choose a reason for hiding this comment

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

looks good, just a couple of suggestions that are mostly tone oriented

Add or skip tasks as needed.
-->

**Does this pull request improve Zebra?**
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be removed, it reads as confrontational to me. I would expect every PR to improve zebra, otherwise it wouldn't have been written, and focusing on this question in the review checklist could be intimidating for new contributors, as though doubts were being cast upon their ability to improve and contribute to the codebase.

Suggested change
**Does this pull request improve Zebra?**

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goals of a PR and review are not stated, so authors and different reviewers can have conflicting goals - we've had PRs where that's happened.

For example, here is a non-goal:
Have we done everything possible to improve the code? Is it perfect?

And here are some unclear sub-goals:
When is documentation required?
When are tests required?

I'll try to rephrase the goal to be clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
**Does this pull request improve Zebra?**
**Overall Goal: Merged pull requests should improve Zebra.**
<!--
PRs should make incremental improvements to Zebra.
Reviewers can help PR authors write better code.
But PRs don't need to be perfect. It's ok to have follow-up tasks.
-->

Copy link
Contributor

@yaahc yaahc Oct 27, 2020

Choose a reason for hiding this comment

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

I think this still has those same unintentional connotation issues. How do you feel about this version?

- [ ] Description
  - **Does this PR focus on and achieve a clearly defined goal.**
  - The PR description highlights a concrete problem.
  - The solution directly solves the stated problem, rather than circumventing it (as possible).
  - The implemented code is not intended to be thrown away at a later date.

Copy link
Contributor Author

@teor2345 teor2345 Oct 28, 2020

Choose a reason for hiding this comment

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

I'd like to discuss the goals of a PR, because it looks like we have some different goals here.

  • Does this PR focus on and achieve a clearly defined goal.

This is a useful goal, but it overlaps with a later goal:
The PR contains changes to related code (unrelated changes can be split into another PR)

  • The PR description highlights a concrete problem.

I think we should add this goal to the pull request section:
https://github.com/ZcashFoundation/zebra/pull/1177/files#r513157688

  • The solution directly solves the stated problem, rather than circumventing it (as possible).

This is a good goal, but I don't know how to check for it.
If we can find a good way to word it, let's add it to the Code section:
https://github.com/ZcashFoundation/zebra/pull/1177/files#diff-b2496e80299b8c3150b1944450bd81c622e04e13d15c411d291db0927d75fd6bR60

I also think there are good engineering reasons for circumventing some problems - as long as that's documented. See these other items:

  • Any known issues or limitations are documented
  • Any follow-up tasks are listed in a GitHub issue
  • The implemented code is not intended to be thrown away at a later date.

I think this is a non-goal: it's ok to add code that we plan to throw away, as long as that's clearly documented using comments and issues. See these related items:

  • The PR does everything listed in the tickets that it closes, or the designs that it finishes
  • Any follow-up tasks are listed in a GitHub issue
  • Any known issues or limitations are documented

I am also trying to keep the template short.

So I'd like to limit the number of sections and checklist items. Let's also look for things to delete - we should delete anything that isn't a top priority. (We can move details to the Zebra book if we need to.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we delete this checklist item?

The item is ambiguous - it means different things to different people. So a PR template isn't a good place to discuss the goals of a review.

Let's move this discussion to next week's Zebra sync?

Suggested change
**Does this pull request improve Zebra?**

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

.github/pull_request_template.md Outdated Show resolved Hide resolved

- [ ] Pull Request
- **Is the pull request complete: code, documentation, and tests?**
- The PR contains changes to related code (unrelated changes can be split into another PR)
Copy link
Contributor Author

@teor2345 teor2345 Oct 28, 2020

Choose a reason for hiding this comment

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

Suggested change
- The PR contains changes to related code (unrelated changes can be split into another PR)
- The PR description identifies a specific problem and solution
- The PR contains changes to related code (split unrelated changes into another PR)

- Any known issues or limitations are documented

- [ ] Documentation
- **Do the docs summarise how the code should be used?**
Copy link
Contributor Author

@teor2345 teor2345 Oct 28, 2020

Choose a reason for hiding this comment

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

Should we delete this checklist item?

Suggested change
- **Do the docs summarise how the code should be used?**
- **Docs summarise what the code does, and how it should be used**

- [ ] Tests
- **Do the tests make sure the code implements the Zcash consensus rules?**
- Consensus rules have success tests, failure tests, and property tests
- Edge cases and errors have tests
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we delete this checklist item?

Suggested change
- Edge cases and errors have tests

- [ ] Documentation
- **Do the docs summarise how the code should be used?**
- Docs reference specifications or design documents
- New public code has doc comments: `#![deny(missing_docs)]`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to add #![deny(missing_docs)] to every zebra crate (#453), then we can remove this checklist item.

Co-authored-by: teor <teor@riseup.net>
@teor2345
Copy link
Contributor Author

I think this version of the template is far too long.
Reviewer guidelines belong in the book, not a template.

See #1235 for a much shorter version.

@teor2345 teor2345 closed this Oct 30, 2020
🦓 automation moved this from Review in progress to Done Oct 30, 2020
@teor2345 teor2345 deleted the pr-review-guidelines branch March 21, 2022 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-infrastructure Area: Infrastructure changes
Projects
No open projects
🦓
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants