-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BF: Prevent doomed annex calls on files we already know are untracked #7166
Conversation
Fixes datalad#7032. When datalad status --annex is called on an untracked file specifically, it will invoke an annex query that we already know will fail. This commit adds a check if any specifically added file as a path is untracked, and if so, prevent the annex query from being run on it.
Codecov ReportBase: 88.88% // Head: 90.92% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## maint #7166 +/- ##
==========================================
+ Coverage 88.88% 90.92% +2.03%
==========================================
Files 355 355
Lines 46514 46524 +10
Branches 6328 6331 +3
==========================================
+ Hits 41345 42302 +957
+ Misses 5154 4207 -947
Partials 15 15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
v['state'] == 'untracked'] | ||
lgr.debug( | ||
'Skipping %s.get_content_annexinfo() for untracked paths: %s', | ||
repo, paths) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even though only for DEBUG
I wonder if it is wise to include all paths
-- what is there is 1000s of them? do we ever log all paths
. I would just log number of them I guess, or may be we have some helper to show like first N and then ...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I agree that this would be sensible. I guess it never occurred to me because the very next line in that piece of code actually does report all paths:
lgr.debug('Querying %s.get_content_annexinfo() for paths: %s', repo, paths)
I guess this would probably benefit equally from such a helper. But I'm not aware of one...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks alright to me!
Are you planning to address the logging, @adswa? Otherwise I'm fine with merge - logging can be addressed independently.
I don't have a good idea how to do the logging. As it would be necessary also in other parts of that code, I'd be in favour of addressing this outside of this PR. |
No need for BF mentioned in section 'Bug Fixes'
Minor change to changelog - will merge w/o rerunning tests. |
PR released in |
Fixes #7032
This change adds a short check if any file in a list of paths given to a
datalad status --annex
call is untracked. If it is, it is removed from the list of paths given to the annex query, as we already know that this annex call would fail.It does not prevent the status report of being untracked:
If untracked paths are excluded from this query, a trace of it is left in the debug log.
This PR also adds a small test.