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

A guide to reviewing PRs for merge #72374

Merged
merged 6 commits into from
Mar 23, 2024

Conversation

I-am-Erk
Copy link
Member

Summary

Infrastructure "A guide to reviewing PRs for smoother and more consistent merging"

Purpose of change

Per the doc itself:

As the CDDA project grows, it is becoming harder for the few volunteers in project management to keep constant tabs on what gets merged. Over the years, we've found that there are two possible ways this shakes out. Whenever the lead devs are away for real-life reasons for a while, either we get a huge backlog of PRs, or we wind up with a few things getting merged that really shouldn't have been. This leads to having to revert work by enthusiastic and well-meaning contributors, which we consider an very bad outcome.

Describe the solution

This document aims to do two things to reduce this:

  1. Develop a standardized PR review process and checklist that can be used for complex PRs, and
  2. Through the above, offer an easier way to assess if a PR is ready to be merged.

This is not required for all PRs, and we don't expect that to change. Rather, we hope that a standardized checklist would help contributors and collaborators know what to do to review and approve a complex PR, which in turn would make it much easier for people with merge permissions to go through and assess for merging. Additionally, this checklist could be used as a guide for people making PRs to see if they think they're ready to go. Please don't use this as an excuse to 'rules lawyer' the project; a PR could potentially break all of these points and still be mergeable. These are guidelines.

Describe alternatives you've considered

This isn't strictly necessary. The most important step to preventing the reversions we've seen lately is simply to make sure our people with merge permissions have been more thoroughly trained by the senior devs. However, this has happened twice now, and once was too much. This is another good stage to try to standardize things.

I also really hope that this will help encourage people to be more proactive about reviewing PRs, as that's one of the best overall ways to get the project running more smoothly and to encourage merging.

Testing

n/a

Additional context

This is a living document, feedback on wording and content is welcome.

@I-am-Erk I-am-Erk added the <Documentation> Design documents, internal info, guides and help. label Mar 13, 2024
@github-actions github-actions bot added Info / User Interface Game - player communication, menus, etc. [Markdown] Markdown issues and PRs Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Mar 13, 2024
@Inglonias
Copy link
Contributor

Inglonias commented Mar 13, 2024

It would be good if a link to this document were automatically included in our PR process somewhere visible - A guide is useless if nobody reads it.

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Mar 13, 2024
@Inglonias
Copy link
Contributor

Inglonias commented Mar 13, 2024

If you'll forgive the double post, the line count is easy enough to automate - I would suggest we have a bot count up the number of lines in a PR, and if they exceed the threshold, pop a link to this document in there with a note that this is a PR that needs more careful review.

@I-am-Erk
Copy link
Member Author

It would be good if a link to this document were automatically included in our PR process somewhere visible - A guide is useless if nobody reads it.

I agree that it should be linked somewhere, but the PR blurb itself is already too long and mostly unread. The idea of having a bot that can detect certain common spots it's needed is a good start. A discord shortcut like we have for -fms is also a good idea.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Mar 13, 2024
@Inglonias
Copy link
Contributor

I'm not talking about the PR blurb. I'm talking about automatically leaving a comment on the PR a la our spell checker.

And after thinking over our discord conversation, if you want to require more careful review by senior developers for "sufficiently large" PRs before they are merged, I wouldn't be against that.

@I-am-Erk
Copy link
Member Author

I-am-Erk commented Mar 13, 2024

I think we might be able to do it by checking (1) size (ideally distinguishing c++ from json) and (2) number of labels. The more labels a PR has the more likely it is to require review, particularly now that we have an automatic labelling system.

@oosyrag
Copy link
Contributor

oosyrag commented Mar 13, 2024

I for one, as a newbie, did not know "reviewing" was a thing that anyone could do and thought it was for maintainers/senior devs/bots. So this is nice. Although a link from somewhere relevant would definitely be helpful. There are still docs that I haven't explored or read in the docs directory, two years later lol.

Copy link
Contributor

@Knut-Aage-Hofseth Knut-Aage-Hofseth left a comment

Choose a reason for hiding this comment

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

I wholeheartedly approve of increased transparency and think this is a good step forward.

I have only contributed a couple of lines of JSON, but I read PRs to keep up with experimental changes. More relevant is the fact that I work as a software engineer that has to conform to Company Best Practices for development cycles.

Clear communication and clear expectations are a good thing. I would also wish for clearer guidelines on what feedback should be given when PRs are rejected or reverted. Good communication is key to collaborations, and no well-meaning feedback is ever as bad as the imagined feedback when all one gets is silence.

Copy link
Contributor

@Brambor Brambor left a comment

Choose a reason for hiding this comment

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

I read the thing.

doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
@I-am-Erk
Copy link
Member Author

guidelines on what feedback should be given when PRs are rejected or reverted

That one can be very tricky but it's something we're looking at.

I-am-Erk and others added 2 commits March 14, 2024 12:56
Co-authored-by: Brambor <tondadrd@seznam.cz>
Co-authored-by: Brambor <tondadrd@seznam.cz>
Copy link
Member

@NetSysFire NetSysFire left a comment

Choose a reason for hiding this comment

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

To be honest: It feels like a rambly blog post right now and should be much more concise. Guidelines or rules are hard to read in that format.

I also strongly suggest to use more affirmative language. Specific example: this does NOT mean you should immediately close your large PR - replace it with e.g you may carry on with your PR - however, consider splitting it into parts.
You use "not" and "NOT" a lot in this document where it can be reworded to produce results that are intuitively easier to understand.

If you want to read up on the specifics, see e.g https://blog.wordvice.com/grammar-avoid-double-negatives/ or https://en.wikipedia.org/wiki/Reactance_(psychology). This is partly the classic problem of when you put up a sign onto a fragile object that says "Do not touch", which immediately tempts people to touch it because our brains are dumb (could also be related to call of the void?). Putting "Touching will damage the object" instead is much more effective.

Wording this review right now causes https://xkcd.com/1915/ in me. So I'll just finish for now and submit this review.

doc/reviewing_PR_guide.md Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
Co-authored-by: NetSysFire <59517351+NetSysFire@users.noreply.github.com>
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
@I-am-Erk
Copy link
Member Author

I-am-Erk commented Mar 21, 2024

Thanks for the proofreading. I agree it's a bit verbose, I just tend to be that way; fixing it requires cognitive load that I probably should safe for other things. I'm open to someone making a more detailed editing pass in a follow up PR but I'm out of steam to do it myself on this one.

Copy link
Contributor

@Knut-Aage-Hofseth Knut-Aage-Hofseth left a comment

Choose a reason for hiding this comment

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

I just went through this and changed some instances calling the guidelines rules for consistency.

doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
doc/reviewing_PR_guide.md Outdated Show resolved Hide resolved
adjusted wording slightly from knut-aage-hofseth's version in a few of them.

Co-authored-by: Knut-Aage-Hofseth <15341115+Knut-Aage-Hofseth@users.noreply.github.com>
@kevingranade kevingranade merged commit e507bcf into CleverRaven:master Mar 23, 2024
18 checks passed
@Inglonias Inglonias mentioned this pull request Mar 23, 2024
@I-am-Erk I-am-Erk deleted the reviewer-guide branch April 23, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style <Documentation> Design documents, internal info, guides and help. Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants