Submit Pull Requests to WordPress Core with the GitHub-to-Patch Utility


When Matt Mullenweg asked the audience who has used Git and/or GitHub during his 2014 State of the Word address, the response was almost unanimous. “Whoah, that’s all the hands!” he exclaimed before announcing that core contributors will soon be able to submit pull requests on GitHub.

Two years later, an official patch workflow has not yet been established. In addition to ironing out the logistics, contributors must also take into account what might be lost or gained in the GitHub approach to problem solving. The GitHub pull request collaboration style is markedly different than the lengthy discussions that happen on WordPress Trac.

Nevertheless, WordPress contributors who use GitHub as part of daily life are eager to see progress on an official pipeline for pull requests. In the meantime, Ryan McCue has just launched a utility that allows contributors to submit pull requests to core. GitHub-to-Patch is a proof-of-concept that provides an easy way to submit a pull request as a patch.

The process that McCue outlines in his post involves submitting a pull request to the WordPress/WordPress repo, selecting the request via the utility, and associating the request with the corresponding ticket number. He also advises heading back to the ticket to leave a comment about the patch you added.


“Internally, the utility uses GitHub’s API to get a patch format of the pull request, then uses Trac’s XML-RPC API to upload,” McCue said. “This requires your credentials, and because of cross-origin policy, also requires an intermediary server. I hope to fix this in the future, either by integrating the tool into Trac itself, or by using OAuth with”

McCue clarified on Twitter that his utility is not meant to be a final solution to WordPress/GitHub interactions but rather a stop-gap measure until a better solution is available. He referenced Weston Ruter’s approach that uses Travis CI to handle uploading patches from trusted pull requests to Trac as one of the more elegant examples in the works.

For those with no SVN experience, GitHub-to-Patch significantly lowers the barrier to entry for contributing to core. If you don’t want to use the utility on McCue’s server, the code is available on GitHub and can be installed on your own server.

There are 5 comments

Your email address will not be published. Required fields are marked *