Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
083c0a1
first itteration: detached steps / services report back
6543 Jan 28, 2026
3df799a
backend docker: first softKill containers still running
6543 Jan 30, 2026
bd851e2
use stop
6543 Jan 30, 2026
8e7ae4b
docker backend: refactor DestroyStep
6543 Jan 30, 2026
ec28ee6
queue: enhance error logs in agents
6543 Jan 30, 2026
26c38ed
fix code comment
6543 Jan 30, 2026
f50de70
move into its own pull: https://github.com/woodpecker-ci/woodpecker/p…
6543 Feb 5, 2026
8ece665
update test acordingly
6543 Feb 5, 2026
f7db83a
Merge branch 'main' into detached-or-service-steps_report-back-too
6543 Feb 6, 2026
5e657c9
pipeline.errors ... prepare
6543 Feb 6, 2026
5b1a3d7
move errors
6543 Feb 6, 2026
a2d7a10
swaggo does not understand import alias!!!
6543 Feb 6, 2026
6a31272
move pipeline runitme struct into own runtime package
6543 Feb 6, 2026
7dfafe5
move engine trace and log stuf in subpackages
6543 Feb 6, 2026
f864a87
Merge branch 'main' into refatcor-pipeline-engine
6543 Feb 6, 2026
669d026
ci.rerun()
6543 Feb 6, 2026
0b91c8f
Merge branch 'main' into refatcor-pipeline-engine
6543 Feb 7, 2026
28f102b
cleanup and fix after merge main
6543 Feb 7, 2026
56e7438
Merge branch 'main' into refatcor-pipeline-engine
6543 Feb 11, 2026
528446e
fix import
6543 Feb 11, 2026
604e401
Merge branch 'main' into refatcor-pipeline-engine
6543 Feb 11, 2026
6792910
Merge branch 'main' into refatcor-pipeline-engine
6543 Feb 11, 2026
aaabd21
fix-lint
6543 Feb 11, 2026
a7e4765
Merge branch 'main' into refatcor-pipeline-engine
6543 Feb 12, 2026
b314df1
Merge branch 'main' into refatcor-pipeline-engine
6543 Feb 12, 2026
4730c17
copiright year
6543 Feb 13, 2026
a21a236
Update pipeline/state/state.go
6543 Feb 13, 2026
05b6408
Apply suggestions from code review
6543 Feb 13, 2026
4bd16b1
Merge branch 'main' into refatcor-pipeline-engine
6543 Feb 13, 2026
6187890
Merge branch 'main' into refatcor-pipeline-engine
6543 Feb 13, 2026
4c6186b
Merge branch 'main' into refatcor-pipeline-engine
6543 Feb 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion agent/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ import (
"go.woodpecker-ci.org/woodpecker/v3/agent/log"
"go.woodpecker-ci.org/woodpecker/v3/pipeline"
backend "go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/types"
"go.woodpecker-ci.org/woodpecker/v3/pipeline/logging"
pipeline_utils "go.woodpecker-ci.org/woodpecker/v3/pipeline/utils"
"go.woodpecker-ci.org/woodpecker/v3/rpc"
)

func (r *Runner) createLogger(_logger zerolog.Logger, uploads *sync.WaitGroup, workflow *rpc.Workflow) pipeline.Logger {
func (r *Runner) createLogger(_logger zerolog.Logger, uploads *sync.WaitGroup, workflow *rpc.Workflow) logging.Logger {
return func(step *backend.Step, rc io.ReadCloser) error {
defer rc.Close()

Expand Down
25 changes: 13 additions & 12 deletions agent/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (
"github.com/rs/zerolog/log"
"google.golang.org/grpc/metadata"

"go.woodpecker-ci.org/woodpecker/v3/pipeline"
backend "go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/types"
pipeline_errors "go.woodpecker-ci.org/woodpecker/v3/pipeline/errors"
pipeline_runtime "go.woodpecker-ci.org/woodpecker/v3/pipeline/runtime"
"go.woodpecker-ci.org/woodpecker/v3/rpc"
"go.woodpecker-ci.org/woodpecker/v3/shared/constant"
"go.woodpecker-ci.org/woodpecker/v3/shared/utils"
Expand Down Expand Up @@ -99,7 +100,7 @@ func (r *Runner) Run(runnerCtx, shutdownCtx context.Context) error {
workflowCtx = utils.WithContextSigtermCallback(workflowCtx, func() {
logger.Error().Msg("received sigterm termination signal")
// WithContextSigtermCallback would cancel the context too, but we want our own custom error
cancelWorkflowCtx(pipeline.ErrCancel)
cancelWorkflowCtx(pipeline_errors.ErrCancel)
})

// Listen for remote cancel events (UI / API).
Expand All @@ -114,7 +115,7 @@ func (r *Runner) Run(runnerCtx, shutdownCtx context.Context) error {
} else {
if canceled {
logger.Debug().Err(err).Msg("server side cancel signal received")
cancelWorkflowCtx(pipeline.ErrCancel)
cancelWorkflowCtx(pipeline_errors.ErrCancel)
}
// Wait returned without error, meaning the workflow finished normally
logger.Debug().Msg("cancel listener exited normally")
Expand Down Expand Up @@ -153,14 +154,14 @@ func (r *Runner) Run(runnerCtx, shutdownCtx context.Context) error {
var uploads sync.WaitGroup

// Run pipeline
err = pipeline.New(
err = pipeline_runtime.New(
workflow.Config,
pipeline.WithContext(workflowCtx),
pipeline.WithTaskUUID(fmt.Sprint(workflow.ID)),
pipeline.WithLogger(r.createLogger(logger, &uploads, workflow)),
pipeline.WithTracer(r.createTracer(ctxMeta, &uploads, logger, workflow)),
pipeline.WithBackend(*r.backend),
pipeline.WithDescription(map[string]string{
pipeline_runtime.WithContext(workflowCtx),
pipeline_runtime.WithTaskUUID(fmt.Sprint(workflow.ID)),
pipeline_runtime.WithLogger(r.createLogger(logger, &uploads, workflow)),
pipeline_runtime.WithTracer(r.createTracer(ctxMeta, &uploads, logger, workflow)),
pipeline_runtime.WithBackend(*r.backend),
pipeline_runtime.WithDescription(map[string]string{
"workflow_id": workflow.ID,
"repo": repoName,
"pipeline_number": pipelineNumber,
Expand All @@ -171,10 +172,10 @@ func (r *Runner) Run(runnerCtx, shutdownCtx context.Context) error {

if err != nil {
state.Error = err.Error()
if errors.Is(err, pipeline.ErrCancel) {
if errors.Is(err, pipeline_errors.ErrCancel) {
state.Canceled = true
// cleanup joined error messages
state.Error = pipeline.ErrCancel.Error()
state.Error = pipeline_errors.ErrCancel.Error()
}
}

Expand Down
10 changes: 6 additions & 4 deletions agent/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ import (

"github.com/rs/zerolog"

"go.woodpecker-ci.org/woodpecker/v3/pipeline"
pipeline_errors "go.woodpecker-ci.org/woodpecker/v3/pipeline/errors"
"go.woodpecker-ci.org/woodpecker/v3/pipeline/state"
"go.woodpecker-ci.org/woodpecker/v3/pipeline/tracing"
"go.woodpecker-ci.org/woodpecker/v3/rpc"
)

func (r *Runner) createTracer(ctxMeta context.Context, uploads *sync.WaitGroup, logger zerolog.Logger, workflow *rpc.Workflow) pipeline.TraceFunc {
return func(state *pipeline.State) error {
func (r *Runner) createTracer(ctxMeta context.Context, uploads *sync.WaitGroup, logger zerolog.Logger, workflow *rpc.Workflow) tracing.TraceFunc {
return func(state *state.State) error {
uploads.Add(1)
defer uploads.Done()

Expand All @@ -46,7 +48,7 @@ func (r *Runner) createTracer(ctxMeta context.Context, uploads *sync.WaitGroup,
Exited: state.Process.Exited,
ExitCode: state.Process.ExitCode,
Started: state.Process.Started,
Canceled: errors.Is(state.Process.Error, pipeline.ErrCancel),
Canceled: errors.Is(state.Process.Error, pipeline_errors.ErrCancel),
}
if state.Process.Error != nil {
stepState.Error = state.Process.Error.Error()
Expand Down
17 changes: 10 additions & 7 deletions cli/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ import (
"go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/yaml/compiler"
"go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/yaml/linter"
"go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/yaml/matrix"
"go.woodpecker-ci.org/woodpecker/v3/pipeline/logging"
pipeline_runtime "go.woodpecker-ci.org/woodpecker/v3/pipeline/runtime"
"go.woodpecker-ci.org/woodpecker/v3/pipeline/tracing"
pipeline_utils "go.woodpecker-ci.org/woodpecker/v3/pipeline/utils"
"go.woodpecker-ci.org/woodpecker/v3/shared/constant"
"go.woodpecker-ci.org/woodpecker/v3/shared/utils"
Expand Down Expand Up @@ -318,12 +321,12 @@ func execWithAxis(ctx context.Context, c *cli.Command, file, repoPath string, ax
fmt.Printf("ctrl+c received, terminating current pipeline '%s'\n", confStr)
})

return pipeline.New(compiled,
pipeline.WithContext(pipelineCtx), //nolint:contextcheck
pipeline.WithTracer(pipeline.DefaultTracer),
pipeline.WithLogger(defaultLogger),
pipeline.WithBackend(backendEngine),
pipeline.WithDescription(map[string]string{
return pipeline_runtime.New(compiled,
pipeline_runtime.WithContext(pipelineCtx), //nolint:contextcheck
pipeline_runtime.WithTracer(tracing.DefaultTracer),
pipeline_runtime.WithLogger(defaultLogger),
pipeline_runtime.WithBackend(backendEngine),
pipeline_runtime.WithDescription(map[string]string{
"CLI": "exec",
}),
).Run(ctx)
Expand All @@ -348,7 +351,7 @@ func convertPathForWindows(path string) string {
return filepath.ToSlash(path)
}

var defaultLogger = pipeline.Logger(func(step *backend_types.Step, rc io.ReadCloser) error {
var defaultLogger = logging.Logger(func(step *backend_types.Step, rc io.ReadCloser) error {
logWriter := NewLineWriter(step.Name, step.UUID)
return pipeline_utils.CopyLineByLine(logWriter, rc, pipeline.MaxLogLineLength)
})
94 changes: 47 additions & 47 deletions cmd/server/openapi/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5017,7 +5017,7 @@ const docTemplate = `{
"errors": {
"type": "array",
"items": {
"$ref": "#/definitions/types.PipelineError"
"$ref": "#/definitions/errors.PipelineError"
}
},
"event": {
Expand Down Expand Up @@ -5736,6 +5736,52 @@ const docTemplate = `{
"EventManual"
]
},
"errors.PipelineError": {
"type": "object",
"properties": {
"data": {},
"is_warning": {
"type": "boolean"
},
"message": {
"type": "string"
},
"type": {
"$ref": "#/definitions/errors.PipelineErrorType"
}
}
},
"errors.PipelineErrorType": {
"type": "string",
"enum": [
"linter",
"deprecation",
"compiler",
"generic",
"bad_habit"
],
"x-enum-comments": {
"PipelineErrorTypeBadHabit": "some bad-habit error",
"PipelineErrorTypeCompiler": "some error with the config semantics",
"PipelineErrorTypeDeprecation": "using some deprecated feature",
"PipelineErrorTypeGeneric": "some generic error",
"PipelineErrorTypeLinter": "some error with the config syntax"
},
"x-enum-descriptions": [
"some error with the config syntax",
"using some deprecated feature",
"some error with the config semantics",
"some generic error",
"some bad-habit error"
],
"x-enum-varnames": [
"PipelineErrorTypeLinter",
"PipelineErrorTypeDeprecation",
"PipelineErrorTypeCompiler",
"PipelineErrorTypeGeneric",
"PipelineErrorTypeBadHabit"
]
},
"metadata.Author": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -6156,52 +6202,6 @@ const docTemplate = `{
"$ref": "#/definitions/StatusValue"
}
}
},
"types.PipelineError": {
"type": "object",
"properties": {
"data": {},
"is_warning": {
"type": "boolean"
},
"message": {
"type": "string"
},
"type": {
"$ref": "#/definitions/types.PipelineErrorType"
}
}
},
"types.PipelineErrorType": {
"type": "string",
"enum": [
"linter",
"deprecation",
"compiler",
"generic",
"bad_habit"
],
"x-enum-comments": {
"PipelineErrorTypeBadHabit": "some bad-habit error",
"PipelineErrorTypeCompiler": "some error with the config semantics",
"PipelineErrorTypeDeprecation": "using some deprecated feature",
"PipelineErrorTypeGeneric": "some generic error",
"PipelineErrorTypeLinter": "some error with the config syntax"
},
"x-enum-descriptions": [
"some error with the config syntax",
"using some deprecated feature",
"some error with the config semantics",
"some generic error",
"some bad-habit error"
],
"x-enum-varnames": [
"PipelineErrorTypeLinter",
"PipelineErrorTypeDeprecation",
"PipelineErrorTypeCompiler",
"PipelineErrorTypeGeneric",
"PipelineErrorTypeBadHabit"
]
}
}
}`
Expand Down
71 changes: 0 additions & 71 deletions pipeline/errors/error.go

This file was deleted.

Loading