eclipse / kapua

Eclipse Public License 2.0
222 stars 160 forks source link

Fix default value handling during job step creation #4052

Closed MDeLuise closed 2 months ago

MDeLuise commented 2 months ago

Description

This pull request addresses the issue where job step creation does not handle default values correctly. For example, when creating a job step with command execution, if only the commandInput parameter is set and the timeout parameter is left as default, the submission would fail due to the timeout not being set.

Steps to Reproduce

  1. Create a Job.
  2. Create a Job Step with Command Execution.
  3. Try to submit it by setting only the commandInput parameter and leaving timeout as default.
  4. Submit.

Current Behavior

On submission, there is an error due to the timeout not being set.

Expected Behavior

Job step creation should succeed. The JobStepProperties in JobStepDefinition with a propertyValue should be used as a default value for the JobStepProperties in JobStepCreator that haven’t been passed from the user.

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 16.78%. Comparing base (3ddc850) to head (fdf8391). Report is 21 commits behind head on develop.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse/kapua/pull/4052/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/4052?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) ```diff @@ Coverage Diff @@ ## develop #4052 +/- ## ============================================= + Coverage 16.67% 16.78% +0.11% Complexity 22 22 ============================================= Files 2008 2006 -2 Lines 52134 52089 -45 Branches 4409 4384 -25 ============================================= + Hits 8691 8745 +54 + Misses 43041 42949 -92 + Partials 402 395 -7 ``` | [Files](https://app.codecov.io/gh/eclipse/kapua/pull/4052?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) | Coverage Δ | | |---|---|---| | [.../service/job/step/internal/JobStepServiceImpl.java](https://app.codecov.io/gh/eclipse/kapua/pull/4052?src=pr&el=tree&filepath=service%2Fjob%2Finternal%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fservice%2Fjob%2Fstep%2Finternal%2FJobStepServiceImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-c2VydmljZS9qb2IvaW50ZXJuYWwvc3JjL21haW4vamF2YS9vcmcvZWNsaXBzZS9rYXB1YS9zZXJ2aWNlL2pvYi9zdGVwL2ludGVybmFsL0pvYlN0ZXBTZXJ2aWNlSW1wbC5qYXZh) | `0.00% <0.00%> (ø)` | | ... and [34 files with indirect coverage changes](https://app.codecov.io/gh/eclipse/kapua/pull/4052/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)