The Steering Council asked me to implement a change to our core workflow on python/cpython
specifically that will prevent us landing PRs that are new features without a review from another core developer.
Implementation
I have the following approach in mind:
- the “check labels / DO-NOT-MERGE / unresolved review” check on PRs will now require at least one approving core review (with a green checkmark) for any PR with a
type-feature
label.
To ensure this label gets applied, Bedevere will be updated to do the following:
- if we open a PR,
- and that PR touches code (i.e. not only docs / tests / build / CI configuration),
- there is an issue linked to the PR,
- and that issue is not marked with a
type-bug
,type-crash
, ortype-security
label, - then Bedevere will mark this PR with the
type-feature
label.
Rollout
The rollout will be in three stages.
First, mid next week the “check labels” check on PRs will be adapted to require reviews when the label is applied. We can then test whether everything works fine, very few PRs actually have this label applied. We can apply the label manually and see what happens.
Two weeks from now, Bedevere will start labeling PRs with type-feature
if the issue is explicitly labeled as type-feature
. Again, we will be observing how the PRs behave and whether this isn’t disruptive.
Finally, three weeks from now, Bedevere will apply the label according to the process described in “Implementation” above.
Considerations
The goal here is to introduce code review for new functionality not only to catch potential bugs, but more importantly to signal consensus in the new functionality’s direction. Most new features are not PEP-worthy but it doesn’t mean they should be designed, authored, and pushed by a single person. We want to avoid having to revert changes after some deficiency was discovered much later, sometimes by curious users.
We understand certain parts of the project have a single maintainer at best. The Steering Council suggests onboarding another person in this case. You can also ask specific people for review in the PR GUI on GitHub, or shop for reviews on Discord. If all of that is impossible, you can reach out to the Steering Council to discuss exceptions or other options.
We also understand the number of open PRs is growing and any changes in PR processing that slow down merging might be undesirable in this environment. If we’re talking about slowing down addition of new features that aren’t understood by other core team members, then that’s actually by design. This process change will not affect other types of changes.
The process isn’t meant to be airtight. If a core developer changes the classification of an issue and therefore the PR, landing without a review will be possible. Manual removal of the label from a PR will be respected by Bedevere as well. This stems from the general “consenting adults” rule, but is also meant to allow unblocking workflows in case of any edge cases. We hope this safety hatch won’t be abused.
Finally, the rollout is meant to be gradual also to allow all core developers to get familiar with it and raise any concerns they might be having. So if there’s anything we should know, now is the time to speak up.