eclipse / kapua

Eclipse Public License 2.0
225 stars 160 forks source link

:fix: job execution stop always returns 202, regardless of it running… #4006

Closed dseurotech closed 6 months ago

dseurotech commented 7 months ago

This PR makes it so that job execution stop always returns 202, regardless of it running state, as it is a request to stop and not an immediate command.

Description of the solution adopted Simple catch of JobNotRunningException on the rest api side, and conversion to the appropriate return code.

codecov[bot] commented 7 months ago

Codecov Report

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

Project coverage is 16.87%. Comparing base (ab4b252) to head (c5fbe96). Report is 3 commits behind head on develop.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse/kapua/pull/4006/graphs/tree.svg?width=650&height=150&src=pr&token=1P4N4CApH8&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)](https://app.codecov.io/gh/eclipse/kapua/pull/4006?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) ```diff @@ Coverage Diff @@ ## develop #4006 +/- ## ============================================= - Coverage 21.08% 16.87% -4.22% Complexity 10 10 ============================================= Files 1954 1989 +35 Lines 41429 51782 +10353 Branches 3801 4419 +618 ============================================= Hits 8737 8737 - Misses 32288 42641 +10353 Partials 404 404 ``` | [Files](https://app.codecov.io/gh/eclipse/kapua/pull/4006?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) | Coverage Δ | | |---|---|---| | [...apua/app/api/resources/v1/resources/JobEngine.java](https://app.codecov.io/gh/eclipse/kapua/pull/4006?src=pr&el=tree&filepath=rest-api%2Fresources%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fapp%2Fapi%2Fresources%2Fv1%2Fresources%2FJobEngine.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-cmVzdC1hcGkvcmVzb3VyY2VzL3NyYy9tYWluL2phdmEvb3JnL2VjbGlwc2Uva2FwdWEvYXBwL2FwaS9yZXNvdXJjZXMvdjEvcmVzb3VyY2VzL0pvYkVuZ2luZS5qYXZh) | `0.00% <0.00%> (ø)` | | ... and [35 files with indirect coverage changes](https://app.codecov.io/gh/eclipse/kapua/pull/4006/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)