Skip to content
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/RF: Silence save result rendering in clone and download url #6446

Merged
merged 4 commits into from
Feb 14, 2022

Conversation

adswa
Copy link
Member

@adswa adswa commented Feb 11, 2022

A recent change has introduced double reporting for a number of commands (#6445). I haven't figured out why this change has suddenly happened, but this PR silences (result_renderer='disabled') internal calls to save and get that should be silenced anyway.

In addition, it contains a small RF that centralizes general result renderer switches outside of a loop. Coincidentally, this RF reinstates action summaries for a few commands that had lost it (#6258)

Changelog

🐛 Bug Fixes

  • A number of commands stopped to double-report results (by @adswa)

action summaries

There is no need to evaluate whether the result renderer choice for
the command class is correct in a loop - once at the start of
eval_func() should suffice

This reinstates result summaries for a few commands, among probably
others download-url, save, and clone
Previously, a download-url would double-report:

datalad download-url -O chinstrap_05.jpg https://unsplash.com/photos/8PxCm4HsPX8/download?force=true
[INFO   ] Downloading 'https://unsplash.com/photos/8PxCm4HsPX8/download?force=true' into '/tmp/ab/chinstrap_05.jpg'
download_url(ok): /tmp/ab/chinstrap_05.jpg (file)
add(ok): chinstrap_05.jpg (file)
add(ok): chinstrap_05.jpg (file)
save(ok): . (dataset)
save(ok): . (dataset)
action summary:
  add (ok: 1)
  save (ok: 1)
action summary:
  add (ok: 1)
  download_url (ok: 1)
  save (ok: 1)

Now, the result rendering of save is disabled:

datalad download-url -O chinstrap_03.jpg https://unsplash.com/photos/8PxCm4HsPX8/download?force=true
[INFO   ] Downloading 'https://unsplash.com/photos/8PxCm4HsPX8/download?force=true' into '/tmp/ab/chinstrap_03.jpg'
download_url(ok): /tmp/ab/chinstrap_03.jpg (file)
add(ok): chinstrap_03.jpg (file)
save(ok): . (dataset)
action summary:
  add (ok: 1)
  download_url (ok: 1)
  save (ok: 1)
Previously, clone would overreport save results:

datalad clone -d . https://gin.g-node.org/adswa/bids-data input
install(ok): input (dataset)
add(ok): input (file)
add(ok): input (file)
add(ok): .gitmodules (file)
add(ok): .gitmodules (file)
save(ok): . (dataset)
save(ok): . (dataset)
add(ok): .gitmodules (file)
save(ok): . (dataset)
add(ok): .gitmodules (file)
save(ok): . (dataset)

Now, the doubled add and save results are removed:

 datalad clone -d . https://gin.g-node.org/adswa/bids-data input14
install(ok): input14 (dataset)
add(ok): input14 (file)
add(ok): .gitmodules (file)
save(ok): . (dataset)
add(ok): .gitmodules (file)
save(ok): . (dataset)

Still, there is a duplicate .gitmodules save operation that I
can't silence
Previously, an install yielded to identical results:

❱ datalad install input15
install(ok): /tmp/ab/input15 (dataset) [Installed subdataset in order to get /tmp/ab/input15]
install(ok): /tmp/ab/input15 (dataset) [Installed subdataset in order to get /tmp/ab/input15]

Now, it only reports one:

❱ datalad install input15
install(ok): /tmp/ab/input15 (dataset) [Installed subdataset in order to get /tmp/ab/input15]
@adswa adswa added the semver-patch Increment the patch version when merged label Feb 11, 2022
@codeclimate
Copy link

codeclimate bot commented Feb 11, 2022

Code Climate has analyzed commit 4e3a5b1 and detected 0 issues on this pull request.

View more on Code Climate.

@adswa adswa linked an issue Feb 11, 2022 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

Merging #6446 (4e3a5b1) into master (aebb5ce) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6446   +/-   ##
=======================================
  Coverage   89.97%   89.97%           
=======================================
  Files         348      348           
  Lines       43859    43859           
=======================================
  Hits        39464    39464           
  Misses       4395     4395           
Impacted Files Coverage Δ
datalad/core/distributed/clone.py 91.20% <ø> (ø)
datalad/distribution/install.py 98.87% <ø> (ø)
datalad/local/download_url.py 97.91% <ø> (ø)
datalad/interface/utils.py 95.50% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aebb5ce...4e3a5b1. Read the comment docs.

Copy link
Member

@mih mih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for digging through this, and the further logic simplification.

IMHO, all internal command calls that lack result_renderer='disabled' are a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch Increment the patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Something introduced widespread double reporting of results
2 participants