-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configuration to exclude paths #1163
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
@fcollonval , a few of the tests have failed and it seems because I'm accessing the settings through Do you have any other recommendations for this?
I tried this as well but this doesn't work because |
One option could be to expose diff --git a/jupyterlab_git/git.py b/jupyterlab_git/git.py
--- a/jupyterlab_git/git.py
+++ b/jupyterlab_git/git.py
@@ -1750,3 +1750,7 @@ class Git:
elif self._GIT_CREDENTIAL_CACHE_DAEMON_PROCESS.poll():
self.ensure_git_credential_cache_daemon(socket, debug, True, cwd, env)
+
+ @property
+ def excluded_paths(self):
+ return self._config.excluded_paths
diff --git a/jupyterlab_git/handlers.py b/jupyterlab_git/handlers.py
--- a/jupyterlab_git/handlers.py
+++ b/jupyterlab_git/handlers.py
@@ -43,7 +43,7 @@ class GitHandler(APIHandler):
super().prepare()
path = self.path_kwargs.get("path")
if path is not None:
- excluded_paths = self.git._config.excluded_paths
+ excluded_paths = self.git.excluded_paths
for excluded_path in excluded_paths:
if re.match(excluded_path, path):
self.set_status(404) |
I was planning to write a test for this in Also, another question I have is -
Where do |
You can override the default server configuration by overriding the Line 7 in a08a929
The fixture requested are provided by the jupyter Server pytest Plugin (loaded in the file linked above). This makes it quite convenient to create pytest for Jupyter server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @divyansshhh
I made some suggestions to improve the code and add some more documentation.
Co-authored-by: Frédéric Collonval <[email protected]>
Co-authored-by: Frédéric Collonval <[email protected]>
Co-authored-by: Frédéric Collonval <[email protected]>
Co-authored-by: Frédéric Collonval <[email protected]>
Co-authored-by: Frédéric Collonval <[email protected]>
Co-authored-by: Frédéric Collonval <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @divyansshhh
Resolves #1162