{"action":"created","issue":{"url":"https://api.github.com/repos/StoDevX/cs251-toolkit/issues/5","repository_url":"https://api.github.com/repos/StoDevX/cs251-toolkit","labels_url":"https://api.github.com/repos/StoDevX/cs251-toolkit/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/StoDevX/cs251-toolkit/issues/5/comments","events_url":"https://api.github.com/repos/StoDevX/cs251-toolkit/issues/5/events","html_url":"https://github.com/StoDevX/cs251-toolkit/pull/5","id":178546794,"number":5,"title":"Add Referee support to the toolkit","user":{"login":"hawkrives","id":464441,"avatar_url":"https://avatars.githubusercontent.com/u/464441?v=3","gravatar_id":"","url":"https://api.github.com/users/hawkrives","html_url":"https://github.com/hawkrives","followers_url":"https://api.github.com/users/hawkrives/followers","following_url":"https://api.github.com/users/hawkrives/following{/other_user}","gists_url":"https://api.github.com/users/hawkrives/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkrives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkrives/subscriptions","organizations_url":"https://api.github.com/users/hawkrives/orgs","repos_url":"https://api.github.com/users/hawkrives/repos","events_url":"https://api.github.com/users/hawkrives/events{/privacy}","received_events_url":"https://api.github.com/users/hawkrives/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/StoDevX/cs251-toolkit/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-22T08:07:33Z","updated_at":"2016-09-22T12:52:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/StoDevX/cs251-toolkit/pulls/5","html_url":"https://github.com/StoDevX/cs251-toolkit/pull/5","diff_url":"https://github.com/StoDevX/cs251-toolkit/pull/5.diff","patch_url":"https://github.com/StoDevX/cs251-toolkit/pull/5.patch"},"body":"I made a referee binary-ish-thing in here!\r\n\r\nIt can read either from stdin, or as a singular argument.\r\n\r\n```console\r\nreferee --stdin\r\nreferee [data]\r\n```\r\n\r\nwhere `[data]` is the JSON payload from [Gitlab's `push` event](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/web_hooks/web_hooks.md#push-events).\r\n\r\n1. It then analyzes the commit messages that Gitlab sends us for a very liberal interpretation of a homework/lab reference. (It matches the pattern `([a-z]+) ?(\\d+)`, then checks the first group against `hw`, `homework`, `homeworks`, or `lab`.)\r\n\r\n2. From that set of assignments, it then moves into a random temporary directory, so that we don't accidentally overwrite anything. (For all I know, this could be running multiple checks for the same student at once. If they somehow manage to submit two commits that quickly.)\r\n\r\n3. Within that folder, we clone the repository from stogit, then check out the branch that the commits happened on.\r\n\r\n4. Then we run the toolkit's `record` process on the assignments that we found earlier.\r\n\r\n5. Finally, we remove the cloned folder.\r\n\r\n6. Then, we turn the results into a plain-text, markdown-formatted email (we can make an html formatter if we'd like, later), connect to an smtp server on `localhost`, and send the email (from `cs251-tas@stolaf.edu`, I wasn't sure what to set it as.)\r\n\r\nThe email sending bit is probably going to take some tweaking on your end, @OmarShehata, but it might not – `sendmail` alone on those machines usually works.\r\n\r\nSo, all we should need to do now is:\r\n- Install this on a machine\r\n- Pull down the specs\r\n- Put Joe's ssh key on the machine, so it can pull from stogit\r\n- Hook this up to whatever service is going to pass us the JSON payload from the webhook\r\n- Send a webhook event!"},"comment":{"url":"https://api.github.com/repos/StoDevX/cs251-toolkit/issues/comments/248894852","html_url":"https://github.com/StoDevX/cs251-toolkit/pull/5#issuecomment-248894852","issue_url":"https://api.github.com/repos/StoDevX/cs251-toolkit/issues/5","id":248894852,"user":{"login":"hawkrives","id":464441,"avatar_url":"https://avatars.githubusercontent.com/u/464441?v=3","gravatar_id":"","url":"https://api.github.com/users/hawkrives","html_url":"https://github.com/hawkrives","followers_url":"https://api.github.com/users/hawkrives/followers","following_url":"https://api.github.com/users/hawkrives/following{/other_user}","gists_url":"https://api.github.com/users/hawkrives/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkrives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkrives/subscriptions","organizations_url":"https://api.github.com/users/hawkrives/orgs","repos_url":"https://api.github.com/users/hawkrives/repos","events_url":"https://api.github.com/users/hawkrives/events{/privacy}","received_events_url":"https://api.github.com/users/hawkrives/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T12:52:14Z","updated_at":"2016-09-22T12:52:14Z","body":"~250 of the additions are from https://github.com/StoDevX/cs251-toolkit/blob/382af5ba0b3a72f35b280e18c9e8b58f1187e0a3/test/assignment_parsing_test.py, where I took every commit from my students last semester that referenced an explicit homework/lab, and checked it against my algorithm.\r\n"}}
{"actor":{"display_login":"hawkrives"}}