Trace errors during SetupWorkflow, make service step setup errors visible to user#5559
Conversation
Catch errors during SetupWorkflow, which happens currently especially with malformed service steps with kubernetes backend (when ports are not explicitly defined in kubernetes service, with other backends like docker this is ok, but kubernetes service created from the service step requires explicit ports).
|
Thanks! Instead of using a callback, I'd rather introduce a new error type that includes the step and the error data. Then we can check this on return. For example similar to https://github.com/woodpecker-ci/woodpecker/blob/main/server/forge/types/errors.go#L43 |
Great idea to keep the interfaces clean, cheers! I made the changes you suggested and tested that the outcome is same as with previous approach. |
|
Thanks, can you reformat your code? |
formated and checked that make lint passes without errors |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5559 +/- ##
==========================================
- Coverage 19.54% 19.53% -0.02%
==========================================
Files 417 417
Lines 39581 39607 +26
==========================================
Hits 7736 7736
- Misses 31147 31172 +25
- Partials 698 699 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Trace errors during SetupWorkflow. Currently all the steps are traced when executed, but due to how pipelines on kubernetes backend orchestrated its workflow resources, the service steps are created during SetupWorkflow, and the creation is prone to errors.
A specific example is when service steps are missing explicit port definitions:
The lack of descriptive error has raised questions, usually requiring Woodpecker Admin to provide the user with reason and solution to fix the issue.
Currently:

With this PR:
