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

42 Commits

Author SHA1 Message Date
6543 5cdbb62751 Increase test coverage (#6677)
Co-authored-by: Claude <claude@anthropic.com>
2026-05-31 08:32:59 +02:00
6543 d0cda7b59b Cleanup e2e test setup (#6480) 2026-05-28 13:33:38 +02:00
wucm667 a7a123dc8b fix(agent): persist agent ID after auth to prevent crashloop duplicates (#6543)
Signed-off-by: wucm667 <stevenwucongmin@gmail.com>
2026-05-07 02:12:15 +02:00
6543 63fccbed96 Refactor agent rpc retry (#6515) 2026-05-01 12:49:40 +02:00
6543 ea071606b2 Make agent reconnect retry timeout configurable (#6470) 2026-04-23 17:35:39 +02:00
6543 46b73078e9 e2e test wait for grpc server teardown and stop agents (#6479) 2026-04-23 09:57:43 +02:00
Ahmad Kamamji f544242cb0 fix: add connection timeout and graceful shutdown to agent RPC client (#6414) 2026-04-10 04:19:14 +02:00
qwerty287 79cc07265e Unify import aliases (#6328)
Co-authored-by: 6543 <6543@obermui.de>
2026-03-28 15:45:23 +01:00
6543 1a94f05165 Fix report skipped status (#6300) 2026-03-22 22:35:59 +02: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 3786077c07 Update Architecture: move pipeline/rpc => rpc & server/{grpc => rpc} (#6012) 2026-01-26 21:25:38 +01:00
Sandro 9ff027bb1f Treat no available route in grpc as fatal error (#5192) 2025-05-28 01:24:44 +02:00
qwerty287 81b74025d4 Update Go imports paths (#4605)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-12-22 10:44:34 +01:00
renovate[bot] 9402e4b582 fix(deps): update module github.com/cenkalti/backoff/v4 to v5 (#4601)
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>
2024-12-21 11:52:28 +01:00
6543 f8cfda1ea9 Report custom labels set by agent admins back (#4141) 2024-10-06 17:13:41 +02:00
hg 276b279b7f Process workflow logs in batches (#4045) 2024-09-18 16:29:56 +02:00
Anbraten 599dd97d1b Wait for tracer to be done before finishing workflow (#4068) 2024-08-30 11:44:56 +02:00
6543 30cd800110 Gracefully shutdown agent (#3895) 2024-07-14 01:06:20 +02:00
6543 2d607a9ae4 agent dont report error if terminated gracefully (#3894) 2024-07-13 03:24:55 +02:00
Anbraten 2fa9432ef8 Cleanup state reporting (#3850) 2024-07-01 11:20:55 +02:00
Robert Kaussow 89e100cfd1 Add godot linter to harmonitze toplevel comments (#3650) 2024-05-13 22:58:21 +02:00
nemunaire 8e45ddd58b agent: Continue to retry indefinitely (#3599)
When the woodpecker server is not reachable (eg. for update,
maintenance, agent connection issue, ...) for a long period of time, the
agent tries continuously to reconnect, without any delay. This creates
**several GB** of logs in a short period of time.

Here is a sample line, repeated indefinitely:

```
{"level":"error","error":"rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp x.x.x.x:xxx: connect: connection refused\"","time":"2024-04-07T17:29:59Z","message":"grpc error: done(): code: Unavailable"}
```

It appears that the [backoff
package](https://pkg.go.dev/github.com/cenkalti/backoff/v4#BackOff),
after a certain amount of time, returns `backoff.Stop` (-1) instead of a
valid delay to wait. It means that no more retry should be made, [as
shown in the
example](https://pkg.go.dev/github.com/cenkalti/backoff/v4#BackOff). But
the code doesn't handle that case and takes -1 as the next delay.
This led to continuous retry with no delay between them and creates a
huge amount of logs.

[`MaxElapsedTime` default is 15
minutes](https://pkg.go.dev/github.com/cenkalti/backoff/v4#pkg-constants),
passed this time, `NextBackOff` returns `backoff.Stop` (-1) instead of
`MaxInterval`.
This commit sets `MaxElapsedTime` to 0, [to avoid `Stop`
return](https://pkg.go.dev/github.com/cenkalti/backoff/v4#ExponentialBackOff).
2024-04-09 03:24:19 +03:00
Robert Kaussow a779eed3df Enable golangci linter gomnd (#3171) 2024-03-15 18:00:25 +01:00
qwerty287 b9f6f3f9fb Replace goimports with gci (#3202)
`gci` seems to be much more strict.
2024-01-14 18:22:06 +01:00
qwerty287 00df53e941 Clean up logging (#3161)
- use `Err` method instead of format strings
- use `Msg` if no format string is used
2024-01-10 20:57:12 +01:00
6543 aab2f0e675 Use step uuid instead of name in GRPC status calls (#3143)
close #3109

~~also fix start time of steps to be set correctly~~ edgecase do not hit
anymore as we have a clear sepperation between workflows and steps now
:)

---------

Co-authored-by: Anbraten <anton@ju60.de>
2024-01-09 15:39:09 +01:00
runephilosof-karnovgroup adb2c82790 Update go module path for major version 2 (#2905)
https://go.dev/doc/modules/release-workflow#breaking

Fixes https://github.com/woodpecker-ci/woodpecker/issues/2913 fixes
#2654
```
runephilosof@fedora:~/code/platform-woodpecker/woodpecker-repo-configurator (master)$ go get go.woodpecker-ci.org/woodpecker@v2.0.0
go: go.woodpecker-ci.org/woodpecker@v2.0.0: invalid version: module contains a go.mod file, so module path must match major version ("go.woodpecker-ci.org/woodpecker/v2")
```

---------

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-12-08 08:15:08 +01:00
qwerty287 70711ed9db Replace interface{} with any (#2807)
like golang:
https://github.com/golang/go/commit/2580d0e08d5e9f979b943758d3c49877fb2324cb
2023-11-12 18:23:48 +01:00
6543 5a7b689e30 Switch to go vanity urls (#2706)
Co-authored-by: Anbraten <anton@ju60.de>
2023-11-07 08:04:33 +01:00
Thomas Anderson 3620c84da4 Unregister stateless agents from server on termination (#2606)
Closes #2027

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-11-02 01:53:47 +02:00
qwerty287 29e93bdf8b Never log tokens (#2466) 2023-09-16 10:53:37 +02:00
Anbraten 25225d4902 Update grpc generated code (#2339)
missed in #2173

---------
2023-08-28 18:00:52 +02:00
Anbraten 4de8cbec76 Rename grpc pipeline to workflow (#2173)
closes #1823

Co-authored-by: 6543 <6543@obermui.de>
2023-08-21 18:30:19 +02:00
Thomas Anderson fc5f738d6b Change token logging to trace level (#2247)
Changed from `debug` to `trace`.
2023-08-18 21:22:39 +02:00
Harry Pidcock e4ff041882 Improve agent rpc retry logic with exponential backoff (#2205)
Existing retry logic was a simple second delay, replacing it with a
exponential backoff.
Initial delay is 10ms up to 10s for the max delay. In the future this
should be made configurable.

With an extended max delay it becomes important to notice context
cancelation, so this now also selects on both the delay and context
done.
2023-08-18 15:13:13 +02:00
qwerty287 8cdac56d8f Check for correct license header (#2137) 2023-08-10 11:06:00 +02:00
6543 3d4758578a Add opt save global log output to file (#2115)
close  #1933

---------
*Sponsored by Kithara Software GmbH*
2023-08-07 20:47:30 +02:00
Anbraten 556607b525 Rework log streaming and related functions (#1802)
closes #1801
closes #1815 
closes #1144
closes  #983
closes  #557
closes #1827
regression of #1791

# TODO
- [x] adjust log model
- [x] add migration for logs
- [x] send log line via grpc using step-id
- [x] save log-line to db
- [x] stream log-lines to UI
- [x] use less structs for log-data
- [x] make web UI work
  - [x] display logs loaded from db
  - [x] display streaming logs
- [ ] ~~make migration work~~ -> dedicated pull (#1828)

# TESTED
- [x] new logs are stored in database
- [x] log retrieval via cli (of new logs) works
- [x] log streaming works (tested via curl & webui)
- [x] log retrieval via web (of new logs) works

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-06-06 09:52:08 +02:00
Anbraten c464f857ae Remove unused file system api (#1791)
Co-authored-by: 6543 <6543@obermui.de>
2023-05-31 18:03:03 +02:00
6543 92614dfb1e Agent check gRPC version against server (#1653)
close #1114

As long as the `VersionResponse` type is not changed the check will
fail/pass gracefully

example output:
```
{"level":"error","error":"GRPC version mismatch","time":"2023-03-19T19:49:09+01:00","message":"Server version next-6923e7ab does report grpc version 2 but we only understand 1"}
GRPC version mismatch
```
2023-03-19 22:42:21 +01:00
Anbraten fa5b0fb96e Fix linter (#1647) 2023-03-18 20:35:27 +01:00
Anbraten d96032349a Store an agents list and add agent heartbeats (#1189)
Co-authored-by: 6543 <6543@obermui.de>
2023-01-28 14:13:04 +01:00