Skip to main content

A tool that enables educators to easily control push access to GitHub Classroom assignment repositories.

Project description

Stoplight

Lint and Test PyPI PyPI - Python Versions PyPI - Downloads License

stoplight is a tool that enables educators to easily control push access to GitHub Classroom assignment repositories.

Please note that, as of now, stoplight only supports at most 100 student repositories per GitHub Classroom assignment.

Installation

Python 3.10 required. pipx recommended.

pipx install pystoplight

Usage

Authentication

Requires a GitHub personal access token.

Once created, place in your .stoplightrc file, which you can store either in the directory where you execute stoplight or in your home directory.

token = "<TOKEN>"

Or, you can pass it in as the value of the --token option.

stoplight red --token <TOKEN>

Commands

stoplight status

To check the permissions of all student repositories for a GitHub Classroom assignment, use stoplight status.

$ stoplight status --org stoplight-demo --assignment-title assignment
Checking Status  [####################################]  100%
                         assignment                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                       ┃ User            ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion     │ Michionlion     │ write      │
│ assignment-mariakimheinert │ mariakimheinert │ admin      │
└────────────────────────────┴─────────────────┴────────────┘

Note that repositories whose names end with starter or solution or that are the assignment title are excluded.

You can also specify the organization and assignment title in your .stoplightrc.

token = "<TOKEN>"
org = "stoplight-demo"
assignment_title = "assignment"
$ stoplight status
Checking Status  [####################################]  100%
                         assignment                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                       ┃ User            ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion     │ Michionlion     │ write      │
│ assignment-mariakimheinert │ mariakimheinert │ admin      │
└────────────────────────────┴─────────────────┴────────────┘

One way to use the .stoplightrc is to store it in a directory that you use to store starter and solution files for a GitHub Classroom assignment. Then, you can use stoplight from that directory to control the push access to that GitHub Classroom assignment. A .stoplightrc in the directory from which stoplight is executed will be given priority over a .stoplightrc in your home directory.

stoplight red

To disable push access for all students to their GitHub Classroom assignment repositories, use stoplight red.

$ stoplight red
Updating Permissions  [####################################]  100%
Checking Status  [####################################]  100%
                         assignment                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                       ┃ User            ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion     │ Michionlion     │ read       │
│ assignment-mariakimheinert │ mariakimheinert │ admin      │
└────────────────────────────┴─────────────────┴────────────┘

Notice that you cannot update the permissions of students who have admin access to their GitHub Classroom assignment repository. So, if you want to use stoplight, leave the following box unchecked when creating your GitHub Classroom assignment.

Setting

stoplight green

To enable push access for students to their GitHub Classroom assignment repositories, use stoplight green [STUDENTS]....

$ stoplight green Michionlion
Updating Permissions  [####################################]  100%
Checking Status  [####################################]  100%
                     assignment                      
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                   ┃ User        ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion │ Michionlion │ write      │
└────────────────────────┴─────────────┴────────────┘

You can also use the --all option to enable push access for all students.

$ stoplight red
Updating Permissions  [####################################]  100%
Checking Status  [####################################]  100%
                         assignment                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                       ┃ User            ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion     │ Michionlion     │ read       │
│ assignment-mariakimheinert │ mariakimheinert │ admin      │
└────────────────────────────┴─────────────────┴────────────┘
$ stoplight green --all
Updating Permissions  [####################################]  100%
Checking Status  [####################################]  100%
                         assignment                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repo                       ┃ User            ┃ Permission ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ assignment-Michionlion     │ Michionlion     │ write      │
│ assignment-mariakimheinert │ mariakimheinert │ admin      │
└────────────────────────────┴─────────────────┴────────────┘

For additional information, use stoplight --help.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystoplight-1.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystoplight-1.0.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pystoplight-1.0.0.tar.gz.

File metadata

  • Download URL: pystoplight-1.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.11.0-1028-azure

File hashes

Hashes for pystoplight-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f2ef371459f46d45c9294d25926b713e2d7454b64c2470f0fa76e258396601a5
MD5 b4c7fb88f74bf0a4f837e758213eef54
BLAKE2b-256 520566593562704a1d064fc6ed970d6f158467a6fe9ad6474b9910a5a5c4a5f1

See more details on using hashes here.

File details

Details for the file pystoplight-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pystoplight-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Linux/5.11.0-1028-azure

File hashes

Hashes for pystoplight-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ffcaab84b5da570f783c360424c44c6ae8143e9a242217abb10d65d74f3539c
MD5 dd3f15f9af25f791abda52f0dcbdbc12
BLAKE2b-256 a0f92d0f7f7fd5cbd68a4505a1e732588d0e79a47805d23190951f219109f9ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page