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
205 stars 84 forks source link

Add a labextension for JupyterLite #318

Closed brichet closed 10 months ago

brichet commented 10 months 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 10 months 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 10 months 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 10 months 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 10 months ago

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

jtpio commented 10 months ago

Under jupyterlite would be fine :+1:

Thanks!

brichet commented 10 months 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 10 months ago

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

brichet commented 10 months ago

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