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: Provide indication which procedure is (to be) execut(ed/able) #3960

Merged
merged 2 commits into from Dec 23, 2019

Conversation

mih
Copy link
Member

@mih mih commented Dec 21, 2019

[Sits on top of https://github.com//pull/3959 to avoid conflicts]

Before, only "absent" (but configured) procedures were marked up in the 'state' field of their result record. Now this is extended with two more states:

  • 'executable': all criteria for an active procedure are fulfilled
  • 'overridden': like 'executable', but there is a higher-priority procedure with the same name

These additional states are also reflected in the renderer, where only active/executable procedures are renderer as before, and any other's are de-emphasized and annotated.

Fixes gh-3614

Example output before

% dl run-procedure --discover
cfg_inm7 (/etc/xdg/datalad/procedures/cfg_inm7.py) [python_script]
cfg_inm7 (/home/mih/hacking/datalad/inm7-datalad/inm7_datalad/resources/procedures/cfg_inm7.py) [python_script]
ria_post_install (/home/mih/hacking/datalad/git-annex-ria-remote/ria_remote/resources/procedures/ria_post_install.py) [python_script]

after

% datalad run-procedure --discover
cfg_inm7 (/etc/xdg/datalad/procedures/cfg_inm7.py) [python_script]
cfg_inm7 (/home/mih/hacking/datalad/inm7-datalad/inm7_datalad/resources/procedures/cfg_inm7.py) [python_script (overridden)]
ria_post_install (/home/mih/hacking/datalad/git-annex-ria-remote/ria_remote/resources/procedures/ria_post_install.py) [python_script]

or in full:

{
  "action": "discover_procedure",
  "path": "/etc/xdg/datalad/procedures/cfg_inm7.py",
  "procedure_callfmt": "/home/mih/env/datalad3-dev/bin/python3 {script} {ds} {args}",
  "procedure_help": null,
  "procedure_name": "cfg_inm7",
  "procedure_type": "python_script",
  "state": "executable",
  "status": "ok",
  "type": "file"
}
{
  "action": "discover_procedure",
  "path": "/home/mih/hacking/datalad/inm7-datalad/inm7_datalad/resources/procedures/cfg_inm7.py",
  "procedure_callfmt": "/home/mih/env/datalad3-dev/bin/python3 {script} {ds} {args}",
  "procedure_help": null,
  "procedure_name": "cfg_inm7",
  "procedure_type": "python_script",
  "state": "overridden",
  "status": "ok",
  "type": "file"
}

mih added 2 commits Dec 21, 2019
Before it would report relpaths if operating on a dataset, leading to
the issue at hand.

I considered relpaths for dataset internal procedures, and abspaths for
others. However, when not invoked at the root of a dataset these would
again be somewhat confusing. So full abspath it is.

Fixes dataladgh-3619
Before only "absent" (but configured) procedures were marked up
in the 'state' field of their result record. Now this is extended
with two more states:

'executable': all criteria for an active procedure are fulfilled
'overridden': like 'executable', but there is a higher-priority
              procedure with the same name

These additional states are also reflected in the renderer, where
only active/executable procedures are renderer as before, and
any other's are de-emphasized and annotated.

Fixes dataladgh-3614
@mih mih requested a review from bpoldrack Dec 21, 2019
@codecov
Copy link

@codecov codecov bot commented Dec 21, 2019

Codecov Report

Merging #3960 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3960      +/-   ##
==========================================
+ Coverage   89.75%   89.78%   +0.02%     
==========================================
  Files         271      271              
  Lines       36374    36375       +1     
==========================================
+ Hits        32649    32659      +10     
+ Misses       3725     3716       -9
Impacted Files Coverage Δ
datalad/interface/run_procedure.py 90.74% <100%> (+0.67%) ⬆️
datalad/interface/tests/test_run_procedure.py 100% <100%> (ø) ⬆️
datalad/downloaders/base.py 75.55% <0%> (+0.37%) ⬆️
datalad/downloaders/http.py 75.29% <0%> (+0.39%) ⬆️
datalad/downloaders/tests/test_http.py 62.04% <0%> (+1.45%) ⬆️

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 c38dbd7...b73aaa9. Read the comment docs.

@mih mih added the merge-if-ok label Dec 23, 2019
kyleam
kyleam approved these changes Dec 23, 2019
@mih
Copy link
Member Author

@mih mih commented Dec 23, 2019

Thx!

@mih mih merged commit ea4a9f8 into datalad:master Dec 23, 2019
17 checks passed
@mih mih deleted the bf-3614 branch Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-if-ok
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants