PEP 462 – Core development workflow automation for CPython | peps.python.org
PEP 462 – Core development workflow automation for CPython PEP 462 – Core development workflow automation for CPython Author : Alyssa Coghlan <ncoghlan at gmail.com> Status : Withdrawn Type : Process Requires : 474 Created : 23-Jan-2014 Post-History : 25-Jan-2014, 27-Jan-2014, 01-Feb-2015 Table of Contents Abstract PEP Withdrawal Rationale for changes to the core development workflow Current Tools Proposal Deferred Proposals Suggested Variants Perceived Benefits Technical Challenges Kallithea vs Gerrit Mercurial vs Gerrit/git Buildbot vs Jenkins Handling of maintenance branches Handling of security branches Handling of NEWS file updates Stability of “stable” Buildbot slaves Intermittent test failures Custom Mercurial client workflow support Social Challenges Practical Challenges Open Questions Next Steps Acknowledgements Copyright Abstract This PEP proposes investing in automation of several of the tedious, time-consuming activities that are currently required for the core development team to incorporate changes into CPython.
This proposal is intended to allow core developers to make more effective use of the time they have available to contribute to CPython, which should also result in an improved experience for other contributors that are reliant on the core team to get their changes incorporated. PEP Withdrawal This PEP has been withdrawn by the author in favour of the GitLab based proposal in PEP 507 . If anyone else would like to take over championing this PEP, contact the core-workflow mailing list Rationale for changes to the core development workflow The current core developer workflow to merge a new feature into CPython on a POSIX system “works” as follows: If applying a change submitted to bugs.python.org by another user, first check they have signed the PSF Contributor Licensing Agreement.
If not, request that they sign one before continuing with merging the change. Apply the change locally to a current checkout of the main CPython repository (the change will typically have been discussed and reviewed as a patch on bugs.python.org first, but this step is not currently considered mandatory for changes originating directly from core developers). Run the test suite locally, at least make test or ./python -m test (depending on system specs, this takes a few minutes in the default configuration, but substantially longer if all optional resources, like external network access, are enabled).
Run make patchcheck to fix any whitespace issues and as a reminder of other changes that may be needed (such as updating Misc/ACKS or adding an entry to Misc/NEWS) Commit the change and push it to the main repository. If hg indicates this would create a new head in the remote repository, run hg pull --rebase (or an equivalent). Theoretically, you should rerun the tests at this point, but it’s very tempting to skip that step.
After pushing, monitor the stable buildbots for any new failures introduced by your change. In particular, developers on POSIX systems will often break the Windows buildbots, and vice-versa. Less commonly, developers on Linux or Mac OS X may break other POSIX systems. The steps required on Windows are similar, but the exact commands used will be different. Rather than being simpler, the workflow for a bug fix is more complicated than that for a new feature!
New features have the advantage of only being applied to the default branch, while bug fixes also need to be considered for inclusion in maintenance branches. If a bug fix is applicable to Python 2.7, then it is also separately applied to the 2.7 branch, which is maintained as an independent head in Mercurial If a bug fix is applicable to the current 3.x maintenance release, then it is first applied to the maintenance branch and then merged forward to the default branch.
Both branches are pushed to hg.python.org at the same time. Documentation patches are simpler than functional patches, but not hugely so - the main benefit is only needing to check the docs build successfully rather than running the test suite. I would estimate that even when everything goes smoothly, it would still take me at least 20-30 minutes to commit a bug fix patch that applies cleanly. Given that it should be possible to automate several of these tasks, I do not believe our current practices are making effective use of scarce core developer resources.
There are many, many frustrations involved with this current workflow, and they lead directly to some undesirable development practices. Much of this overhead is incurred on a per-patch applied basis. This encourages large commits, rather than small isolated changes. The time required to commit a 500 line feature is essentially the same as that needed to commit a 1 line bug fix - the additional time needed for the larger change appears in any preceding review rather than as part of the commit process.
The additional overhead of working on applying bug fixes creates an additional incentive to work on new features instead, and new features are already inherently more interesting to work on - they don’t need workflow difficulties giving them a helping hand! Getting a preceding review on bugs.python.org is additional work, creating an incentive to commit changes directly, increasing the reliance on post-review on the python-checkins mailing list.
Patches on the tracker that are complete, correct and ready to merge may still languish for extended periods awaiting a core developer with the time to devote to getting it merged. The risk of push races (especially when pushing a merged bug fix) creates a temptation to skip doing full local test runs (especially after a push race has already been encountered once), increasing the chance of breaking the buildbots. The buildbots are sometimes red for extended periods, introducing errors into local test runs, and also meaning that they sometimes fail to serve as a reliable indicator of whether or not a patch has introduced cross platform issues.
Post-conference development sprints are a nightmare, as they collapse into a mire of push races. It’s tempting to just leave patches on the tracker until after the sprint is over and then try to clean them up afterwards. There are also many, many opportunities for core developers to make mistakes that inconvenience others, both in managing the Mercurial branches and in breaking the buildbots without being in a position to fix them promptly.
This both makes the existing core development team cautious in granting new developers commit access, as well as making those new developers cautious about actually making use of their increased level of access. There are also some incidental annoyances (like keeping the NEWS file up to date) that will also be necessarily addressed as part of this proposal. One of the most critical resources of a volunteer-driven open source project is the emotional energy of its contributors.
The current approach to change incorporation doesn’t score well on that front for anyone: For core developers, the branch wrangling for bug fixes is delicate and easy to get wrong. Conflicts on the NEWS file and push races when attempting to upload changes add to the irritation of something most of us aren’t being paid to spend time on (and for those that are, contributing to CPython is likely to be only one of our responsibilities).
The time we spend actually getting a change merged is time we’re not spending coding additional changes, writing or updating documentation or reviewing contributions from others. Red buildbots make life difficult for other developers (since a local test failure may not be due to anything that developer did), release managers (since they may need to enlist assistance cleaning up test failures prior to a release) and for the developers themselves (since it creates significant pressure to fix any failures we inadvertently introduce right now , rather than at a more convenient time, as well as potentially making hg bisect more
The rest of this page is on the live site.