Skip to content

Conversation

@kaustubh2332
Copy link

No description provided.

Fixes cvat-ai#9978
- Allow related/context images from SHARE root
- Keep normalized, relative paths for safety
- Preserves traversal protections
@kaustubh2332 kaustubh2332 requested a review from SpecLad as a code owner November 6, 2025 20:09
- Replace generic Exception with ValueError
- Add explicit None check for share_root
- Add validation for empty paths
- Add docstring for clarity
- Improve error messages

Addresses SonarQube reliability issues
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@zhiltsov-max
Copy link
Contributor

Hi, thank you for the PR. Please add at least 1 test to check if the changes work correctly and there are no regressions in the future. Please also keep in mind that there's another PR that tries to address this issue: #9985. I think, it will be better to focus each PR on just 1 problem.

# Get share root directory
share_root = None
if hasattr(db_data, 'get_share_root'):
share_root = db_data.get_share_root()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this method? There is no get_share_root() method in the whole repository.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the comments in the other PR. There are good ideas in both implementations, let's make the combined version.

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.

2 participants