Skip to content

Conversation

@harshasiddartha
Copy link

Fixes #9978

Changes

  • Fixed path validation in _validate_ri_path to support SHARE storage paths by checking both raw_data_dir (SHARE_ROOT) and data_upload_dir
  • Added related images to backup for SHARE storage tasks

Testing

  • Related images from local file share should now display correctly in the UI
  • Related images are now included in task backups
  • Backups can be imported with related images visible

- Fix path validation in _validate_ri_path to support SHARE storage paths
- Include related images in backup for SHARE storage tasks
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

@zhiltsov-max
Copy link
Contributor

Hi. Thank you for the PR, please add at least 1 test for each problem fixed.

@zhiltsov-max
Copy link
Contributor

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):
Copy link
Contributor

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?

Comment on lines +686 to +687
elif path.startswith(data_upload_dir + os.sep):
path = os.path.relpath(path, raw_data_dir)
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues with related images in tasks from local file share

2 participants