-
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: status: Provide special treatment of "." path #3325
Conversation
When status receives "." as the path, rev_resolve_path() resolves the path to the dataset (either to the one explicitly provided as an argument or to the one inferred from the current directory). So, using "." means we get the reference dataset as the path. If a call includes an explicitly specified dataset _and_ "." as a path argument, whether the call succeeds or fails depends on whether the specified dataset is a subdataset. When the reference dataset isn't a subdataset, status queries within the dataset. When it is a subdataset, the call fails with a message saying the subdataset is not underneath itself: $ datalad status -d. . [ERROR ] dataset containing given paths is not underneath the reference dataset [...] Even though the desired behavior could be achieved by dropping "." as a path argument, let's make using "." as the path argument work because * it is consistent with the non-subdataset case, and it won't be obvious to a caller why it works in one case but not the other * based on the use of "." as a path argument in other places in datalad, it's be reasonable for a caller to expect, say, subds.status(".") to work As shown by the added run test, this fixes a regression where calling 'datalad run' failed from within a subdataset, which was introduced by eba3ccf (BF: run: Save results with rev-save, 2019-03-18) because the call to rev_save() retained the path="." that is necessary for the add() call.
I am yet to fully digest what is proposed exactly, but giving special treatment to what could be a legit path, possibly programmatically computed, sounds like a trouble |
Hrm, I'm baffled by that AppVeyor failure. It's happening in the new run test: https://ci.appveyor.com/project/mih/datalad/builds/23817228/job/uwqkpr8n753vh1ue#L1365
Then, if I revert all the changes from this PR except that run test, commenting the actual https://ci.appveyor.com/project/mih/datalad/build/job/01c6var48gbjpyrw#L1398
Dunno. |
Confused: is there ability to direct output to a file on command line in Windows with |
Ping #3247 where the modified code is RF'ed into a standalone function. |
Yes, of course. However, the syntax is slightly different, so those examples are carefully chosen to yield equivalent results across platforms. |
Sadly, this is "normal". We have a bunch of tests that crash like that. Note, it doesn't lead to a test error, but crashes the test harness itself. You will find examples of
throughout the code base, where I simply skip individual pieces that lead to this failure. I could not figure out why it happens, the internet only has speculation, and I could not replicate any of those failures in local VMs or real Windows machines. |
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.
I think this is a sensible move and I agree with the rational.
Thanks, @mih, for pointing to similar failures. https://ci.appveyor.com/project/mih/datalad/builds/23817228 datalad#3325 (comment)
Codecov Report
@@ Coverage Diff @@
## master #3325 +/- ##
===========================================
+ Coverage 45.26% 91.14% +45.87%
===========================================
Files 260 263 +3
Lines 34209 34253 +44
===========================================
+ Hits 15486 31219 +15733
+ Misses 18723 3034 -15689
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #3325 +/- ##
===========================================
+ Coverage 45.26% 90.95% +45.68%
===========================================
Files 260 263 +3
Lines 34209 34235 +26
===========================================
+ Hits 15486 31139 +15653
+ Misses 18723 3096 -15627
Continue to review full report at Codecov.
|
I decided to make this change in
status()
because I couldn't think of a reason why the current behavior is preferable, but we could of course put the kludge inrun()
with something like(We could even drop the custom
saver
parameter inrun.run_command()
, and move to an inlineds.rev_save()
call becausesaver
only existed for -revolution's rev-run.)