github-education-resources / classroom

GitHub Classroom automates repository creation and access control, making it easy for teachers to distribute starter code and collect assignments on GitHub.
https://classroom.github.com
1.34k stars 565 forks source link

Add ability to enable branch protection #458

Closed vilhelmen closed 8 years ago

vilhelmen commented 8 years ago

Short version:

An option to enable master branch protection (or all branches?) on import would be nice. With this, student's can't rewrite commit history and mess with the grading process.

Longer version:

My workflow might be a littler weird, since we're trying out the classroom tools for the first time, but I think it's a good start. We're using the sandbox model (because a quarter of the class stole code from others when we used forks the previous semester :/ ) and every student has a single repo, their workspace, for the entire semester since we have limited private repos. The main readme shows them how to setup the source repository as an upstream and I then have to manually add them all to a group that can see the source repository so they can fetch updates and future assignments as the class progresses.

I'm working on an automated submission system that tracks submissions via submodules. Each project has various milestones, and each milestone is given a submission key (ex: P1M1). To submit something, the student creates and pushes a tag whose name is the submission key. The submission script has its own repo and is scheduled to run an hour or so after the due date, with the specific submission key. The script repo has all student repos as submodules, and collects submissions by:

  1. Updating all submodules
  2. Checking out the specified submission tag (and logging if it doesn't exist) for all submodules
  3. Committing the logs and updated submodules and pushing it back to GitHub for grading later

This way, we have one repo to check out to grade (which, hopefully, will be at least partially automated in the future), and we can move through commits easily to see different submissions for the whole class.

I realized this morning that this system would fail if students were able to rewrite submission history between submission time and when we checkout the submission repo for grading since checking out a submodule will check out the student's repo, not our submission repo. While this could be fixed by checking out the repos instead of using submodules, this isn't optimal. I did some testing and enabling branch protection (disabling force pushes) should prevent any sort of shenanigans. Right now branch protection has to be enabled manually for every repo, which is a lot of menu traversal. Having the ability to enable branch prevention at creation will save a lot of time and make sure I don't forget any repos.

johndbritton commented 8 years ago

An option to enable master branch protection (or all branches?) on import would be nice. With this, student's can't rewrite commit history and mess with the grading process.

This is our plan for supporting due dates and a distinct process for submitting assignments.

johndbritton commented 8 years ago

Marked as feedback and closing since there's nothing actionable for us here. We're already planning to bring protected branches in as a feature in the future.