From c84022e056619b480db8da1b4a244164a3b91f30 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 15 Apr 2026 22:48:38 +0200 Subject: [PATCH 1/3] Add WOODPECKER_FORCE_IGNORE_SERVICE_FAILURE option to get non breaking behavior by default --- cmd/server/flags.go | 7 +++++++ cmd/server/setup.go | 6 ++++++ pipeline/frontend/yaml/compiler/compiler.go | 2 ++ pipeline/frontend/yaml/compiler/convert.go | 5 +++++ pipeline/frontend/yaml/compiler/option.go | 7 +++++++ server/config.go | 2 ++ server/pipeline/items.go | 6 ++++++ 7 files changed, 35 insertions(+) diff --git a/cmd/server/flags.go b/cmd/server/flags.go index 900e5e4347d..fbee3af6481 100644 --- a/cmd/server/flags.go +++ b/cmd/server/flags.go @@ -406,6 +406,13 @@ var flags = append([]cli.Flag{ Usage: "if set, pass the environment variable down as \"HTTPS_PROXY\" to steps", Name: "backend-https-proxy", }, + // setting to have non breaking behavior till v4.0.0 + &cli.BoolFlag{ + Sources: cli.EnvVars("WOODPECKER_FORCE_IGNORE_SERVICE_FAILURE"), + Name: "force-ignore-service-failure", + Usage: "from v3.14.0 onwards detached steps & services do report it's status back, to preserver old behavior we still ignore fails by default", + Value: true, + }, // // resource limit parameters // diff --git a/cmd/server/setup.go b/cmd/server/setup.go index 47019d52768..8546a749b96 100644 --- a/cmd/server/setup.go +++ b/cmd/server/setup.go @@ -263,6 +263,12 @@ func setupEvilGlobals(ctx context.Context, c *cli.Command, s store.Store) (err e server.Config.WebUI.MaxPipelineLogLineCount = c.Uint("max-pipeline-log-line-count") server.Config.Pipeline.PrivilegedPlugins = c.StringSlice("plugins-privileged") + // TODO: remove with version 4.x + server.Config.Pipeline.ForceIgnoreServiceFailure = c.Bool("force-ignore-service-failure") + if server.Config.Pipeline.ForceIgnoreServiceFailure { + log.Info().Msg("WOODPECKER_FORCE_IGNORE_SERVICE_FAILURE is true by default, to prepare for upcoming versions set it to false and update your pipeline definitions if needed") + } + // prometheus server.Config.Prometheus.AuthToken = c.String("prometheus-auth-token") diff --git a/pipeline/frontend/yaml/compiler/compiler.go b/pipeline/frontend/yaml/compiler/compiler.go index 3251b4f3aee..f3508f1f5e2 100644 --- a/pipeline/frontend/yaml/compiler/compiler.go +++ b/pipeline/frontend/yaml/compiler/compiler.go @@ -94,6 +94,8 @@ type Compiler struct { defaultClonePlugin string trustedClonePlugins []string securityTrustedPipeline bool + // TODO: remove with version 4.x + forceIgnoreServiceFailure bool } // New creates a new Compiler with options. diff --git a/pipeline/frontend/yaml/compiler/convert.go b/pipeline/frontend/yaml/compiler/convert.go index 3464703c271..ea09c1ada2f 100644 --- a/pipeline/frontend/yaml/compiler/convert.go +++ b/pipeline/frontend/yaml/compiler/convert.go @@ -156,6 +156,11 @@ func (c *Compiler) createProcess(container *yaml_types.Container, workflow *yaml failure = string(metadata.FailureFail) } + // TODO: remove with version 4.x + if c.forceIgnoreServiceFailure && detached { + failure = string(metadata.FailureIgnore) + } + return &backend_types.Step{ Name: container.Name, UUID: uuid.String(), diff --git a/pipeline/frontend/yaml/compiler/option.go b/pipeline/frontend/yaml/compiler/option.go index 737dfddacb3..3c049abcc45 100644 --- a/pipeline/frontend/yaml/compiler/option.go +++ b/pipeline/frontend/yaml/compiler/option.go @@ -199,3 +199,10 @@ func WithProxy(opt ProxyOptions) Option { }, ) } + +// TODO: remove with version 4.x +func WithForceIgnoreServiceFailure() Option { + return func(c *Compiler) { + c.forceIgnoreServiceFailure = true + } +} diff --git a/server/config.go b/server/config.go index 4d3400d548f..e6e05099a43 100644 --- a/server/config.go +++ b/server/config.go @@ -81,6 +81,8 @@ var Config = struct { HTTP string HTTPS string } + // TODO: remove with version 4.x + ForceIgnoreServiceFailure bool } Permissions struct { Open bool diff --git a/server/pipeline/items.go b/server/pipeline/items.go index 89d6224739e..00e2c024cbd 100644 --- a/server/pipeline/items.go +++ b/server/pipeline/items.go @@ -134,6 +134,12 @@ func parsePipeline(ctx context.Context, forge forge.Forge, store store.Store, cu compiler.WithWorkspaceFromURL(compiler.DefaultWorkspaceBase, repo.ForgeURL), }, } + + // TODO: remove with version 4.x + if server.Config.Pipeline.ForceIgnoreServiceFailure { + b.CompilerOptions = append(b.CompilerOptions, compiler.WithForceIgnoreServiceFailure()) + } + return b.Build() } From 3099f751b7a02b4c8f7f8154912d0aeb7854b211 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 16 Apr 2026 11:30:01 +0200 Subject: [PATCH 2/3] Add docs --- .../10-configuration/10-server.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/docs/30-administration/10-configuration/10-server.md b/docs/docs/30-administration/10-configuration/10-server.md index 3318f7c95f3..bd0b06782ab 100644 --- a/docs/docs/30-administration/10-configuration/10-server.md +++ b/docs/docs/30-administration/10-configuration/10-server.md @@ -1146,6 +1146,20 @@ Fully qualified public forge URL, used if forge url is not a public URL. Format: --- +### FORCE_IGNORE_SERVICE_FAILURE + +- Name: `WOODPECKER_FORCE_IGNORE_SERVICE_FAILURE` +- Default: true + +:::warning +Since v3.14.0, woodpecker is able to report status of services and detached steps back. +As they now can also fail, till we release a v4.0.0, we have to preserve the old behavior, +to do this we force ignore status changes by default. +Still we encourage you to disable this option and fix your pipeline config. +::: + +--- + ### GITHUB\_\* See [GitHub configuration](./12-forges/20-github.md#configuration) From 4988c190ccc81e756e69da784d7552e3125618f0 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 16 Apr 2026 22:16:01 +0200 Subject: [PATCH 3/3] better wording --- cmd/server/flags.go | 2 +- cmd/server/setup.go | 2 +- docs/docs/30-administration/10-configuration/10-server.md | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cmd/server/flags.go b/cmd/server/flags.go index fbee3af6481..2638bf5f712 100644 --- a/cmd/server/flags.go +++ b/cmd/server/flags.go @@ -410,7 +410,7 @@ var flags = append([]cli.Flag{ &cli.BoolFlag{ Sources: cli.EnvVars("WOODPECKER_FORCE_IGNORE_SERVICE_FAILURE"), Name: "force-ignore-service-failure", - Usage: "from v3.14.0 onwards detached steps & services do report it's status back, to preserver old behavior we still ignore fails by default", + Usage: "From v3.14.0 onwards, detached steps and services report their status back. To preserve the old behavior, service failures are ignored by default until v4.0.0.", Value: true, }, // diff --git a/cmd/server/setup.go b/cmd/server/setup.go index 8546a749b96..6e8bb194c1b 100644 --- a/cmd/server/setup.go +++ b/cmd/server/setup.go @@ -266,7 +266,7 @@ func setupEvilGlobals(ctx context.Context, c *cli.Command, s store.Store) (err e // TODO: remove with version 4.x server.Config.Pipeline.ForceIgnoreServiceFailure = c.Bool("force-ignore-service-failure") if server.Config.Pipeline.ForceIgnoreServiceFailure { - log.Info().Msg("WOODPECKER_FORCE_IGNORE_SERVICE_FAILURE is true by default, to prepare for upcoming versions set it to false and update your pipeline definitions if needed") + log.Info().Msg("WOODPECKER_FORCE_IGNORE_SERVICE_FAILURE is true by default. To prepare for v4.0.0, set it to false and update your pipeline definitions if needed.") } // prometheus diff --git a/docs/docs/30-administration/10-configuration/10-server.md b/docs/docs/30-administration/10-configuration/10-server.md index bd0b06782ab..6b6fcb695e7 100644 --- a/docs/docs/30-administration/10-configuration/10-server.md +++ b/docs/docs/30-administration/10-configuration/10-server.md @@ -1152,10 +1152,9 @@ Fully qualified public forge URL, used if forge url is not a public URL. Format: - Default: true :::warning -Since v3.14.0, woodpecker is able to report status of services and detached steps back. -As they now can also fail, till we release a v4.0.0, we have to preserve the old behavior, -to do this we force ignore status changes by default. -Still we encourage you to disable this option and fix your pipeline config. +Since v3.14.0, Woodpecker can report the status of services and detached steps. +Because these can now fail, until v4.0.0 is released, service failures are ignored by default to preserve backward compatibility. +We encourage you to disable this option and update your pipeline configuration. ::: ---