You can add multiple e-mails both to gerrit [0] and github [1]. As long as the e-mail address you are making commits with is added to both accounts, you can likely use your preexisting software directly on the mirrored github repos[2]. For example, my contributions to the citoid repo, all of which were made on gerrit, are also automatically* associated with my github account [3]. You could add a throwaway email to both both gerrit and github and set this as your git email [4] and then your e-mail will not be publicly exposed anywhere. In both gerrit and github, the email you set as your email in git is visible in your commits, as this is a property of git itself, not of gerrit/github in particular.
*Because these are mirrored repositories, contestants *must star the mirrored repository on github* [5] in order to have it associated with their github account, because they didn't open the pull request directly on github. This is the main issue as I see it, as it is an extra step and people are fundamentally bad at following rules :D. [0] https://gerrit.wikimedia.org/r/#/settings/web-identities [1] https://help.github.com/articles/adding-an-email-address -to-your-github-account/ [2] https://github.com/wikimedia [3] https://github.com/wikimedia/citoid/commits?author=mvolz [4] https://help.github.com/articles/setting-your-email-in-git/ [5] https://help.github.com/articles/why-are-my-contribution s-not-showing-up-on-my-profile/ On Fri, Oct 21, 2016 at 10:13 AM, Strainu <strain...@gmail.com> wrote: > Hi everyone, > > I'm organizing a contest for people in Romania willing to contribute > to Wikimedia code. [1] In order to automatically grade the > contributions, we're using a tool already developed be our partners, > ROSEdu, which reviews changes made on github [2][3]. > > The current (github-based) workflow is: > 1. The admins add a number of repositories that qualify for the contest > 2. The paticipants login with their github account (using oauth) > 3. The software retrieves all the pull requests they made to the > relevant projects. > 4. A number of points is assigned for each pull request using a > predefined formula (based on the number of touched lines, if the > change was merged etc.; can by customized) > > I need some guidance on how to replicate this workflow to Wikimedia's > gerrit. > > I've read the API docs [4] and looked at the gerrit uploader [5] and > it seems that retrieving the reviews is fairly straightforward, since > all the reviews seem to be available through unauthenticated access. > > The real issue is how to match the user in the tool with the reviews > without user intervention. Any ideas or advice are appreciated, but > here are my thoughts on the issue: > > 1. Gerrit does not seem to support oauth authentication. I vaguely > remember that the gerrit account used to be linked to the mw.org > account. Is there any way I could use the mw.org auth to retrieve the > gerrit account and/or authenticate to gerrit with it? The gerrit > uploader seems to only use the mw account to put the username in the > committer field and then uploads the change as itself. > > 2. The simplest (although not so secure) solution would be to ask > people to submit their changes using the same email address used for > their github account. This will only work if the user is willing to > make their github address public (I'm not doing that, for instance). > > 3. Another idea would be to match the gerrit account with the github > account. This sounds even less reliable. > > 4. Give up and ask the users to submit the email/user used for gerrit > and check for cheaters manually (this should work as long as the > number of contributors is small) > > Thanks, > Strainu > > [1] https://www.mediawiki.org/wiki/Wikimedia_Challenge_powered_by_ROSEdu > [2] http://challenge.rosedu.org/ > [3] https://github.com/rosedu/challenge > [4] https://gerrit.wikimedia.org/r/Documentation/rest-api.html > [5] https://github.com/valhallasw/gerrit-patch-uploader > > _______________________________________________ > Wikitech-l mailing list > Wikitech-l@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikitech-l _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l