-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fwd slash #1089
base: generic-storage
Are you sure you want to change the base?
Fwd slash #1089
Conversation
Can you explain your thoughts around the choice of escape character? |
Codecov Report
@@ Coverage Diff @@
## generic-storage #1089 +/- ##
===================================================
+ Coverage 91.05% 91.05% +<.01%
===================================================
Files 49 49
Lines 7067 7068 +1
===================================================
+ Hits 6435 6436 +1
Misses 632 632 |
I'm not attached to it at all, I used because when I rename a file using the Finder on my mac, it uses a ':', but just shows it as a '/' in the Finder. |
Is there a need for that artificial separator? If we're supporting folders on containers now, the engine could send you the whole path. I'd be worried about unintentionally triggering this. If nothing else we'd need to document it in the gear spec, but gears by design don't have this external concept so it'd be a little awkward. |
@kofalt Would it require significant changes to the engine to send the desired path in the metadata? |
I don't think so, but we'd want to tell the engine to turn that behavior on. Maybe we could add a parameter to the job ticket response that indicates support for the feature. |
We will have to update the resolver (on the client) to handle slashes in filenames. My suggestion would be to allow backslash escaped filenames, which means we would also have to allow escaped backslashes. |
I was about to agree, but that will get really awkward if there are folders on any non-leaf container.
Given an ambiguous non-leaf container A, with children containers & path-embedded files:
The following resolves could occur:
This includes static non-folder paths. For example the string |
We'll have enough information to know if a node is ambiguous when displaying it, so we can even output the escaped versions preemptively so copy & paste works. |
@kofalt I think that works. Instead of backslashes, we could also just allow segments to be quoted when referring to a file, e.g. I think in any scenario, we would unescape path segments by the time they reach the server. |
Yeah, we could do either or both. Maybe instead of sending (from my example) In command-line usage, stuff will probably be quoted because spaces. So it might be weird to say |
This is also weird for exports. Up till now scitran maps to a tree. I really am not a big fan of breaking that. |
What if, for tree-mapping purposes, files are always under |
It is the intention with the new download endpoint work that certain container names will be off limits, including
|
Okay, the only difference I can see is that yours is a forcibly-unambiguous tree, which you'd need for a download generator. Does anyone object to that differing from the resolver tree? |
I don't think they need to be exactly the same, but they could use similar features like explicitly calling out sub documents that deviate from the normal hierarchy like |
Perfect. Let's go with that. |
So I'm not sure if I understand this correctly, but with this case
If the name of the file is |
f1e1e0f
to
ddc0232
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.
Overall I am 👎 on fake-folders in filenames. It's an interesting idea, but we seem to be slowly re-implementing a half-backed file system / VCS (#878, #1082), and the idea of mapping the entire set of files back together to figure out the folders is pretty strange. I vote back to the drawing board on this one.
Fixes #1071
Changes
Any file uploaded via the engine will have the ':' converted to '/' which on download will translate to foldersExample: if the engine uploadsMyFolder:MyFile.exe
, it's name will beMyFolder/MyFile.exe
in Flywheel. On download, MyFile.exe will be a file inside the folder MyFolder.MyFolder/MyFile.exe
, the filename should beMyFolder/MyFile.exe
in the metadata, and the file name in Flywheel will beMyFolder/MyFile.exe
Note: Only applies to engine uploads
Breaking Changes
.../files/info/{FileName}
Review Checklist