Fix remote tracking does not support SSH#256
Fix remote tracking does not support SSH#256VikramGoyal23 merged 15 commits intogit-mastery:mainfrom
Conversation
|
Hi @SAN-MUYUN, thank you for your contribution! 🎉 This PR comes from your fork Before you request for a review, please ensure that you have tested your changes locally! Important The previously recommended way of using Please read the following instructions for the latest instructions. PrerequisitesEnsure that you have the Testing stepsIf you already have a local Git-Mastery root to test, you can skip the following step. Create a Git-Mastery root locally: gitmastery setupNavigate into the Git-Mastery root (defaults to cd gitmastery-exercises/Edit the {
# other fields...
"exercises_source": {
"username": "SAN-MUYUN",
"repository": "git-mastery-exercises",
"branch": "enhancement/HTTPS-and-SSH-auth"
}
}Then, you can use the gitmastery download <your new change>
gitmastery verifyChecklist
Important To any reviewers of this pull request, please use the same instructions above to test the changes. |
|
@VikramGoyal23 Are you reviewing this PR? If you're not free, someone else can also review it so that we don't block on this. Let's avoid self-requesting reviews and leaving it hanging. |
VikramGoyal23
left a comment
There was a problem hiding this comment.
LGTM, just some minor nits! I can add these via the GitHub GUI.
exercise_utils/github_cli.py
Outdated
| """returns GitHub CLI's preferred Git transport protocol""" | ||
| result = run(["gh", "config", "get", "git_protocol"], verbose) | ||
| if result.is_success(): | ||
| protocol = result.stdout.splitlines()[0] |
There was a problem hiding this comment.
Just in case, can we add a strip() after [0]?
hands_on/populate_remote.py
Outdated
|
|
||
| def _setup_local_repository(verbose: bool): | ||
| os.makedirs("things") | ||
|
|
There was a problem hiding this comment.
This extra whitespace seems unnecessary, did your linter add this in?
Fixes #244
So far, only the hands-ons are affected. Exercises are not affected until Tour 8, where pushing to remote repo is required.
List of updated
hands-onsare listed in the Incident Review below.Solution:
Implemented method
get_github_git_protocolto obtain the GitHub preferred protocol (httpsorssh)Implemented method
get_remote_urlto get the correct remote url for a repo.get_remote_urlcallsget_github_git_protocolto check for the protocol that user is using, before configuring the url accordingly.for some hands-ons where forking is required, and we push to the forked repo:
clone_repo_with_ghremove_remote("upstream", verbose)for hands-on where we have to do
git remote add originmanually:get_remote_urlbefore adding it manually.Tested using both
httpsandsshprotocol, no unexpected behavior so far.refer to this Incident Review for details