mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-09-05 20:07:25 +00:00
Add WOODPECKER_FORCE_IGNORE_SERVICE_FAILURE config to preserve non breaking behavior by default (#6448)
This commit is contained in:
@@ -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 and services report their status back. To preserve the old behavior, service failures are ignored by default until v4.0.0.",
|
||||
Value: true,
|
||||
},
|
||||
//
|
||||
// resource limit parameters
|
||||
//
|
||||
|
||||
@@ -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 v4.0.0, set it to false and update your pipeline definitions if needed.")
|
||||
}
|
||||
|
||||
// prometheus
|
||||
server.Config.Prometheus.AuthToken = c.String("prometheus-auth-token")
|
||||
|
||||
|
||||
@@ -1146,6 +1146,19 @@ 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 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.
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
### GITHUB\_\*
|
||||
|
||||
See [GitHub configuration](./12-forges/20-github.md#configuration)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,8 @@ var Config = struct {
|
||||
HTTP string
|
||||
HTTPS string
|
||||
}
|
||||
// TODO: remove with version 4.x
|
||||
ForceIgnoreServiceFailure bool
|
||||
}
|
||||
Permissions struct {
|
||||
Open bool
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user