-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix issue #9978: Support related images from local file share #9985
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
base: develop
Are you sure you want to change the base?
Conversation
- Fix path validation in _validate_ri_path to support SHARE storage paths - Include related images in backup for SHARE storage tasks
|
|
Hi. Thank you for the PR, please add at least 1 test for each problem fixed. |
|
Please also keep in mind that there's another PR that tries to address this issue: #9984. I think, it will be better to focus each PR on just 1 problem. |
| raw_data_dir = db_data.get_raw_data_dirname() | ||
|
|
||
| def _validate_ri_path(path: str) -> str: | ||
| if os.path.isabs(path): |
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 also think it would be better to normalize any input paths, not only relative ones. Could you add this conversion as well?
| elif path.startswith(data_upload_dir + os.sep): | ||
| path = os.path.relpath(path, raw_data_dir) |
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'm not sure we have a use case for this branch at the moment. If the task is local or from cloud, the data is supposed to be in the upload dir. The only other case is the file share, in which case the files are supposed to be there. Both these cases should be covered just by using get_raw_data_dirname instead of get_upload_dirname. I suggest to keep only 1 branch and remove the data_upload_dir variable.



Fixes #9978
Changes
_validate_ri_pathto support SHARE storage paths by checking bothraw_data_dir(SHARE_ROOT) anddata_upload_dirTesting