nebari-dev / jupyterlab-gallery

A JupyterLab gallery for presenting and downloading examples
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Make sure that this works when ssh key is not available #1

Open krassowski opened 3 months ago

krassowski commented 3 months ago

The git@github.com:nebari-dev/nebari.git format works well when ssh key is setup but not when using an anonymous git user - in that case https://github.com/nebari-dev/nebari.git is needed.

Traceback (most recent call last): File "/srv/conda/envs/notebook/lib/python3.10/site-packages/nbgitpuller/pull.py", line 118, in resolve_default_branch head_branch = subprocess.run( File "/srv/conda/envs/notebook/lib/python3.10/subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['git', 'ls-remote', '--symref', '--', 'git@github.com:nebari-dev/nebari.git', 'HEAD']' returned non-zero exit status 128. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/srv/conda/envs/notebook/lib/python3.10/site-packages/jupyterlab_gallery/gitpuller.py", line 81, in _pull gp = GitPuller(repo, repo_dir, branch=branch, depth=depth, parent=self.settings['nbapp']) File "/srv/conda/envs/notebook/lib/python3.10/site-packages/nbgitpuller/pull.py", line 79, in __init__ self.branch_name = self.resolve_default_branch() File "/srv/conda/envs/notebook/lib/python3.10/site-packages/nbgitpuller/pull.py", line 134, in resolve_default_branch raise ValueError(m) ValueError: Problem accessing HEAD branch: git@github.com:nebari-dev/nebari.git
krassowski commented 2 months ago

We will need to improve URL parsing so that we can switch a valid git URL given in one format to another format but using the protocol that we need. It is easy but probably time consuming and requires writing tests.