Repository navigation
Conversation
Partial (--no-download) repo imports keep their pulled files under .dvc/cache/fs/<protocol>/<token>, where the token came from the dep path and the dep meta. Repo dependencies record no meta, so the token was the same for every revision and every source repo with that path: - after `update --no-download` moved rev_lock, `pull` checked out the previous revision's copy - importing the same path from two repos gave both outputs the first repo's data Use the repo url and rev_lock as the token instead. Fixes treeverse#11111 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11112 +/- ##
==========================================
+ Coverage 90.68% 90.98% +0.30%
==========================================
Files 504 505 +1
Lines 39795 41163 +1368
Branches 3141 3264 +123
==========================================
+ Hits 36087 37452 +1365
- Misses 3042 3072 +30
+ Partials 666 639 -27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11111
Bug
For a
--no-downloadrepo import,dvc pullstores the fetched files under.dvc/cache/fs/<protocol>/<token>. The token is built in_load_storage_from_import(dvc/repo/index.py) astokenize(dep.fs_path, meta_token). ARepoDependencyrecords no meta, someta_tokenis the same constant for every revision and every source repo. That causes two problems:import --no-download --rev v1→pull→update --no-download --rev main→pullchecks out the v1 data..dvc/cache/fsalready has an entry under the same token, so the newrev_lockis never fetched.dvc import --no-download ../srcA data -o aplusdvc import --no-download ../srcB data -o b, then pulling both, givesb/the contents of srcA. Both imports land on the same token.I reproduced both with the CLI on current
main. I only saw this with directory imports. A single-file import with the same steps already picked up the new content.Fix
For repo imports, build the token from the source repo
urlandrev_lockinstead of the empty dep meta. Every source revision now gets its own cache entry. Other imports (import-url, version-aware) are unchanged.Entries written under the old token are just never looked up again. Nothing reads them, but they aren't cleaned up either.
Tests
Two new tests in
tests/func/test_import.py:test_pull_import_no_download_after_update: covers the scenario from the issue.test_pull_import_no_download_same_path_from_two_repos: covers the cross-repo collision.Both fail on
mainand pass with this change.tests/func/test_import.py,test_update.py,test_repo_index.py,test_data_cloud.py,test_import_url.py,test_external_repo.py,test_checkout.py,test_status.pyandtests/func/apipass locally: 278 passed.ruff checkandruff format --checkare clean.❗ I have followed the Contributing to DVC checklist.
📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here. (No docs change needed.)
🤖 Generated with Claude Code