Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions cmd/server/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
6 changes: 6 additions & 0 deletions cmd/server/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
13 changes: 13 additions & 0 deletions docs/docs/30-administration/10-configuration/10-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions pipeline/frontend/yaml/compiler/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions pipeline/frontend/yaml/compiler/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
7 changes: 7 additions & 0 deletions pipeline/frontend/yaml/compiler/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
2 changes: 2 additions & 0 deletions server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ var Config = struct {
HTTP string
HTTPS string
}
// TODO: remove with version 4.x
ForceIgnoreServiceFailure bool
}
Permissions struct {
Open bool
Expand Down
6 changes: 6 additions & 0 deletions server/pipeline/items.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down