-
Notifications
You must be signed in to change notification settings - Fork 113
Address compatibility with most recent git-annex where info would exit with non-0 #7292
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
Conversation
@@ -211,8 +212,10 @@ def run(self, | |||
lgr.debug("Finished %r with status %s", cmd, results['code']) | |||
|
|||
# make it such that we always blow if a protocol did not report | |||
# a return code at all | |||
if results.get('code', True) not in [0, None]: |
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.
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 am not sure what this wants to say
when there is no code here we really not treat it as None but want to get None from somewhere deeper within
but what this conditional did was stated in the still present comment:
make it such that we always blow if a protocol did not report a return code at all
Because in the linked commit it established:
The result is now always a dict that is expected to have keys 'code', 'stdout', 'stderr', matching the semantics of the CommandError exception.
The changed code seems to achieve the same behavior: raise if there is no code
in the results. So LGTM.
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 can live with LGTM without dwelling on the rest. Cheers!
wow -- good number of fails. Something really common to RIA stuff
just to make sure all relate to this change -- #7293 |
fails might be unrelated: #7296 |
…on_on_error=False Original behavior to raise that CommandError after process exits was introduced in 9551b91 (0.13.0rc1~120^2~1) whenever exception_on_error was added later on in 9f066ef (0.16.0^2~123^2~7). It is not clear to me (question to @mih) why it was `get` with defaulting to `True`, so I have changed it to `None`. I have then adjusted the logic to actually react to when there was nothing (we got None stored or got as default) really to match comment before. And made it to raise CommandError for non-0 only if exception_on_error was True.
Closes datalad#7286 . 10.20230214 release of git-annex came with a change of behavior for info to exit with non-0 exit code if any path was not known to it to provide info. Moreover it had regression to exit immediately thus possibly not returning any json record for valid files further on command line invocation. That was later fixed in [10.20230214-22-g16d3097a0](https://git.kitenet.net/index.cgi/git-annex.git/commit/?id=16d3097a0832a94eacdd966f30723323fa2eb817) . Here we just making _call_annex_records for info to not raise CommandError if exits with non-0. It relies on prior commit adjusting behavior down in the runner
db062bb
to
65b6417
Compare
appveryor:
mac - brew:
mac - snapshot, where I expected it to pass but it doesn't
|
aha -- will need to fix up for the fact that git-annex version comparison fails in |
in docs building environment there could be no git-annex
5470fa0
to
6d536ad
Compare
Codecov ReportBase: 88.65% // Head: 90.68% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## maint #7292 +/- ##
==========================================
+ Coverage 88.65% 90.68% +2.03%
==========================================
Files 326 326
Lines 44429 44439 +10
Branches 5919 5919
==========================================
+ Hits 39387 40300 +913
+ Misses 5027 4124 -903
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. |
hm, on the last run metalad tests fail all of a sudden (attn @christian-monch ) ,
note that version is not 0.4.12... apparently that one is not merged into master, so master doesn't have all fixes... submitted datalad/datalad-metalad#337 . overall -- this PR is as ready as it can be |
I did not look into the specifics, but it seems that you've got this issue covered - I'd support merging considering it shows up also outside the CI when the "latest" git-annex release is installed. |
PR released in |
Ref: #7286
Runner - make exception_on_error=False in effect + use it for annex info.
See individual commits description for more info.