-
Notifications
You must be signed in to change notification settings - Fork 36
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 defaultWritable
resource argument.
#63
Conversation
This is meant to address #62 |
I don't think the failures are related to this change? https://dev.azure.com/tpaine154/jupyter/_build/results?buildId=2109&view=logs&j=277539a2-393a-5137-a019-2797c2a2d986&t=ac277736-2906-5b11-7f38-76aeffd34c1e&l=201 |
im ok with this, @telamonian any thoughts? |
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.
I think it's a good idea. The only tradeoff is that it further clutters the constructor signature of FSManager
, but that's not a huge deal at the moment.
@lsowen So far, this PR is looking good. It will need a few minor edits and additions:
-
default_writable
should be camelcase ->defaultWritable
-
defaultWritable
needs to get added to the metadata for each resource. Follow the same pattern as forresource['auth']
here:
jupyter-fs/jupyterfs/metamanager.py
Lines 48 to 49 in 7178369
if 'auth' not in resource: | |
resource['auth'] = 'ask' |
- you'll also need to add
defaultWritable
to the"resource"
schema definition here:
jupyter-fs/js/schema/plugin.json
Lines 11 to 31 in 7178369
"resource": { | |
"description": "Specification for an fs resource", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"name": { | |
"description": "Display name of resource", | |
"type": "string" | |
}, | |
"url": { | |
"description": "A url pointing to an fs resource, as per the PyFilesystem fsurl specification", | |
"type": "string" | |
}, | |
"auth": { | |
"description": "Given any template {{VARS}} in the url, 'ask' (default) to open a dialog box asking for credentials, or `env` to pick up credentials from the server's environment variables", | |
"type": "string", | |
"enum": ["ask", "env", false], | |
"default": "ask" | |
} | |
} | |
} |
This schema defines the user options for jupyter-fs that are settable via the Advanced Settings Editor in jlab.
hi @telamonian, one quick question... The camel cased form ( |
hmm, that's annoying. It looks like snake_case is more prevalent across our python codebase than I'd realized (mostly but not entirely for reasons of compatibility with various Jupyter @lsowen I went back and forth on this for a few minutes. Basically, I hate all of the options. camelCase is the standard convention for jupyterlab option keys. Since that's the only user-facing change in this PR, I think it is important that we use |
I'm guessing the snake case is probably due to the typical python naming convention (https://www.python.org/dev/peps/pep-0008/#function-and-variable-names). I'll update the PR tomorrow AM based on your review comments. Thanks! |
7178369
to
127c69b
Compare
default_writeable
resource argument.defaultWritable
resource argument.
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.
A few minor formatting nits, but overall LGTM!
Once said nits are taken care of, I'll pull this in
127c69b
to
d8f680a
Compare
If a filesystem doesn't support the `access` namespace for `getinfo()`, allow the config to specify whether the returned items should be treated as writable or not.
d8f680a
to
c60685a
Compare
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.
LGTM!
If a filesystem doesn't support the
access
namespace forgetinfo()
, allow the config to specify whether the returneditems should be treated as writeable or not.