Hello all,
The last week, I've been working on a web interface to upload patches to Gerrit. This would allow people to contribute, even without using git for more than 'pull' and 'diff'. One could even use the SVN mirror on github to update & generate patches.
It uses OAuth to identify the user to prevent abuse, and the OAuth identified user will be listed as committer name in the commit. The username shown as 'owner' in Gerrit will still be 'Gerrit patch uploader'.
Another reason this is useful is if you're uploading other people's work - I find it annoying to have these listed under 'outgoing reviews', as they are patches I should review, not that I should ask others to review.
It's hosted on Tool Labs: https://tools.wmflabs.org/gerrit-patch-uploader/
Merlijn
Merlijn van Deen wrote:
The last week, I've been working on a web interface to upload patches to Gerrit. This would allow people to contribute, even without using git for more than 'pull' and 'diff'. One could even use the SVN mirror on github to update & generate patches.
This is super-neat. Thanks for working on this. :-)
It uses OAuth to identify the user to prevent abuse, and the OAuth identified user will be listed as committer name in the commit. The username shown as 'owner' in Gerrit will still be 'Gerrit patch uploader'.
This part is a little confusing to me. Is it possible (or desirable) to integrate with wikitech/Labs/Gerrit/Git usernames instead? Integrating with mediawiki.org feels a bit strange.
Possible enhancements:
* allow file upload of a patch; * "upload an patch" --> "upload a patch"; and * perhaps set patch input text area to use a monospace font and/or a code editor.
Thanks again for working on this!
MZMcBride
Hi MZMcBride,
On 13 October 2013 16:41, MZMcBride z@mzmcbride.com wrote:
It uses OAuth to identify the user to prevent abuse, and the OAuth identified user will be listed as committer name in the commit. The username shown as 'owner' in Gerrit will still be 'Gerrit patch uploader'.
This part is a little confusing to me. Is it possible (or desirable) to integrate with wikitech/Labs/Gerrit/Git usernames instead? Integrating with mediawiki.org feels a bit strange.
I have thought of one method -- the uploader could create an ssh key for the user, store it (somewhere, probably in a cookie) and ask the user to add the corresponding public key to the list of accepted public keys. This has the advantage of fixing the ownership issue (as the patch would be owned by the uploading user). However, the user would then still have to create a wikitech account, log in to gerrit, and add an SSH key. The main advantage of using mw.o is that is uses SUL, which means that basically anyone who wants to upload a patch probably already has an account.
Possible enhancements:
- allow file upload of a patch;
This is something on my to-do list, but I have to fiddle a bit with Flask to see how I can handle files.
- "upload an patch" --> "upload a patch"; and
- perhaps set patch input text area to use a monospace font and/or a code
editor.
Fixed! (although the textarea already was monospace for me, but it's now explicit in CSS)
Thanks for your comments :-)
Merlijn
On 13 October 2013 17:05, Merlijn van Deen valhallasw@arctus.nl wrote:
- allow file upload of a patch;
This is something on my to-do list, but I have to fiddle a bit with Flask to see how I can handle files.
And it's implemented! :-)
Merlijn
On 13 October 2013 12:44, Merlijn van Deen valhallasw@arctus.nl wrote:
The last week, I've been working on a web interface to upload patches to Gerrit. This would allow people to contribute, even without using git for more than 'pull' and 'diff'. One could even use the SVN mirror on github to update & generate patches.
Small update on this: I have now also added a function to import patches from Bugzilla. You can paste a bugzilla url (either for an attachment or for the bug) at http://tools.wmflabs.org/gerrit-patch-uploader/bugzilla/fromurl , which is also linked from the front page ('bz patch upload'). It load the patch and propose an author and commit message based on the data available in Bugzilla.
Best, Merlijn
Merlijn van Deen wrote:
On 13 October 2013 12:44, Merlijn van Deen valhallasw@arctus.nl wrote:
The last week, I've been working on a web interface to upload patches to Gerrit. This would allow people to contribute, even without using git for more than 'pull' and 'diff'. One could even use the SVN mirror on github to update & generate patches.
Small update on this: I have now also added a function to import patches from Bugzilla. You can paste a bugzilla url (either for an attachment or for the bug) at http://tools.wmflabs.org/gerrit-patch-uploader/bugzilla/fromurl , which is also linked from the front page ('bz patch upload'). It load the patch and propose an author and commit message based on the data available in Bugzilla.
Very nice. :-)
I looked at your original e-mail and gerrit-patch-uploader itself and couldn't find a link to the source code. Could one be added to the user interface? I think it would help sustain the project.
I completely missed that the "Committer" name gets updated on changes such as https://gerrit.wikimedia.org/r/90002. I looked at the "Owner" field and got very confused. I'm not sure there's anything to be done about this. :-/ A note in the comments or in the commit message (such as a keyword) might have gotten my attention. This might just be me, though.
MZMcBride
On 10/15/2013 11:15 PM, MZMcBride wrote:
I looked at your original e-mail and gerrit-patch-uploader itself and couldn't find a link to the source code. Could one be added to the user interface? I think it would help sustain the project.
I agree a link in the UI would be good. For now, it's https://github.com/valhallasw/gerrit-patch-uploader (per Merlijn's email to Labs).
Matt Flaschen
On 16 October 2013 05:15, MZMcBride z@mzmcbride.com wrote:
I looked at your original e-mail and gerrit-patch-uploader itself and couldn't find a link to the source code. Could one be added to the user interface? I think it would help sustain the project.
As Matt already mentioned: it's at https://github.com/valhallasw/gerrit-patch-uploader . I've added a link there from the front page, and a 'hip' fork me on GitHub ribbon :-)
I completely missed that the "Committer" name gets updated on changes such as https://gerrit.wikimedia.org/r/90002. I looked at the "Owner" field and got very confused. I'm not sure there's anything to be done about this. :-/ A note in the comments or in the commit message (such as a keyword) might have gotten my attention. This might just be me, though.
I can see how it can be confusing, yes. There are three fields in Gerrit: - Owner = the Gerrit username that uploaded the first patchset. There is no way to change this name other than asking an admin. - PS Author = whoever wrote (most of) the patchset. This is a free-form field, and is what you fill in in the 'Author' field of GPU. - PS Committer = whoever uploaded the patchset, but with a free-form user name field. This becomes '[[mw:user:yourusername]] < gerritpatchuploader@gmail.com>"
I have now added a message that is automatically submitted as comment: https://gerrit.wikimedia.org/r/#/c/90698/
If you have any suggestions on how to improve the username mess and/or the comment, please let me know (or send a pull request!)
Merlijn
Merlijn van Deen wrote:
On 16 October 2013 05:15, MZMcBride z@mzmcbride.com wrote:
I looked at your original e-mail and gerrit-patch-uploader itself and couldn't find a link to the source code. Could one be added to the user interface? I think it would help sustain the project.
As Matt already mentioned: it's at https://github.com/valhallasw/gerrit-patch-uploader . I've added a link there from the front page, and a 'hip' fork me on GitHub ribbon :-)
Very nice.
I just wanted to say thank you again for working on this. It's a great tool to have in our arsenal. I was around on IRC on Saturday morning and some poor (very experienced) Wikipedian was having all kinds of trouble committing using Windows. Your tool came to the rescue. :-)
MZMcBride
wikitech-l@lists.wikimedia.org