Comments (4)
Holy smokes, @rjglasse! I really appreciate that. It saves me a good couple of hours of faffing around trying to figure out where to start.
from repobee.
Hi Connor,
Not at present with the default commands.
However, Repobee was designed with a plugin architecture that allows you to extend it to fit your context. Here's the documentation: https://docs.repobee.org/en/stable/repobee_plug/index.html#repobee-plug - it has some nice examples to help you get started.
I guess you want to have a plugin that uses a post-clone hook
to check if the latest commit author matches the prefix of the repo. A more robust alternative would test that the commit author is not one of the repo template authors / teachers, where there may be multiple student usernames in a single repo, or a single student is managing to use multiple identities.
Here's a bit of Python/Bash that will grab the username, assuming you are in the repo's directory.
import subprocess
author = subprocess.check_output("git log -1 --pretty=format:'%an'", shell=True)
print(author.decode("utf-8").lower())
There might be a smarter Repobee way to get the last commit author (@slarse?)
Let us know if you want to have a bash at it, or perhaps we can whip one up :)
from repobee.
Alright, this is my first actual attempt at a plugin (started.py), but I like the use case so win-win for me. Here's something that works, but probably needs some improvement:
import repobee_plug as plug
import subprocess
import os
@plug.repobee_hook
def post_clone(repo: plug.StudentRepo, api: plug.PlatformAPI):
os.chdir(repo.path)
last_commit_author = subprocess.check_output("git log -1 --pretty=format:'%an'", shell=True).decode("utf-8").strip().lower()
teachers = ["glassey"]
if last_commit_author in teachers:
print("[Repo Status]", repo.name, "has no student activity. The last commit was made by", last_commit_author)
And the trace would look like this for a known non participating student, and silent if student has started:
% repobee -p started.py repos clone -a task-1 -s xxxx --update-local
Cloning into student repos ...
Progress batch 1: 100%
Executing post_clone hooks:
[Repo Status] xxxx-task-1 has no student activity. The last commit was made by glassey
Executing post_clone hooks: 100%
Probably smart to export to file, JSON or CSV if you have a lot of students :-)
from repobee.
This is indeed a very good use case for a plugin, thanks @rjglasse for providing a prototype!
There might be a smarter Repobee way to get the last commit author (@slarse?)
Nope, RepoBee doesn't deal with commits at present. However, GitPython provides a pretty nice Python interface to Git, I'd probably use that for better ergonomics. I think I use it somewhere in RepoBee but I forget where at the moment, but a plugin is free to have any dependencies it likes to as long as they don't conflict with the core dependencies (which is why I try to keep the amount of core dependencies tiny).
from repobee.
Related Issues (20)
- Enable more pylint rules to improve code style consistency
- System test `test_end_all_reviews` failing HOT 4
- `issues list` throws Error when issue body is empty HOT 4
- `reviews check` fails to map lowercase usernames HOT 4
- Refactor the GitLab system tests
- Create organization HOT 5
- Systematic way to update Docker Hub HOT 4
- Add support for configurable arguments in mutex groups HOT 1
- Deprecate the `--students-file` option and let `--students` suppleant it HOT 1
- Make it possible to deprecate options
- Plugin core commands allow both `--students` and `--students-file` options to be specified
- Handle GitHub rate limiting HOT 11
- Replace home-built Retry-After code with urllib3's builtin support HOT 3
- False negatives: repobee reviews check HOT 6
- Reviews: Timeouts during review assignments not able to "resume from previous" HOT 9
- Can't find student repositories when updating HOT 2
- Drop support for Python 3.7 HOT 2
- Using tamanager plugin causes `repos setup` to hit secondary rate limit in GitHub API HOT 1
- Rewrite core commands using the plugin architecture
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from repobee.