248 Commits
Author SHA1 Message Date
6543andGitHub 17d0f12cf3 fix second overflow build error (#6415) 2026-04-10 11:46:45 +03:00
6543andGitHub 05218c972b fix build error (#6413) 2026-04-09 14:54:46 +02:00
Uğur TafralıandGitHub f2abd692e9 Fix Windows container exit code handling and error checks (#6411) 2026-04-09 05:07:22 +02:00
6543andGitHub f0e56485dc Dummy backend support cancel (#6390) 2026-04-06 20:21:23 +02:00
qwerty287andGitHub 926470fdb5 Migrate to moby (#6357) 2026-03-31 16:58:27 +02:00
6543andGitHub af471c5372 Fix pipeline cancel (#6320) 2026-03-30 19:33:54 +02:00
79cc07265e Unify import aliases (#6328)
Co-authored-by: 6543 <6543@obermui.de>
2026-03-28 15:45:23 +01:00
qwerty287andGitHub 3156cd687c Fix license headers (#6205) 2026-03-23 11:54:07 +01:00
6543andGitHub 513011d1bf Forward skipped step state asap it is known (#6295) 2026-03-22 18:20:44 +01:00
6543andGitHub db130b2a1c Add backend interface to mockery to generated mock (#6269) 2026-03-20 16:56:51 +01:00
qwerty287andGitHub 17dcc86942 Allow to cancel on failure (#6158) 2026-03-19 13:41:44 +01:00
ab73370e93 make it possible to disable the isolated home for local agents (#6251)
Co-authored-by: 6543 <6543@obermui.de>
2026-03-19 13:40:24 +01:00
Harri AvellanandGitHub 25842498c6 Prevent leaking goroutines on cancelled steps (#6186)
I've been debugging case where Kubernetes backend agents occasionally are OOMKilled. During the investigation noticed an increasing amount of goroutines on the agent processes which turned out to be multiple goroutines hanging on:
```
runtime.gopark(proc.go:461)
runtime.chanrecv(chan.go:667)
runtime.chanrecv1(chan.go:509)
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/kubernetes.(*kube).WaitStep(kubernetes.go:325)
go.woodpecker-ci.org/woodpecker/v3/pipeline/runtime.(*Runtime).exec(executor.go:261)
go.woodpecker-ci.org/woodpecker/v3/pipeline/runtime.(*Runtime).execAll.func1.1(executor.go:174)
go.woodpecker-ci.org/woodpecker/v3/pipeline/runtime.(*Runtime).execAll.func1.2(executor.go:200)
runtime.goexit(asm_arm64.s:1268)
go.woodpecker-ci.org/woodpecker/v3/pipeline/runtime.(*Runtime).execAll.func1(executor.go:199)
```

My analysis is that on cancel nothing fires the `finished` channel, as pod is deleted i.e. not updated (there's a registed handler for pod update events). There was already a comment about adding cancellation handler for ctx.Done, so I think this is the proper way (instead of adding event handler for pod deletion).
2026-03-02 20:14:56 +00:00
2012d292be chore(deps): update golangci/golangci-lint docker tag to v2.10.1 (#6138)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2026-02-21 10:42:37 +01:00
6543andGitHub 904a40674f Detached or service steps report back too (#6039) 2026-02-07 09:18:13 +01:00
8a8f9ad3aa Fix pipeline cancellation status handling and step state synchronization (#6011)
Co-authored-by: pnkcaht <samzoovsk19@gmail.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: Lauris B <lauris@nix.lv>
2026-02-05 21:41:05 +01:00
6543andGitHub cd62ab5f3e Local backend: cleanup generated script for cmd.exe shell (#6029) 2026-01-28 07:10:29 +01:00
6543andGitHub 47ffb3209e Local backend: setup clone step respects context (#6030) 2026-01-28 06:47:18 +01:00
Sam RichardandGitHub b1cbd961b2 Fix/docker kill container on cancel (#6018)
## Fix: kill docker container on pipeline cancellation

### What was happening
When a pipeline step was canceled (e.g. manual cancel or agent shutdown), the Docker backend would stop waiting for the container but **would not actively terminate it**.  
This caused containers running long-lived commands (like `sleep`, `tail -f`, servers, etc.) to continue running in the background.

## Related Issue
Closes #6016 

### What this PR changes
This PR ensures that **when the step context is canceled**, the running Docker container is **immediately killed**.

- Listens to `ctx.Done()` in `WaitStep`
- Sends a `ContainerKill` using a non-cancelable context
- Preserves existing behavior for normal container exit
- Prevents orphaned containers after pipeline cancellation

### Why this approach
Docker containers do not automatically stop when the caller context is canceled.  
Explicitly killing the container on `ctx.Done()` guarantees correct cleanup and matches expected CI behavior.
2026-01-27 00:19:44 +01:00
6543andGitHub 9d21e09c46 Local backend handle canceled steps case (#6008) 2026-01-25 17:26:56 +01:00
Martin SchmidtandGitHub b7b33db98b feat(kubernetes): add support for pod affinity and anti-affinity configurations (#5854) 2025-12-17 13:59:22 +01:00
Henrik HuittiandGitHub ba2b806e83 fix(kubernetes): sanitize step names or skip hostname assignment (#5848) 2025-12-09 01:37:12 +01:00
Martin SchmidtandGitHub 6aab68063c fix: Reintroduce stop all pods on workflow (#5815) 2025-12-02 21:10:01 +01:00
9f828c96b0 Add support for headless Kubernetes services (#5764)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henrik Huitti <henrik.huitti@henhu.fi>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2025-12-02 14:42:00 +01:00
qwerty287andGitHub 4ab721b920 Revert "Add support for sidecar containers and volumes in Kubernetes backend" (#5726) 2025-11-06 17:33:23 +01:00
Martin SchmidtandGitHub 02ea16ecbf Add support for sidecar containers and volumes in Kubernetes backend (#5666) 2025-11-06 16:45:38 +01:00
LUKIEYFandGitHub 40f847b944 Add Header User-Agent for request client (#5664)
add Header User-Agent for request client for more precise in recognized the http request from.

close #3778
2025-11-05 11:41:48 +01:00
09e8d32353 chore(deps): update dependency golangci/golangci-lint to v2.6.0 (#5702)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
2025-11-03 15:22:20 +01:00
6543andGitHub 393a598212 Make local backend work with cli exec (#4102) 2025-10-27 13:12:26 +01:00
6543andGitHub 75f773062b cli: show description of default value for --backend-local-temp-dir instead of value (#5656) 2025-10-20 23:30:46 +02:00
6543andGitHub 61835d72bb make local backend tests less flaky (#5586) 2025-10-01 20:04:49 +02:00
6543andGitHub 44c8921c19 local backend: fix steps having logs form other steps (#5582)
## problem

if steps where started concurrent, the stdout pipeline reader war overwritten and you randomly got the wrong command stream 
from a step.

## change

where we have possible race conditions, we now use thread save types
e.g. store the command struct and the output reader in sync.Map

also a lot of tests where added
2025-10-01 16:58:37 +02:00
6543andGitHub 2a97ae9bcd Document pipeline backend engine interface precisely (#5583) 2025-10-01 13:06:34 +02:00
6543andGitHub 9edaa1e0c3 local backend test shells if unknown (#5570)
currently if we don't know the shell we just assume posix.
this adds a small test, to ensure it is and fail gracefully before doing weird stuff.

## Test Conf

```yaml
skip_clone: true
steps:
  build:
    image: "true"
    commands:
      - echo "building..."
```
2025-10-01 12:29:48 +02:00
6543andGitHub e11f110db0 local backend: fix windows cmd.exe command escaping (#5569) 2025-09-30 16:52:43 +02:00
0fc615c178 Trace errors during SetupWorkflow, make service step setup errors visible to user (#5559)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2025-09-28 21:56:43 +02:00
Henrik HuittiandGitHub a3c3846c16 fix(k8s): add retry logic with exponential backoff for pod log streaming (#5550) 2025-09-25 18:37:51 +00:00
Henrik HuittiandGitHub 0bd69e876f Add task UUID label to Kubernetes pods (#5544) 2025-09-23 20:30:20 +02:00
GustedandGitHub d2ea85e55f fix: allow spaces in WOODPECKER_PLUGINS_PRIVILEGED (#5494) 2025-09-09 22:33:53 +00:00
d95b7a43a2 fix(deps): update golang-packages (#5467)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
2025-08-28 11:45:38 +02:00
dc7795e64b Add fsGroupChangePolicy option to Kubernetes backend (#5416)
Co-authored-by: Lilly Sell <sell@b1-systems.de>
2025-08-15 10:28:38 +02:00
d7495357d5 Add Agent-level Tolerations setting (#5266)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-08-10 10:12:42 +02:00
LillyandGitHub 147256e3a8 feat(k8s): k8s priority class name config (#5391) 2025-08-09 16:33:47 +02:00
e9ab04f88b Support namespace per org for Kubernetes step secrets (#5383)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2025-08-05 09:27:18 +02:00
Henrik HuittiandGitHub 79e4dd5380 feat(k8s): Kubernetes namespace per organization (#5309) 2025-07-22 17:22:26 +03:00
Harri AvellanandGitHub 5c00b9d74b Prevent secrets from leaking to Kubernetes API Server logs (#5305) 2025-07-14 17:45:13 +03:00
qwerty287andGitHub fe5ea7ad3b Simplify backend types (#5299) 2025-07-05 12:59:17 +03:00
e92706bfd8 Revert "kubernetes: prevent secrets from leaking to api-server logs" (#5293)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2025-07-05 09:40:40 +03:00
Harri AvellanandGitHub 5e052f5579 kube backend: prevent secrets from leaking to Kubernetes apiserver logs (#5196) 2025-06-14 22:44:33 +02:00
71f24f5d44 fix(deps): update golang-packages to v28.2.1+incompatible (#5217)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
2025-06-06 07:20:03 +02:00