-
Notifications
You must be signed in to change notification settings - Fork 237
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
Using uri_file_path to properly check for file existence #3972
Conversation
Correcting logical checks inside upload_directory and upload_file, to use schema_salad.ref_resolver.uri_file_path for resolving file:/// paths. This ensures that encoded special characters within the path are properly decoded again.
Thanks @douglowe ! Is there an example path that this fixes? |
My problem path was an output directory we were naming after a mutation (A:Gln2Cys) - the file string for this became: "file:///Users/douglowe/cwl-mutations/A%3AGln2Cys". I could zip up an example script and input molecular structure to send over, if that would help? |
Thanks! I think we can write a fast test that uses |
I've pushed your branch to our repo as https://github.com/DataBiosphere/toil/tree/issues/3973-decode-uri-filepaths to enable CI testing while I write a targeted test |
@douglowe Are you running with |
No - I was running without that option. I've tried enabling it just now, and it failed the same test in upload_file as before. From the help text it looks like this option only deals with allowing spaces and hashes in paths. I've not run any tests to see if my change helps with those or not. |
Even with this change, I think cwltool would need common-workflow-language/cwltool#1579 |
Here is my test setup; does it cover the same use case for you? common-workflow-language/cwl-v1.2#144 |
Ahh - I had not checked I had actually tested this workflow with cwltool - and found that it coped fine with these paths (which made me look more into the Toil code, to see where it might be doing things differently). |
Can you share your workflow with me? |
Yep - you can get a copy here: https://github.com/douglowe/cwl-mutation-example |
https://github.com/DataBiosphere/toil/tree/issues/3973-decode-uri-filepaths has been updated with 7580c73 |
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.
Merging since all of the CWL tests have passed and completed and this only touches the CWL code. Thank you @douglowe . |
Correcting logical checks inside upload_directory and
upload_file, to use schema_salad.ref_resolver.uri_file_path
for resolving file:/// paths. This ensures that encoded
special characters within the path are properly decoded again.
Will fix #3973
Changelog Entry
To be copied to the draft changelog by merger:
Reviewer Checklist
issues/XXXX-fix-the-thing
in the Toil repo, or from an external repo.camelCase
that want to be insnake_case
.docs/running/{cliOptions,cwl,wdl}.rst
Merger Checklist