1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2026-06-03 16:35:37 +02:00

578 Commits

Author SHA1 Message Date
6543 7f46a5dc2f pipeline: use more explizite error for step dependencies filtered out by its conditions (#6680) 2026-05-31 15:16:12 +03:00
qwerty287 4df2e41150 Add commit timestamp env vars (#6670)
Co-authored-by: Akash Kumar <meakash7902@gmail.com>
2026-05-31 12:23:53 +02:00
Simon C. Kemper a765cb885a fix(kubernetes): retry WaitStep when container terminated state not yet finalized (#6672)
## Problem

Kubelet sets `pod.Status.Phase = Succeeded` before finalizing `containerStatuses[0].state.terminated`. When the informer sees the phase change and `WaitStep` calls `Get()`, the container status may still show `Terminated == nil`, causing a hard error:

```
no terminated state found for container wp-XXX/wp-XXX
```

This is a known race in the Kubernetes API server/kubelet eventually-consistent model. The window is normally milliseconds but widens to seconds under load (apiserver latency spikes, ResourceQuota admission storms, node pressure).

## Fix

Wrap the post-informer `Get()` + `Terminated == nil` check in `backoff.Retry` with exponential backoff (200ms initial, 5s max interval, 15s total budget). This mirrors the retry pattern already used for `TailStep` log stream recovery (#5550).
2026-05-30 12:35:53 +02:00
6543 c61d7403b2 Migrate gopkg.in/yaml.v3 usages to go.yaml.in/yaml/v4 (#6651) 2026-05-28 15:08:09 +02:00
Simon Meyer 64d7ed8952 Support optional flag in depends_on for workflows and steps (#6461)
Extends `depends_on` to accept objects with `name` and `optional` fields, at both workflow and step level. When `optional: true`, the dependency is silently dropped if the referenced workflow/step is not part of the pipeline (e.g. filtered out by `when` conditions). If present, it is enforced as usual.

Co-authored-by: 6543 <6543@obermui.de>
2026-05-28 09:23:42 +02:00
Akash Kumar 4c56f40cf3 Deduplicate schema linter composition errors (#6633) 2026-05-26 20:05:23 +02:00
Julien Vincent b6880141e2 Allow disabling service workspace volumes in k8s (#6644) 2026-05-26 18:43:46 +02:00
6543 d37ab38ae1 local backend: on linux / mac start commands in own process group and kill the group on cancel (#6609) 2026-05-26 14:44:50 +02:00
Harri Avellan 70d1b48b0e k8s: add guards to stop pipeline services upon completion (#6623)
As described in #6616 occassional services are not terminated when pipeline completes. It appears that if the service pods are terminated before WaitStep setups hooks for these, the delete events are lost and services end up running until the pipeline timeout exceeds.

The PR adds delete event handler and a check for the special case where the pod is already terminated when the event handlers are set.
2026-05-23 01:39:41 +02:00
Eric Zhou 8905b8fa53 Add CI_PIPELINE_RERUNS environment variable (#6588) 2026-05-17 19:13:23 +02:00
6543 11f74a6291 format with gofumpt v0.10.0 (#6573) 2026-05-14 14:02:43 +02:00
6543 4b71152ace Fix race in local backend tests (#6574) 2026-05-14 08:15:40 +02:00
Anbraten e4dfbf86c6 Refactor server/.../step_builder into pipeline/.../builder (#3967)
Extract the `step_builder` from the server to the pipeline package.
This cleans the interfaces / structure and will allow us to re-use it in the cli to correctly support pipeline execution (things like `depends_on` support).

Co-authored-by: Anton Bracke <anton.bracke@fastleansmart.com>
Co-authored-by: 6543 <6543@obermui.de>
2026-05-13 19:08:38 +02:00
6543 9130c497d4 Expose step type to step env (#4290) 2026-05-07 13:08:54 +02:00
6543 7cef7a8a15 pipeline runtime: move setting step environment variables into own func and add CI_PIPELINE_STATUS back (#6516) 2026-05-01 15:40:52 +02:00
Alex Caston 85c71fb01e Kubernetes: precreate workingDir as nonroot when required (#6322)
### Problem
When the working directory is set to a directory that doesn't exists (for example, as `plugin-git` does), kubelet will pre-create it with ownership set to `root:root` and permissions `0755` . This makes pods running as non-root unable to write to it, causing permission errors.

### Solution
Added a `podInitContainer` function that conditionally creates an init container to pre-create the working directory with the correct permissions before the main step container starts.

### Behavior
- If the pod runs as root (`RunAsUser == 0` or unset), no init container is created. Kubelet handles directory creation automatically
- If the working directory matches a volume mount path exactly, no init container is needed. `FSGroupChangePolicy` handles permissions
- An init container is only created when the working directory is nested within a volume mount path
- The init container uses `busybox:stable-musl` with minimal resource limits (5m CPU, 5Mi memory) and drops all capabilities.

### Related issues and PRs
- Solves the error mentioned in https://github.com/woodpecker-ci/woodpecker/issues/5346#issuecomment-3211408746 without requiring a previous step.
- In addition to #6307 and #6310, this will make it easier to run woodpecker ci workloads in a namespace that enforces [Pod Security Standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/)
2026-04-28 17:21:45 +02:00
Alex Caston 43dcdc19a1 Kubernetes: Support allowPrivilegeEscalation and capabilities backend_options (#6307) 2026-04-28 17:17:00 +02:00
6543 60df1c618d Fix workflow hang on services (#6507)
because we now wait for all steps to trace status back before we return, the defere did not tear down services anymore ...

... we now explicit tear down services and steps after all stages have executed.

Also adds tests to check for that and update the dummy backend to fullfill the interface contract of killing all "running" steps with DestroyWorkflow.
2026-04-27 09:11:33 +02:00
6543 4dd3be7f96 Move wait for log uploads logic out of logger and tracer into pipeline runtime (#6471) 2026-04-25 16:36:26 +02:00
Ralf Haferkamp 9789615aa3 Add 'entrypoint' property to service in schema (#6487)
Co-authored-by: test taset <devops@opencloud.eu>
2026-04-23 12:50:59 +02:00
6543 8e6084c661 Set default of WOODPECKER_BACKEND_{DOCKER,K8S}_STOP_TIMEOUT to 20s (#6475) 2026-04-22 21:04:40 +02:00
6543 950534751b Add WOODPECKER_FORCE_IGNORE_SERVICE_FAILURE config to preserve non breaking behavior by default (#6448) 2026-04-17 17:10:03 +02:00
6543 b1b388abdf Docker/K8s: add config for stop timeout (#6445) 2026-04-17 01:34:39 +02:00
6543 755fc2a14f Init minimal e2e tests (#6391) 2026-04-17 00:46:53 +02:00
6543 4390796985 Fix race in pipeline runtime (#6451)
as step tracer is also used to update workflow environment variables
2026-04-16 00:41:39 +02:00
6543 e173bed3f1 Kubernetes: detached steps are no services (#6435) 2026-04-15 15:29:01 +02:00
6543 3058b85cc9 Docker backend should retry to delete volume on "in use" error (#6381) 2026-04-15 13:27:04 +02:00
6543 66e221b4b1 Move skip pipeline by commit message into pipeline/frontend package (#6437)
and add some custom types for events and failure in metadata package.

no logic change at all.
2026-04-15 09:50:03 +02:00
6543 3e61f444e5 Fix build error and include status calculation (#6436) 2026-04-15 09:24:41 +02:00
Harri Avellan b22ac757f3 chore: remove excessive dev/test log outputs (#6432) 2026-04-13 19:47:30 +02:00
Aidan Coyle 7749f6097f Fix erroneous linter error for plugin privileges (#6424) 2026-04-11 17:01:28 +02:00
6543 17d0f12cf3 fix second overflow build error (#6415) 2026-04-10 11:46:45 +03:00
6543 05218c972b fix build error (#6413) 2026-04-09 14:54:46 +02:00
Uğur Tafralı f2abd692e9 Fix Windows container exit code handling and error checks (#6411) 2026-04-09 05:07:22 +02:00
6543 a68860058c Support string for when.status again (#6406) 2026-04-08 15:40:40 +02:00
6543 f0e56485dc Dummy backend support cancel (#6390) 2026-04-06 20:21:23 +02:00
6543 704245d96f Extend workflow integration tests (#6272) 2026-03-31 17:27:21 +02:00
qwerty287 926470fdb5 Migrate to moby (#6357) 2026-03-31 16:58:27 +02:00
qwerty287 8e7096fcf6 Deprecate commit avatar envs (#6356) 2026-03-31 13:23:39 +02:00
6543 af471c5372 Fix pipeline cancel (#6320) 2026-03-30 19:33:54 +02:00
6543 fde1d917e2 Refactor pipeline runtime code (#6166)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2026-03-30 11:24:36 +03:00
qwerty287 79cc07265e Unify import aliases (#6328)
Co-authored-by: 6543 <6543@obermui.de>
2026-03-28 15:45:23 +01:00
6543 7a9f1ff2dc refactor move state.State.Workflow into own type (#6338) 2026-03-28 15:40:15 +01:00
6543 280d2e902a Fix workflow serialize to omit skip_clone if false (#6319) 2026-03-24 20:27:29 +02:00
Sim-hu f842ce2cc2 Improve linter warning when step has no when block (#6314) 2026-03-24 15:05:49 +01:00
qwerty287 3156cd687c Fix license headers (#6205) 2026-03-23 11:54:07 +01:00
6543 513011d1bf Forward skipped step state asap it is known (#6295) 2026-03-22 18:20:44 +01:00
6543 0214e4cd33 Only add compatibility environment variables for drone-ci to plugins (#6271) 2026-03-21 19:40:34 +01:00
6543 60a4d09f16 Add workflow integration test (#6270) 2026-03-21 11:54:48 +01:00
6543 db130b2a1c Add backend interface to mockery to generated mock (#6269) 2026-03-20 16:56:51 +01:00