Hi all,
Thanks for the discussion above. My thoughts:
On PRs that aren’t quite ready
Just to check, we know that GitHub has draft PRs? If it’s not ready, but feedback would be helpful, then I’d recommend using that feature.
On PRs
A PR is a proposal to incorporate a set of changes into the codebase. As a result, the conversation on a PR should be about what needs to change about the proposal, if anything, in order to merge the PR. Discussions need to be highly focused on the code at hand, and heavily moderated to stay on topic. So while I agree that there has been lots of discussion on some PRs recently, some of those discussions should be carried out elsewhere - likely using GitHub Discussions. A key thing is knowing when a discussion needs to take place outside of the PR context - a good indicator being if we’re not talking about the code in the review anymore.
PRs take a lot of work to write. And they take a lot of work to review. There has to be patience and understanding on both sides of the equation.
Some general advice for PRs:
- PRs must be as small as possible. Only one thing should change. It’s less to write, and less to review!
- PRs must have appropriate descriptions, and not just say “solves issue 236”.
- PRs must be tested. Without tests, we don’t know if it works, and we won’t know if other changes later on break it. Ideally, we should be able to read the tests as documentation, and if they pass then it’s very easy to accept.
- Pass CI. SuperCollider is a cross platform project, we can’t accept things that work on one platform but not another. Without CI, reviewers can’t be sure that the code is safe to merge into the project.
- Participants in the PR must follow the code of conduct
- Comments should be directed at the code/Project, not people
- Asking for changes means asking for more work. That doesn’t mean we should accept everything, but things like personal opinion shouldn’t be enough of a reason to request a change: always try to provide additional information where necessary to back up assertions and justify the change-request.
- Reviewers are doing their best and it might take a while to get around to it
- Submitters are doing their best and it might take a while to get around to it
- Take discussions away from the PR if necessary
- Code reviews don’t catch bugs: tests do
On procedure
SuperCollider uses the git-flow procedure - which has its issues, but that’s another topic - to ensure that we have effectively two versions:
- Dev: bleeding edge, stuff might be broken, please use it at your own risk and let us know if there are any issues.
- Release: stuff that has been run in Dev long enough that we’re confident it is stable.
This helps remove some pressure on getting the review right the first time - but we still need to aim for good code to begin with.
We have a few other things in place to have safer merges:
- You can’t merge your own PR: no-one can bypass the review process
- It needs to be reviewed by someone with write access: trusted reviewers have write access to merge code
- It should ideally be reviewed by one person, and merged by another
- It needs to pass CI
Currently, some of this might not be configured correctly, please let me know if something doesn’t look right.
I’d like to set up some teams on GitHub that are responsible for certain parts of the codebase, and require reviews from someone in those teams - but I don’t feel I have the authority to do that on my own.
If GitHub Discussions aren’t set up, and we’d like to use it, please let me know and I can sort that.
On next steps
- I’m happy to write a guide for conducting reviews if it’d be useful, but there’s lots of good information already on the wiki.
- We need to fix CI - in my view, all other reviews are questionable until then - nothing should be merged until it’s running again. It should be the main focus of the project at the minute.
“But James, why aren’t you reviewing things?”, I hear you cry.
Apart from the CI issues, it takes a lot of energy. I’m trying. I don’t feel like I have enough authority to make the decisions an approval would require. This is one of the issues with the do-ocracy, but that’s another topic.
We used to do swarm reviews where we’d have a call and review things together. I think those worked well and helped a lot - and can get people used to what it is, so they are very good for bringing people along.
Apologies for another “long James post”, but I really care about this stuff.
Best,
J