Commit Graph

530 Commits

Author SHA1 Message Date
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
6543
09327abd03 Creating new engine runtime now requires backend as argument (#6268) 2026-03-20 13:44:24 +01:00
qwerty287
17dcc86942 Allow to cancel on failure (#6158) 2026-03-19 13:41:44 +01:00
confusedsushi
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
qwerty287
768f22904f Fix deprecation error (#6236) 2026-03-13 12:51:35 +01:00
6543
b6c8c8b885 refactor: pipeline runtime add description and prevent race (#6167) 2026-03-08 09:50:11 +01:00
qwerty287
22899b6581 Use native slice in tests (#6190) 2026-03-03 18:00:28 +01:00
Harri Avellan
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
qwerty287
39a7ebda75 Independently evaluate status filter and support on workflows (#6183)
fix https://github.com/woodpecker-ci/woodpecker/issues/6161

And also allow `when.status` at workflow level. `runs_on` is deprecated then.


Co-authored-by: 6543 <6543@obermui.de>
2026-03-02 17:37:37 +01:00
qwerty287
05f55fb0f9 Update schema (#6156)
closes https://github.com/woodpecker-ci/woodpecker/issues/6135

Everything else in the issue is correct, and nothing that has to be fixed.

Also changes the parsing for the `status` filter from the constraint list (with includes/excludes) to an allowlist only (as we only have two statuses it's quite useless to have an exclude and this was also not documented).
2026-02-26 12:46:50 +01:00
qwerty287
95048409f2 Only set tag env on tags (#6142) 2026-02-22 08:42:50 +01:00
renovate[bot]
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
6543
a63b93f5ee Refactor pipeline engine (#6073)
restructure pipeline/*.go to use submodules

<!-- https://claude.ai/chat/1b8965d7-5bca-42c7-86b4-48c2d645c362 -->

- pipeline/error.go -> pipeline/errors/...
- pipeline/pipeline.go#Runtime -> pipeline/runtime/runtime.go
- pipeline/pipeline.go#execAll -> pipeline/runtime/executor.go
- pipeline/shutdown.go -> pipeline/runtime/shutdown.go
- pipeline/logger.go ->pipeline/logging
- pipeline/tracer.go -> pipeline/tracing
- pipeline/pipeline.go#State -> state/state.go
2026-02-13 11:56:43 +01:00
6543
ff0d43f1d3 document how to ignore failure on services (#6106)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2026-02-12 12:09:57 +01:00
qwerty287
b4708c895e Fix typos in pipeline/pipeline.go (#6094)
Co-authored-by: 6543 <6543@obermui.de>
2026-02-09 14:54:21 +01:00
6543
904a40674f Detached or service steps report back too (#6039) 2026-02-07 09:18:13 +01:00
qwerty287
fe9db664fe Add some tests (#6076) 2026-02-06 23:49:42 +01:00
6543
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
6543
cd62ab5f3e Local backend: cleanup generated script for cmd.exe shell (#6029) 2026-01-28 07:10:29 +01:00
6543
47ffb3209e Local backend: setup clone step respects context (#6030) 2026-01-28 06:47:18 +01:00
Sam Richard
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
6543
3786077c07 Update Architecture: move pipeline/rpc => rpc & server/{grpc => rpc} (#6012) 2026-01-26 21:25:38 +01:00
6543
9d21e09c46 Local backend handle canceled steps case (#6008) 2026-01-25 17:26:56 +01:00
qwerty287
bd8e2f350e Use require to exit tests (#5998) 2026-01-22 09:41:20 +01:00
qwerty287
cd88723b2d Use NoError for error assertion (#5992) 2026-01-20 08:43:51 +01:00
6543
d1b7e35ca8 Improve service syntax related docs and tests nits (#5991) 2026-01-19 19:44:18 +02:00
6543
4e0b91fbd2 Remove deactivated secrets type from container defintion (#5983) 2026-01-18 21:48:47 +01:00
qwerty287
8c231aa99d Allow to disable a cron (#5896)
Co-authored-by: 6543 <6543@obermui.de>
2025-12-24 09:02:03 +00:00
Martin Schmidt
b7b33db98b feat(kubernetes): add support for pod affinity and anti-affinity configurations (#5854) 2025-12-17 13:59:22 +01:00
6543
93cba04b36 Allow untrusted repo to still drop network for steps (#5820)
as it is an undocumented feature this might change / move into a more generalized backend network option at some point ...

but i think we could at least support it as proposed in this patch meanwhile
2025-12-09 16:57:44 +01:00
Henrik Huitti
ba2b806e83 fix(kubernetes): sanitize step names or skip hostname assignment (#5848) 2025-12-09 01:37:12 +01:00
Martin Schmidt
6aab68063c fix: Reintroduce stop all pods on workflow (#5815) 2025-12-02 21:10:01 +01:00
Martin Schmidt
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
Henrik Huitti
068a961d01 feat: include CI_COMMIT_TAG env in deployment events (#5773) 2025-11-21 16:13:55 +01:00
qwerty287
4ab721b920 Revert "Add support for sidecar containers and volumes in Kubernetes backend" (#5726) 2025-11-06 17:33:23 +01:00
Martin Schmidt
02ea16ecbf Add support for sidecar containers and volumes in Kubernetes backend (#5666) 2025-11-06 16:45:38 +01:00
LUKIEYF
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
6543
dd0f5932b3 Switch from BoolTrue to optional.Option[bool] (#5693) 2025-11-04 14:43:30 +01:00
renovate[bot]
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
Harri Avellan
69fc5bfa25 fix: panic due to an invalid memory address when injectSecretRecursive encounters nil values (#5699) 2025-10-31 08:10:00 +01:00
LUKIEYF
7ce65365b1 Enhancement log stream reading and writing and handle new lines and max-size (#5683)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-29 19:13:20 +01:00
6543
393a598212 Make local backend work with cli exec (#4102) 2025-10-27 13:12:26 +01:00
6543
3d43a3fce6 Make pipeline/frontend/yaml/* types able to be marshaled back to YAML (#1835) 2025-10-25 10:27:22 +02:00
6543
75f773062b cli: show description of default value for --backend-local-temp-dir instead of value (#5656) 2025-10-20 23:30:46 +02:00
Marcus Ramberg
ab641bd3fe Improve log.CopyByLine to be more robust (#5641) 2025-10-16 15:51:50 +02:00
Marcus Ramberg
647fa843f6 Modernize a couple of loops, fix incorrect function docs (#5637) 2025-10-14 13:00:19 +02:00
6543
aeb29f2609 flake.lock: Update (#5635) 2025-10-13 18:52:28 +02:00
6543
a68111fb24 Make TestCopyLineByLine less flaky (#5589) 2025-10-02 08:17:47 +02:00
6543
61835d72bb make local backend tests less flaky (#5586) 2025-10-01 20:04:49 +02:00