ITISFoundation / osparc-simcore

🐼 osparc-simcore simulation framework
https://osparc.io
MIT License
44 stars 26 forks source link

✨ dynamic-services will fail if they have any required input that is not set #5845

Closed GitHK closed 1 month ago

GitHK commented 1 month ago

What do these changes do?

Changes

Users warning messages

Case 1 (input link to port is missing)

Screenshot 2024-05-29 at 15 16 00

Case 2 (file in input port not present)

Screenshot 2024-05-29 at 15 17 06

Related issue/s

How to test

Dev-ops checklist

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 46.29630% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 70.2%. Comparing base (cafbf96) to head (b77c261). Report is 247 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5845/graphs/tree.svg?width=650&height=150&src=pr&token=h1rOE8q7ic&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation)](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5845?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation) ```diff @@ Coverage Diff @@ ## master #5845 +/- ## ========================================= - Coverage 84.5% 70.2% -14.4% ========================================= Files 10 553 +543 Lines 214 27997 +27783 Branches 25 205 +180 ========================================= + Hits 181 19656 +19475 - Misses 23 8290 +8267 - Partials 10 51 +41 ``` | [Flag](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5845/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation) | Coverage Δ | | |---|---|---| | [integrationtests](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5845/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation) | `60.3% <22.2%> (?)` | | | [unittests](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5845/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation) | `74.2% <46.2%> (-10.4%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5845?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation) | Coverage Δ | | |---|---|---| | [...core\_service\_webserver/projects/\_nodes\_handlers.py](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5845?src=pr&el=tree&filepath=services%2Fweb%2Fserver%2Fsrc%2Fsimcore_service_webserver%2Fprojects%2F_nodes_handlers.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation#diff-c2VydmljZXMvd2ViL3NlcnZlci9zcmMvc2ltY29yZV9zZXJ2aWNlX3dlYnNlcnZlci9wcm9qZWN0cy9fbm9kZXNfaGFuZGxlcnMucHk=) | `91.0% <50.0%> (ø)` | | | [...c/simcore\_service\_webserver/projects/exceptions.py](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5845?src=pr&el=tree&filepath=services%2Fweb%2Fserver%2Fsrc%2Fsimcore_service_webserver%2Fprojects%2Fexceptions.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation#diff-c2VydmljZXMvd2ViL3NlcnZlci9zcmMvc2ltY29yZV9zZXJ2aWNlX3dlYnNlcnZlci9wcm9qZWN0cy9leGNlcHRpb25zLnB5) | `88.7% <60.0%> (ø)` | | | [...simcore\_service\_webserver/projects/projects\_api.py](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5845?src=pr&el=tree&filepath=services%2Fweb%2Fserver%2Fsrc%2Fsimcore_service_webserver%2Fprojects%2Fprojects_api.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation#diff-c2VydmljZXMvd2ViL3NlcnZlci9zcmMvc2ltY29yZV9zZXJ2aWNlX3dlYnNlcnZlci9wcm9qZWN0cy9wcm9qZWN0c19hcGkucHk=) | `80.2% <40.5%> (ø)` | | ... and [560 files with indirect coverage changes](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5845/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation)
GitHK commented 1 month ago

Very nice! I see how we can apply this to many use-cases. Maybe @wvangeit is interested as well.

So @GitHK. the requirements to use this feature are (please correct me if this is wrong):

  1. a service has to be dynamic

correct both legacy and new style work

  1. in the DB, we need to set which inputs are required. Could you maybe add a screenshot that shows that to the PR description?

OM will add an UI element for this a PR will follow

wvangeit commented 1 month ago

One question, I assume that if there is a file from a previous run of the study present, it will pass the test and run the service?

GitHK commented 1 month ago

One question, I assume that if there is a file from a previous run of the study present, it will pass the test and run the service?

Correct. this only checks for the port connections and the presence of a file in the port. It cannot do more that this (like inspecting if a file changes) that requires the sidecar to be running (a.k.a. the service to be running)

wvangeit commented 1 month ago

@GitHK Ok, makes sense. (@elisabettai so for my use case I can't use it yet, because I need to make sure I get 'fresh' files (i.e. with handshakes))

GitHK commented 1 month ago

in your PR I see that the error message shows the port key not the port displayed name. Can this not be done otherwise? How as a user will I instantly recognize which port is missing?

So the data is coming from the workbench. I'm not sure exactly how to fetch some more information inside the webserver. I would need to pull the data of all the services that are connecting to my node in order to properly format these messages.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.1% Duplication on New Code

See analysis details on SonarCloud