Skip to content

Resolve get_url paths from explicit repo root#11042

Open
puneetdixit200 wants to merge 3 commits into
treeverse:mainfrom
puneetdixit200:fix/11029-get-url-subdir
Open

Resolve get_url paths from explicit repo root#11042
puneetdixit200 wants to merge 3 commits into
treeverse:mainfrom
puneetdixit200:fix/11029-get-url-subdir

Conversation

@puneetdixit200
Copy link
Copy Markdown

Summary

  • resolve relative data-index lookups from the repository root before using the DVC filesystem
  • keep subrepo-aware key lookup anchored at the DVC filesystem root
  • add regression coverage for dvc.api.get_url() when the current working directory is inside a subdirectory of the explicit repo path

Verification

  • python -m pytest tests/func/api/test_data.py::test_get_url_with_explicit_repo_from_subdir -q (failed before implementation)
  • python -m pytest tests/func/api/test_data.py::test_get_url_with_explicit_repo_from_subdir -q
  • python -m pytest tests/func/api/test_data.py -k get_url -q
  • PATH=/tmp/dvc-11029-venv/bin:$PATH python -m pytest tests/func/api/test_data.py -q
  • python -m pytest tests/func/test_get_url.py -q
  • python -m compileall -q dvc/repo/__init__.py tests/func/api/test_data.py
  • python -m ruff check dvc/repo/__init__.py tests/func/api/test_data.py
  • git diff --check

Fixes #11029.

AI-assisted: yes; I reviewed and tested the changes locally.

@github-project-automation github-project-automation Bot moved this to Backlog in DVC May 22, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 22, 2026

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.99%. Comparing base (2431ec6) to head (900d5cc).
⚠️ Report is 203 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11042      +/-   ##
==========================================
+ Coverage   90.68%   90.99%   +0.30%     
==========================================
  Files         504      505       +1     
  Lines       39795    41153    +1358     
  Branches     3141     3263     +122     
==========================================
+ Hits        36087    37446    +1359     
- Misses       3042     3069      +27     
+ Partials      666      638      -28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@puneetdixit200 puneetdixit200 force-pushed the fix/11029-get-url-subdir branch from ed4dd47 to 6877846 Compare May 23, 2026 10:43
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.

dvc.api.get_url() throws error when working directory is a subdirectory of repo path

2 participants