jupyterlab / jupyterlab-github

GitHub integration for JupyterLab
BSD 3-Clause "New" or "Revised" License
413 stars 106 forks source link

Viewing private repos #55

Closed wookasz closed 6 years ago

wookasz commented 6 years ago

I'm trying to view private repos for my org. I'm running JupyterHub in minikube with JupyterLab configured. I've also installed both the lab as well as server extensions by adding the following to my userimage dockerfile

RUN jupyter labextension install @jupyterlab/github

RUN pip install jupyterlab_github
RUN jupyter serverextension enable --sys-prefix jupyterlab_github

I've confirmed that the python package version is 0.6 and I am running jupyterlab version 0.32.0.

I've added my access token to helm values file as:

hub:
  extraEnv:
    JUPYTER_ENABLE_LAB: 1
  extraConfig: |
    c.KubeSpawner.cmd = ['jupyter-labhub']
    c.GitHubConfig.access_token = 'XXXXXXXXXXXXXXXXXXXXXXXX'

I cannot see any of the private repos.

I'm also seeing sporadic rate-limiting which makes me believe that possibly the server extension is not properly installed?

Any guidance would be appreciated.

ian-r-rose commented 6 years ago

Sorry you are running into troubles. Can you check the Javascript console in your browser to see if there are any errors being output there?

wookasz commented 6 years ago

Thanks for the quick response. Right now looks like i'm getting a 403 (rate limited) when fetching form the orgs endpoint.

Also

promise.js:44 Uncaught (in promise) Error: Canceled
    at t.dispose (future.js:155)
    at default.js:384
    at Map.forEach (<anonymous>)
    at e.dispose (default.js:383)
    at e.dispose (default.js:244)
    at index.js:245

But haven't looked into it enough to see if that one is related.

ian-r-rose commented 6 years ago

Can you print the 403 error here? I'd like to know if it is coming from GitHub directly, or through the notebook server proxy.

That second error should be unrelated, I think.

ian-r-rose commented 6 years ago

If the server extension is installed, I suspect there is a problem withe your access token, or it is not being loaded into the single-user notebook server as you expected. Can you verify that it is in the user-level jupyter_notebook_config.py?

dhirschfeld commented 6 years ago

It looks like the config you're setting is the in the jupyterhub_config.py file and not the jupyter_notebook_config.py.

I'm not sure how you'd set notebook specific config in k8s though. You might get some advice in that regard in the jupyterhub gitter channel.

wookasz commented 6 years ago

Thanks, yeah the 403s were unrelated I think. I just refreshed the page now and no 403s anymore, but still no private repos. I will check with jupyterhub gitter channel. Thanks @dhirschfeld for the pointer.

ian-r-rose commented 6 years ago

@wookasz Did you figure out how to seed the jupyter_notebook_config.py file?

ian-r-rose commented 6 years ago

Closing as answered. Feel free to comment here if you don't think that is the case.

gabrielvrl commented 4 years ago

i running by this error: c.GitHubConfig.client_id: command not found

dont know how to proceed can anyone help me? Cant see private repos too

ian-r-rose commented 4 years ago

@gabrielvrl You should now be authenticating using the personal access token approach: https://github.com/jupyterlab/jupyterlab-github#getting-an-access-token-recommended

Can you try that and let me know if it fixes your problem?

gabrielvrl commented 4 years ago

i did it. I also did pip install jupyterlab_github and jupyter serverextension enable --sys-prefix jupyterlab_github, but cant run c.GitHubConfig.access_token = '< YOUR_ACCESS_TOKEN >', even though im putting my access token, actually it doesnt matter if im putting it or not, because it's not founding the command, as i said. c.GitHubConfig.client_id: command not found

ian-r-rose commented 4 years ago

c.GitHubConfig.access_token is not a command, but a config value. Are you trying to run it on the command line?

gabrielvrl commented 4 years ago

oh, i was running it on the command line :/

gabrielvrl commented 4 years ago

i guess im not understanding what im suppose to do withc.GitHubConfig.access_token

ian-r-rose commented 4 years ago

You should create a config file as described here: https://jupyter-notebook.readthedocs.io/en/stable/config.html#config-file-and-command-line-options and then add the access token to it.

gabrielvrl commented 4 years ago

thanks, my mistake. but i think maybe the link on the repository is the wrong one?

https://github.com/jupyterlab/jupyterlab-github#getting-an-access-token-recommended -> "You now need to add the credentials you got from GitHub to your notebook configuration file. Instructions for generating a configuration file can be found here. Once you have identified this file, add the following lines to it:", if you click on "here" (before .Once you...) its opening that link: https://jupyter-notebook.readthedocs.io/en/stable/config_overview.html#configure-nbserver , but i think it should open that one that you just send, right?

ian-r-rose commented 4 years ago

I suppose both have the necessary information, but the one Iinked here has a bit more detail. PRs welcome to update the link!

prashant71ht commented 4 years ago

Hello @ian-r-rose , I did all the mentioned steps , but I am not getting Github tab after launching JupyterLab Notebook.

davidrs commented 4 years ago

@prashant71ht it works for me if the param is called c.GitHubConfig.github_access_token not c.GitHubConfig.access_token I think it's a typo in the docs (or something changed across versions).