reanahub / reana-workflow-controller

REANA Workflow Controller
http://reana-workflow-controller.readthedocs.io/
MIT License
2 stars 38 forks source link

rest: make details available for shared workflows #552

Closed DaanRosendal closed 2 months ago

DaanRosendal commented 11 months ago
Command Allowed
delete
diff
logs
restart
start
status
stop
share-add
share-remove
share-status
close
open
download
du
ls
mv
prune
rm
upload
retention-rules-list

Closes reanahub/reana-server#651, closes reanahub/reana-server#650

mdonadoni commented 2 months ago

Latest version before rebase is 96f3ac9

There are still many comments to address from previous PRs

mdonadoni commented 2 months ago

Ready to be reviewed, squashed and merged

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 85.24590% with 18 lines in your changes missing coverage. Please review.

Project coverage is 75.59%. Comparing base (680e288) to head (e36c6a2). Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
reana_workflow_controller/rest/workflows.py 84.07% 18 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/reanahub/reana-workflow-controller/pull/552/graphs/tree.svg?width=650&height=150&src=pr&token=SC0cf8SzMF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub)](https://app.codecov.io/gh/reanahub/reana-workflow-controller/pull/552?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub) ```diff @@ Coverage Diff @@ ## master #552 +/- ## ========================================== + Coverage 75.13% 75.59% +0.45% ========================================== Files 15 15 Lines 1476 1565 +89 ========================================== + Hits 1109 1183 +74 - Misses 367 382 +15 ``` | [Files with missing lines](https://app.codecov.io/gh/reanahub/reana-workflow-controller/pull/552?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub) | Coverage Δ | | |---|---|---| | [reana\_workflow\_controller/config.py](https://app.codecov.io/gh/reanahub/reana-workflow-controller/pull/552?src=pr&el=tree&filepath=reana_workflow_controller%2Fconfig.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub#diff-cmVhbmFfd29ya2Zsb3dfY29udHJvbGxlci9jb25maWcucHk=) | `91.17% <100.00%> (+0.08%)` | :arrow_up: | | [reana\_workflow\_controller/factory.py](https://app.codecov.io/gh/reanahub/reana-workflow-controller/pull/552?src=pr&el=tree&filepath=reana_workflow_controller%2Ffactory.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub#diff-cmVhbmFfd29ya2Zsb3dfY29udHJvbGxlci9mYWN0b3J5LnB5) | `100.00% <100.00%> (ø)` | | | [reana\_workflow\_controller/rest/workflows\_status.py](https://app.codecov.io/gh/reanahub/reana-workflow-controller/pull/552?src=pr&el=tree&filepath=reana_workflow_controller%2Frest%2Fworkflows_status.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub#diff-cmVhbmFfd29ya2Zsb3dfY29udHJvbGxlci9yZXN0L3dvcmtmbG93c19zdGF0dXMucHk=) | `82.92% <100.00%> (-0.21%)` | :arrow_down: | | [...na\_workflow\_controller/rest/workflows\_workspace.py](https://app.codecov.io/gh/reanahub/reana-workflow-controller/pull/552?src=pr&el=tree&filepath=reana_workflow_controller%2Frest%2Fworkflows_workspace.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub#diff-cmVhbmFfd29ya2Zsb3dfY29udHJvbGxlci9yZXN0L3dvcmtmbG93c193b3Jrc3BhY2UucHk=) | `60.74% <100.00%> (-0.29%)` | :arrow_down: | | [reana\_workflow\_controller/rest/workflows.py](https://app.codecov.io/gh/reanahub/reana-workflow-controller/pull/552?src=pr&el=tree&filepath=reana_workflow_controller%2Frest%2Fworkflows.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub#diff-cmVhbmFfd29ya2Zsb3dfY29udHJvbGxlci9yZXN0L3dvcmtmbG93cy5weQ==) | `72.04% <84.07%> (+6.12%)` | :arrow_up: | ... and [10 files with indirect coverage changes](https://app.codecov.io/gh/reanahub/reana-workflow-controller/pull/552/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub)
tiborsimko commented 2 months ago

Kept separate commits, amended commit log headlines, bumped reana-db and pytest-reana dependency versions.

Also, for the tests to work, I have noticed the following change:

$ g show 894a99ed -- tests/test_views.py | cat
commit 894a99ed75f53484aa8d03198c493919c45da6f6
Author: Daan Rosendal <daan.rosendal@cern.ch>
Date:   Fri Dec 15 12:35:02 2023 +0100

    feat(rest): make details available for shared workflows (#552)

    Closes reanahub/reana-server#651, closes reanahub/reana-server#650

diff --git a/tests/test_views.py b/tests/test_views.py
index 6426f77..c9b13e2 100644
--- a/tests/test_views.py
+++ b/tests/test_views.py
@@ -812,7 +812,7 @@ def test_get_workflow_status_unauthorized(
             content_type="application/json",
             data=json.dumps(cwl_workflow_with_name),
         )
-        assert res.status_code == 404
+        assert res.status_code == 500

 def test_get_workflow_status_unknown_workflow(app, user0, cwl_workflow_with_name):
@@ -1027,7 +1027,7 @@ def test_set_workflow_status_unauthorized(
             query_string={"user": random_user_uuid, "status": payload},
             content_type="application/json",
         )
-        assert res.status_code == 404
+        assert res.status_code == 500

 def test_set_workflow_status_unknown_workflow(
@@ -1230,7 +1230,7 @@ def test_get_workflow_logs_unauthorized(
             query_string={"user": random_user_uuid},
             content_type="application/json",
         )
-        assert res.status_code == 404
+        assert res.status_code == 500

 def test_start_input_parameters(
@@ -1785,7 +1785,7 @@ def test_get_workflow_retention_rules_invalid_user(app, sample_serial_workflow_i
             ),
             query_string={"user": uuid.uuid4()},
         )
-        assert res.status_code == 404
+        assert res.status_code == 500

 def test_share_workflow(

which I reverted in f3d2bcc whilst merging so that CI would pass after bumping shared modules.

We can check this out later @mdonadoni