The problem
As I write this we have 1,008 open PRs. Back in September at the core dev sprints we managed to get it below 1000. Unfortunately since then it has climbed back up into quadruple digits.
I think this is bad for two reasons. One, it simply makes it hard to manage the PR queue when it reaches this size. There’s just so much it’s hard to keep things organized.
Two, it’s a bit demotivating for both PR authors and those trying to work on PRs. For PR authors it gives a feeling that their PR will never be looked at (which is honestly quite possible). And for those working PRs it gives a feeling of dread and hopelessness that one could keep up with the PR queue.
The idea
So to try and get the PR queue down to a more manageable size, I have a somewhat radical idea: automatically close all enhancement PRs that only touches code that has no experts. Basically if a PR’s changed files does not have a single match in CODEOWNERS and the PR is deemed an enhancement then Bedevere automatically closes the PR.
I have a few reasons for thinking this isn’t a bad idea. One is that if code lacks an expert then there isn’t someone who necessarily has an API design in their head or how the module is typically used to make it easy to judge whether an enhancement is good or not. Two is that if there isn’t an expert then there isn’t a core dev who necessarily cares enough to review the code, and so the PR is just going to sit there anyway, so we might as well close it. Three is that enhancements typically bring more code, not less, so expanding something that no one is choosing to focus on is not going to ease up the maintenance either. Four is the longer we leave PRs open the more drift there will be and thus the greater the chance the PR won’t be mergeable due to merge conflicts anyway.
Now this idea has nothing to do with enhancement ideas nor bugs in any way. The PRs will also not be deleted and will have a label delineating why they were closed so if someone ever wants to become an expert for a module later and go back through old PRs they can do so.
The suggested plan
If people don’t think this is a crazy idea, I think a general plan of implementing it would be:
- Update bugs.python.org to pull its experts data from
CODEOWNERS
(probably via some comment metadata, e.g.# [importlib]
and all the names on the following line are considered experts for that area, then use the GH -> b.p.o mapping to translate on the bugs.python.org side) - Ask core developers to update their expertise in
CODEOWNERS
- Delete the now-stale experts list from the devguide (and update docs as appropriate)
- Create a new
no experts
label - Update Bedevere to label PRs that don’t touch a single file with an expert with
no experts
- Update the devguide to point out that enhancement PRs for code with no experts will be closed (and explain how to figure that out along with saying “just ask” as a fallback)
- Update the PR template to point this all out as well (is there anywhere else to state this?)
- Update Bedevere to close PRs with a message when a PR has both
no experts
andtype-enhancement
labels - Start going through our backlog of PRs and applying
type
labels as appropriate, letting Bedevere automatically close the PRs
What do people think?
I’m starting the discussion here to keep it initially small and to make sure triagers participate in this discussion as they will be part of the front line in marking PRs as type-enhancement
. If people are generally on board I can then take it to python-dev.