Skip to content

Trace errors during SetupWorkflow, make service step setup errors visible to user#5559

Merged
xoxys merged 8 commits into
woodpecker-ci:mainfrom
hhamalai:main
Sep 28, 2025
Merged

Trace errors during SetupWorkflow, make service step setup errors visible to user#5559
xoxys merged 8 commits into
woodpecker-ci:mainfrom
hhamalai:main

Conversation

@hhamalai

Copy link
Copy Markdown
Contributor

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:

  • In Docker backend: This works fine even without explicit ports
  • In Kubernetes backend: Service creation fails the whole pipeline, no error description on UI

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:
image

With this PR:
image

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).
@qwerty287 qwerty287 added agent enhancement improve existing features labels Sep 28, 2025
@qwerty287

Copy link
Copy Markdown
Contributor

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

@hhamalai

Copy link
Copy Markdown
Contributor Author

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.

@qwerty287

Copy link
Copy Markdown
Contributor

Thanks, can you reformat your code?

@hhamalai

Copy link
Copy Markdown
Contributor Author

Thanks, can you reformat your code?

formated and checked that make lint passes without errors

@codecov

codecov Bot commented Sep 28, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.53%. Comparing base (d894d3a) to head (ba0cbc4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pipeline/pipeline.go 0.00% 16 Missing ⚠️
pipeline/errors/types/errors.go 0.00% 5 Missing ⚠️
pipeline/backend/kubernetes/kubernetes.go 0.00% 4 Missing ⚠️
pipeline/backend/kubernetes/service.go 0.00% 2 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xoxys xoxys enabled auto-merge (squash) September 28, 2025 19:47
@xoxys xoxys merged commit 0fc615c into woodpecker-ci:main Sep 28, 2025
7 checks passed
@woodpecker-bot woodpecker-bot mentioned this pull request Sep 28, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent enhancement improve existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants