Skip to content

A JupyterLab extension for reviewing GitHub pull requests

License

Notifications You must be signed in to change notification settings

bollwyvl/pull-requests

 
 

Repository files navigation

jupyterlab-pullrequests

Build Status NPM Version Pypi Version Conda Version

A JupyterLab extension for reviewing pull requests.

For now, it supports GitHub and GitLab providers.

Prerequisites

  • JupyterLab 2.x
  • nbdime 2.x

For GitLab, you will need also diff-match-patch

Usage

  • Open the pull request extension from the tab on the left panel

Installation

1. Install the extension with the following steps

With pip:

pip install jupyterlab-pullrequests
jupyter lab build

Or with conda:

conda install -c conda-forge jupyterlab-pullrequests
jupyter lab build

For GitLab, in addition, you will need to

pip install diff-match-patch

Or with conda:

conda install -c conda-forge diff-match-patch

2. Getting your access token

For GitHub, the documentation is there. The token scope must be repo.

For GitLab, the documentation is there. The token scope must be api.

Remember that this token is effectively a password for your account. Do not share it online or check the token into version control, as people can use it to access all of your data.

3. Setting your access token in JupyterLab Pull Requests

You now need to add the credentials you got from the provider to your server configuration file. Instructions for generating a configuration file can be found here. Once you have identified this file, add the following lines to it:

c.PRConfig.access_token = '<YOUR_ACCESS_TOKEN>'

where "<YOUR_ACCESS_TOKEN>" is the string value you obtained above.

If you are using GitLab instead of GitHub, you also need to set the provider:

c.PRConfig.provider = 'gitlab'

Congrats, you did it! Launch JupyterLab and look for the Pull Request tab on the left! 🎉

If you are not using GitHub.com or GitLab.com, you can set the API base URL of your provider with the configurable parameter PRConfig.api_base_url.

Settings

This extension as server settings.

  • PRConfig.access_token: Access token to be authenticated by the provider
  • PRConfig.provider: github (default) or gitlab
  • PRConfig.api_base_url: Provider API base url (default to https://api.github.com except if provider is gitlab then it defaults to https://gitlab.com/api/v4/)

Development

Contributing

If you would like to contribute to the project, please read our contributor documentation.

JupyterLab follows the official Jupyter Code of Conduct.

About

A JupyterLab extension for reviewing GitHub pull requests

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 47.8%
  • TypeScript 45.1%
  • CSS 6.0%
  • JavaScript 1.1%