jupyterhub / nbgitpuller

Jupyter server extension to sync a git repository one-way to a local path
https://nbgitpuller.readthedocs.io
BSD 3-Clause "New" or "Revised" License
212 stars 86 forks source link

Add a labextension for JupyterLite #318

Closed brichet closed 1 year ago

brichet commented 1 year ago

I open this PR for discussion.

Its purpose is to pull a Github repository using its API, from a labextension. It initiates https://github.com/jupyterlite/jupyterlite/issues/905.

Currently, it manually builds the folder tree and retrieves each file one by one. Github limits unauthenticated user to 60 requests per hour, so getting a full repository will quickly reach this limit.

We could easily add a user token from the URL, but the user will have to configure the URL himself, and this will result in a lack of security. An other solution could be to retireve an archive of the repository, which would only require a single API request.

None of these solutions allows to retain local modifications while updating the contents of the repository.

cc. @fcollonval @jtpio who helped on this PR.

welcome[bot] commented 1 year ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly. welcome You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

yuvipanda commented 1 year ago

This is pretty awesome, and super cool! I think @balajialg and @ericvd-ucb would be interested in this :)

The primary question for me is if this should exist here or in a different repository. It would be great to keep these url compatible, but I think there's basically no code sharing.

Either way, this pushes the envelope in amazing ways! Thank you for working on it!

brichet commented 1 year ago

Thanks @yuvipanda for your comment. Indeed there is no code sharing, and although it can work with Jupyterlab, it's mainly useful for JupyterLite. It can probably move to a dedicated repository, maybe in the jupyterlite project.

yuvipanda commented 1 year ago

What do you think of this being under the jupyterlite, or perhaps a jupyterlite-contrib repo, @jtpio?

jtpio commented 1 year ago

Under jupyterlite would be fine :+1:

Thanks!

brichet commented 1 year ago

Nice, I can open a first PR when the repo is created (I don't have permission to create it). How should we name it ? litegitpuller ?

jtpio commented 1 year ago

FYI @brichet I created https://github.com/jupyterlite/litegitpuller and invited you to be an admin on the repo.

brichet commented 1 year ago

I am closing this PR in favor of a dedicated repository https://github.com/jupyterlite/litegitpuller.