stevebrownlee / learn-ops-client

Learning Platform client application for students and instructors. Tracks student data as they progress through their core and technical learning objectives.
1 stars 8 forks source link

Automate creation of student assessment and group repos #58

Closed stevebrownlee closed 3 months ago

stevebrownlee commented 8 months ago
  1. Generate repo in cohort's org from template (https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-using-a-template). Repo will have UUID ending (for example)
  2. Add the assigned students as collaborators (https://docs.github.com/en/rest/collaborators/collaborators?apiVersion=2022-11-28)
  3. Create a new Github Project if it is a group project (https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects#creating-projects)
  4. Automate the migration of tickets from template repo to the student repo. This will be hefty (error handling, re-migration of failed tickets, reporting, etc)
stevebrownlee commented 4 months ago

To add student - e.g. janaismail - here's the example curl

curl -L \
  -X PUT \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/NSS-Day-Cohort-71/house-of-hummus-Jana-Ismail/collaborators/Jana-Ismail \
  -d '{"permission":"write"}'
stevebrownlee commented 4 months ago

Then use the Slack API to send a message to the student with the URL of the repo and name of assessment.

stevebrownlee commented 4 months ago

Button handler is in StudentInfo.js on line 104

stevebrownlee commented 4 months ago

For generating repo from template

curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/Nashville-Software-School-Assessments/house-of-hummus-api-assessment/generate \
  -d '{"owner":"NSS-Day-Cohort-71","name":"house-of-hummus-${github_handle}","description":"Your assessment repository","include_all_branches":false,"private":false}'