add: ignore DVC metadata matched by globs - #11087
Open
tandede wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11087 +/- ##
==========================================
+ Coverage 90.68% 90.98% +0.30%
==========================================
Files 504 505 +1
Lines 39795 41163 +1368
Branches 3141 3268 +127
==========================================
+ Hits 36087 37452 +1365
- Misses 3042 3071 +29
+ Partials 666 640 -26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
Repeated
dvc add --globcalls currently fail because the second call also matches the.dvcstage files generated by the first one. Those metadata paths are passed to output validation and rejected as data outputs.This change filters
*.dvc,dvc.yaml, anddvc.lockonly when they come from wildcard expansion. Explicit metadata targets keep the existing validation error, while repeated glob calls can update already tracked files and add new matches.Fixes #11086.
Test plan
pytest -q— 3051 passed, 11 skipped, 2 xpassedpytest -q tests/func/test_add.py— 68 passed, 1 skippedmypy dvc/repo/add.pypre-commit run --files dvc/repo/add.py tests/func/test_add.pydvc add --glob "data/*"calls succeed after it❗ I have followed the Contributing to DVC checklist.
📖 This fix preserves the documented
--globbehavior and does not require a documentation update.Thank you for the contribution - we'll try to review it as soon as possible. 🙏