A handy tool for TAs in JI to handle works through Gitea, Canvas, and JOJ. https://boyanzh.github.io/Joint-Teapot/
Go to file
Salty Fish d437cb8b18
feat: basic Mattermost integration functionality (#10)
* Fix small error in venv setup guide

* Add functions for mm integration

Implemented: create channels for groups
Implemented: create webhooks on both sides for groups
As for now these functions can only be called from the Python REPL

* Add commands for mm channel/webhook creation

Implemented: archive a given list of channels (unused)

* Add new features to README

* Add filter argument for channel/webhook creation

This filter argument is optional and defaults to an empty string,
meaning no filtering is required. This is helpful for excluding previous
project repos or irrelevant repos.
Also added detection logic to handle an exception where a student is on
MM but not in the target team. (Perhaps we would want to invite that
student immediately?)

* Update README

Clarify platform difference for venv
Restructure Commands & Features section to make room for better docs

* Remove unused function from Canvas worker

* Add gitea domain name and suffix config items

Align with the mm worker, and grant more flexibility
Also changed terminology to be clearer (`domain_name` instead of `url`)

* Code style and quality updates

* Add domain name and suffix config items for Canvas

* Return to using dicts to represent groups

Removed `StudentGroup` at BoYanZh's request
2022-05-27 12:10:08 +08:00
.github/workflows docs: add mkdocs 2021-06-10 23:50:48 +08:00
docs docs: very simple doc 2021-10-13 02:58:50 +08:00
examples feat: joj worker 2021-12-22 23:05:10 +08:00
joint_teapot feat: basic Mattermost integration functionality (#10) 2022-05-27 12:10:08 +08:00
.env.example feat: better logs 2021-09-15 04:00:23 +08:00
.gitattributes chore: fix typo & requirements & misc 2022-03-14 13:04:54 +08:00
.gitignore feat: basic Mattermost integration functionality (#10) 2022-05-27 12:10:08 +08:00
.pre-commit-config.yaml feat: basic Mattermost integration functionality (#10) 2022-05-27 12:10:08 +08:00
LICENSE feat: init 2021-06-09 20:55:50 +08:00
mkdocs.yml docs: add mkdocs 2021-06-10 23:50:48 +08:00
mypy.ini feat: init 2021-06-09 20:55:50 +08:00
pytest.ini feat: init 2021-06-09 20:55:50 +08:00
README.md feat: basic Mattermost integration functionality (#10) 2022-05-27 12:10:08 +08:00
requirements-dev.txt feat: init 2021-06-09 20:55:50 +08:00
requirements.txt feat: basic Mattermost integration functionality (#10) 2022-05-27 12:10:08 +08:00
setup.py feat: basic Mattermost integration functionality (#10) 2022-05-27 12:10:08 +08:00

Joint Teapot

Codacy Badge

A handy tool for TAs in JI to handle works through Gitea, Canvas, and JOJ. Joint is related to JI and also this tool which join websites together. Teapot means to hold Gitea, inspired by @nichujie.

This tool is still under heavy development. The docs may not be updated on time, and all the features are provided with the probability to change.

Getting Started

Setup venv (Optional)

python3 -m venv env # you only need to do that once
# each time when you need this venv, if on Linux / macOS use
source env/bin/activate
# or this if on Windows
source env/Scripts/activate

Install

pip3 install -e .
cp .env.example .env && vi .env # configure environment
joint-teapot --help

For developers

pip3 install -r requirements-dev.txt
pre-commit install
pytest -svv

Commands & Features

archive-all-repos

archive all repos in gitea organization

check-issues

check the existence of issue by title on gitea

checkout-releases

checkout git repo to git tag fetched from gitea by release name, with due date

clone-all-repos

clone all gitea repos to local

close-all-issues

close all issues and pull requests in gitea organization

create-channels-on-mm

create channels for student groups according to group information on gitea. Optionally specify a prefix to ignore all repos whose names do not start with it.

Example: python3 -m joint_teapot create_channels_for_groups p1 will fetch all repos whose names start with "p1" and create same-name channels on mm for these repos. Members of a repo will be added to the corresponding channel.

create-issues

create issues on gitea

create-personal-repos

create personal repos on gitea for all canvas students

create-teams

create teams on gitea by canvas groups

create-webhooks-for-mm

Create a pair of webhooks on gitea and mm for all student groups on gitea, and configure them so that updates on gitea will be pushed to the mm channel. Optionally specify a prefix to ignore all repos whose names do not start with it.

Example: python3 -m joint_teapot create-webhooks-for-mm p1 will fetch all repos whose names start with "p1" and create two-way webhooks for these repos. All repos should already have same-name mm channels. If not, use create-channels-on-mm to create them.

get-no-collaborator-repos

list all repos with no collaborators

get-public-keys

list all public keys on gitea

get-repos-status

list status of all repos with conditions

invite-to-teams

invite all canvas students to gitea teams by team name

prepare-assignment-dir

prepare assignment dir from extracted canvas "Download Submissions" zip

upload-assignment-grades

upload assignment grades to canvas from grade file (GRADE.txt by default), read the first line as grade, the rest as comments

License

MIT