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