Home › Forums › Community Summit Discussion Topics › Contributing via GitHub
- This topic has 10 replies, 9 voices, and was last updated 9 years, 6 months ago by Tom J Nowell.
-
AuthorPosts
-
October 21, 2014 at 10:34 am #654092Weston RuterParticipant
For close to a year now we’ve had official Git mirrors for the WordPress SVN repo. As noted in that post:
Note that these Git repositories have different hashes than anything currently mirrored on GitHub. We never did break these hashes as promised a year ago. Next steps will be to figure out how to best mirror these to GitHub (and replace what’s there), which is complicated by now having old and new repositories for core development. Additionally, I’m sure we’ll find at least one glitch in this in a matter of a few days, so consider the next week or so a beta test.
It’s time to get the official Git mirrors on GitHub, and to allow/encourage patches to be submitted to Core via pull requests. Accepting PRs via GitHub would likely involve a new Trac plugin that could automatically discover incoming PRs on GitHub, and attach a PR’s patch to the ticket mentioned in the PR title. When the PR is updated, the patch attached to the ticket should get refreshed. Then when a PR’s particular patch is applied to core, then the PR should get closed. Nacin indicated there is a special repo type on GitHub for mirrors, which would eliminate accidentally merging a PR on GitHub by a collaborator. Patches would still get applied via SVN.
October 21, 2014 at 12:17 pm #654136Scott Kingsley ClarkParticipant+1 on this, as it would allow for easy patch refreshing too, and hopefully encourage more cool tools that could automate the GitHub PR >> SVN commit process.
October 21, 2014 at 12:49 pm #654153Morgan EstesParticipant+1
A couple of things to think about ahead of time:
- Github isn’t Git, and PRs are specific to Github
- What happens when a ticket is updated with a PR from Github and a manual patch from SVN?
- Does a PR from Github that updates a patch automatically mean no more patches named
12345.1.diff
?
Looking forward to see the discussion move along!
October 21, 2014 at 1:33 pm #654168Ryan McCueParticipant+1
Also worth mentioning that PHP created a custom integration between their bug tracker and GitHub’s pull requests to adapt to their existing workflow. It’s not inconceivable that we could copy what they have and integrate it with Trac instead.
October 21, 2014 at 2:05 pm #654184Weston RuterParticipantGithub isn’t Git, and PRs are specific to Github
+1. I did mention this on the What to do about the Plugins Directory, but didn’t include it here: “I suppose .org wouldn’t want to marry to close with GitHub, even if it is the de-facto platform for open source software platform nowadays, so the specific external Git repo used by a plugin could be configurable: GitHub, BitBucket, Google Code, etc.”
So WordPress.org could/should have mirrors on any number of Git hosts. BitBucket also has pull requests. Other hosted Git service communities probably have their own patterns for requesting pulls, even if it is just opening a ticket in their tracker. Adapters can be written for any number of service clones: mirrors in many places.
What happens when a ticket is updated with a PR from Github and a manual patch from SVN?
I think ideally opening a GitHub pull request would automatically create a patch file and attach it to the ticket. Whenever a new commit is pushed to the branch on GitHub, the patch would be refreshed on the ticket. This would be independent of any other patches manually added. This would allow any number of people to create patches from their respective GitHub forks, and each one would have a separate patch file attached to the Trac ticket.
Does a PR from Github that updates a patch automatically mean no more patches named 12345.1.diff
Basically, yes. But I think there would be a different naming convention for patches from pull requests. For instance:
github-westonruter-12345.diff
could be the patch which corresponds to the GitHub pull request for thewestonruter
account from the12345
branch. As noted above, whenever the pull request is updated then this patch file could be updated.Also worth mentioning that PHP created a custom integration between their bug tracker and GitHub’s pull requests to adapt to their existing workflow. It’s not inconceivable that we could copy what they have and integrate it with Trac instead.
Cool! Do you have a source for this?
October 21, 2014 at 2:19 pm #654188Nowell VanHoesenParticipant+1
October 22, 2014 at 8:39 am #654449JenMemberSuggest including Matt in this discussion.
October 22, 2014 at 9:28 am #654470Ryan McCueParticipantCool! Do you have a source for this?
Take a look at a bug with a patch, you’ll notice it also has pull requests. Try adding a new PR to the ticket (
php-src
is the main repository). The code to hook these together is pretty basic, but I imagine it should be possible with Trac with a bit of magic Python. 🙂October 22, 2014 at 9:31 am #654471Tracy LevesqueParticipant+1
October 22, 2014 at 1:42 pm #654569Michael BeilParticipant+1
October 22, 2014 at 5:14 pm #654647Tom J NowellParticipant+1
-
AuthorPosts
- The forum ‘Community Summit Discussion Topics’ is closed to new topics and replies.