stager

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2018 License: MIT Imports: 14 Imported by: 0

README

git-bulk-dl

Software License Travis Go Report Card Godoc

git-bulk-dl is a tool designed to help ls1intum tutors streamline code homework correction submitted to ArTEMiS. It downloads and prepares a selected list of student repositories to your local machine.

Features

  • Download selected list of student repositories
  • Append student names to folder names
  • Remove code committed after the deadline
  • Squash student commits into a single commit
  • Rename project names for better overview in Eclipse
  • Dead-simple and reusable configuration
  • Automatic build pipeline for cross-platform executables (see here)
More Info

Note: We do not collect or process any information. Displayed student names and identifiers are fake. We are compliant with the General Data Protection Regulation (GDPR).

Append student names to repo folders

Rename Repos

Enforce deadline

Some students try to add more commits after the deadline.
git-bulk-dl removes late commits.
Note: This is not bullet proof, since git timestamps can be manipulated!
Enforce deadline

Squash student commits

Students add code to an existing codebase provided from the instructors. It is a lot easier to correct their homework, if the changes made by the students are immediately visible. Therefore, the tools squashes commits after a giving SHA hash. The original history is still available.
Squash commits

Rename Eclipse project names

It is confusing when you open 10 projects with identical names in Eclipse. Therefore, the tools renames each project and appends the students name and identifier.
Rename projects

Install

Get them here.

Source

You need go installed and GOBIN in your PATH. Once that is done, run the command from the repos root folder:

$ go get -d -t -v ./...
$ go run main.go

Configuration

config.json

Rename example.config.json to config.json

cp example.config.json config.json
{
  // Copy & paste the url for the repo from https://artemis.ase.in.tum.de
  // The first 2 %s are placeholders for your TUM credentials
  // The last %s is a placeholder for the students LRZ id
  "url": "https://%s:%s@repobruegge.in.tum.de/scm/eist2018l02bumperss03/eist2018-l02-bumpers-sprint03-exercise-%s.git",
  // Your LRZ id
  "username": "tutor-lrz-idga12dub",
  // Your TUM password
  "password": "my-secret-password",
  // The homework deadline in 'Y-m-d H:i:s' (DateTime)  
  "deadline": "2018-29-04 23:59:59",
  // The SHA hash of Stephan Krusches last commit
  "squash_after": "47ad218377d8b2509c6293823cc6ff2f87ca770a"
}
students.csv

Rename example.students.csv to students.csv

cp example.students.csv students.csv

Open the first and add your students LRZ ids and names

name,id
John Doe,ga77ugu
...

Usage

  1. Place the executable, config.json and students.csv into a desired folder.
  2. a) double click the executable or b) execute from terminal (recommended)
    $ cd ~/homework3correction
    $ ./git-bulk-dl
    
  3. ...
  4. Profit

Implementation

The different operations have been implement with the help of the strategy pattern (s. illustration below).

W3sDesign Strategy Design Pattern UML.jpg
By Vanderjoe - Own work, CC BY-SA 4.0, Link

The different operations/strategies are:

  1. PullOperation
    PullOperation ensures that each accessible repository is up-to-date and in a clean state. This is useful for already locally available repo folders.
  2. DeadlineOperation
    DeadlineOperation ensures that commits after a given deadline are not applied in the local repository. This is useful, since BitBucket does not enforce any deadline whatsoever.
  3. SquashOperation
    SquashOperation squashes all commits after a given SHA hash. This is useful to visualise all changes a student made in a single commit.
  4. RenameProjectOperation
    RenameProjectOperation renames the project name for better overview in Eclipse.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL