-
Notifications
You must be signed in to change notification settings - Fork 417
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
Implement file management #2022
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7db5998
Implement file management
jonatanklosko b4a5ffb
Up
jonatanklosko 42eb505
Update lib/livebook/migration.ex
jonatanklosko 388f07f
Apply suggestions from code review
jonatanklosko fbc2596
Merge branch 'main' into jk-files
jonatanklosko 8640d39
Up
jonatanklosko 25bafdc
Wording
jonatanklosko e2c9450
Merge branch 'main' into jk-files
jonatanklosko d7121d0
Add deprecation warning when importing a notebook referencing legacy …
jonatanklosko 96f905e
Wording
jonatanklosko dd6d5c3
Merge branch 'main' into jk-files
jonatanklosko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Currently we are using random ids generated when the file system is added, which is fine for settings (local). However, to persist a file link in a notebook, we need a deterministic file system id, so if multiple Livebook users use the same S3 bucket, the file link is exported/imported as expected.
I did the hash so that the id is fixed length and this way it also has a predictable character set. Also, even though buckets generally need authorisation, not listing the URL explicitly sounds like an advantage to me.
I considered a second field/function like
:public_id
, but having both random:id
and the:public_id
is confusing, especially that both should be unique anyway. Also, having a deterministic:id
is what we do for hubs too, so it's better for consistency. To avoid breaking existing settings I added a migration with more details.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.
Looks good to me. I also wonder if the ID should be the bucket itself but this at least avoids us from leaking bucket information.
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.
Yeah, I would still like base64 encode the bucket URL to avoid weird characters in the ID, but not leaking sounds preferable anyway.