Skip to content

[NOTICE] Aligning on how to fork a repository #119

@woojiahao

Description

@woojiahao

Background

Going off of an ongoing discussion for how we should be supporting forking repositories from hands-ons and exercise download definitions: #78

Core problem: deleting a repository through Github CLI requires the delete_repo scope that does not exist by default (it has to be added via gh auth refresh -s delete_scope).

Changes

As part of this discussion, we made several decisions:

  1. I have rolled out utility functions for the Github CLI in exercise_utils/github_cli.py (here) (more below)
  2. We have decided that the __requires_github__ and requires_github fields will automatically check if the current auth status contains delete_scope. If it doesn't it will immediately fail the operation (here)
  3. By default, when a student sets up the Git-Mastery app, students should auth the delete_scope token scope

Github CLI exercise utility

Right now, we support:

  1. Getting the Github username of a student
  2. Forking a repository
  3. Cloning a repository
  4. Deleting a repository
  5. Creating a repository
  6. Checking if a repository exists

Am I affected by this?

For all contributors, thank you for your patience so far, these are the current open PRs affected by this change. Please check once you have applied the fix.

What do I do?

@damithc Could you help to update the installation instructions with the step to run: gh auth refresh -s delete_repo?

For those pinged, please do the following changes:

  1. Rebase your changes on top of main to get the latest changes: git fetch origin main && git rebase origin/main
  2. Update the download functions using the new utility functions and if you do require deleting a fork, make sure that __requires_github__ is set to True
  3. For all fork names, please use the following naming convention: gitmastery-{upstream repo name} since they might be reused across hands-ons/exercises
  4. Ping me for a re-review.
    Feel free to clarify with me if there are any issues.

Thank you for your time!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions