Commit graph

348 commits

Author SHA1 Message Date
Anbraten
ba858d67cc
Adjust logger types (#3859) 2024-07-01 19:03:14 +02:00
Anbraten
2fa9432ef8
Cleanup state reporting (#3850) 2024-07-01 11:20:55 +02:00
6543
daeab8d3c7
Add dummy backend (#3820)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-06-30 23:06:07 -07:00
6543
402938e216
Exclude mocks from release build (#3831) 2024-06-25 12:23:07 +02:00
Thomas Anderson
7bc38a1d8b
K8s secrets reference from step (#3655) 2024-06-23 18:20:21 +02:00
Anbraten
8b387e73ee
Improve step logging (#3722) 2024-06-13 17:18:32 +02:00
qwerty287
044c3a6dd5
Respect cli argument when checking docker backend availability (#3770)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-06-10 12:51:38 +02:00
Thomas Anderson
065eebd306
Agent-wide node selector (#3608)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-06-03 17:25:28 +02:00
Anbraten
f6904d6662
Fix privileged steps in kubernetes (#3711) 2024-05-30 18:53:03 +02:00
6543
42f2734308
cspell lint go code (#3706) 2024-05-24 22:35:04 +02:00
renovate[bot]
37ea906958
fix(deps): update golang-packages (#3713)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
2024-05-23 17:37:21 +02:00
Kai J
faf6b33140
Setting for empty commits on path condition (#3708) 2024-05-14 16:28:14 +02:00
6543
7b3b09d628
Lint file names and directories via cSpell too (#3703) 2024-05-14 02:45:03 +02:00
Robert Kaussow
89e100cfd1
Add godot linter to harmonitze toplevel comments (#3650) 2024-05-13 22:58:21 +02:00
Thomas Anderson
ae72102503
Ability to set pod annotations and labels from step (#3609)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-05-11 11:45:29 +02:00
ianlv
6004e9907d
Correct function names (#3681)
Signed-off-by: ianlv <sunlvyun@outlook.com>
2024-05-04 14:13:43 +02:00
Fernando Barbosa
e6bda2c2b3
Support github deploy task (#3512)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-05-02 18:56:19 +02:00
qwerty287
225ddb586d
Rework entrypoints (#3269)
Co-authored-by: Thomas Anderson <127358482+zc-devs@users.noreply.github.com>
Co-authored-by: 6543 <m.huber@kithara.com>
2024-05-02 14:52:01 +02:00
qwerty287
b2cfa37682
Deprecate environment filter and improve errors (#3634)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-04-24 16:07:16 +02:00
Anbraten
d494b6a959
Use forge from db (#1417)
This is the first step towards support for multiple forges (#138). It
inserts a forge using the currently existing env varaibles into db and
uses this forge from db later on in all places of the code.

closes #621

addresses #138 

# TODO
- [x] add forges table
- [x] add id of forge to repo
- [x] use forge of repo
- [x] add forge from env vars to db if not exists
- [x] migrate repo.ForgeID to the newly generated forge
- [x] support cache with forge from repo
- [x] maybe add forge loading cache? (use LRU cache for forges, I expect
users to have less than 10 forges normally)

---------

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-04-16 08:04:55 +02:00
Robert Kaussow
781628816d
Fix make in_docker generate (#3616) 2024-04-15 17:46:44 +02:00
qwerty287
00f0fcd416
Rework addons (use rpc) (#3268)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-04-15 10:04:21 +02:00
Elias
f211a780f3
Handle ImagePullBackOff pod status (#3580)
close: https://github.com/woodpecker-ci/woodpecker/issues/3555

Put the same logic from `waitStep` and call the function
`isImagePullBackOffState` in the `tailStep` function.

---------

Co-authored-by: elias.souza <elias.souza@quintoandar.com.br>
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-04-15 09:08:13 +02:00
qwerty287
c9a3bfb321
Fix spellcheck and enable more dirs (#3603) 2024-04-09 09:04:53 +02:00
YR Chen
e1b574a4bc
Add runtimeClassName in Kubernetes backend options (#3474)
Resolves #3473

---------

Co-authored-by: Thomas Anderson <127358482+zc-devs@users.noreply.github.com>
2024-03-29 10:29:07 +01:00
qwerty287
2029813fc2
Remove unused cache properties (#3567) 2024-03-29 09:48:28 +01:00
qwerty287
75803dba41
Fix uppercased env (#3516)
closes #3515 

I think after this is fixed, we should publish a new release as this can
be quite important.

Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-03-20 16:53:33 +02:00
qwerty287
f23d42b49e
Fix env schema (#3514)
closes #3510
2024-03-20 09:28:02 +01:00
Robert Kaussow
a779eed3df
Enable golangci linter gomnd (#3171) 2024-03-15 18:00:25 +01:00
zowhoey
ad507d8ee4
Move generic agent flags to cmd/agent/core (#3484) 2024-03-15 11:31:35 +01:00
Anbraten
9db9c7116f
Improve security context handling (#3482) 2024-03-13 22:41:13 +01:00
Anbraten
c3e4c14c23
Set pull-request id and labels on pr-closed event (#3442) 2024-02-26 14:07:33 +01:00
qwerty287
9b0c4e4e3c
Fix env var naming (#3438)
closes #3436
2024-02-25 10:12:40 +01:00
6543
6eafb37aba
nit: compiler.Compile explizite init Environment map 2024-02-23 17:40:52 +01:00
qwerty287
d59bc64823
Fix server panic (#3426)
Closes #3424
2024-02-23 16:32:06 +01:00
qwerty287
de5c65939a
Deprecate alternative names on secrets (#3406)
Closes https://github.com/woodpecker-ci/woodpecker/discussions/2274

# deprecation of alternative names

Instead of
```yaml
secrets:
  - source: some_secret
    target: some_env
```
you now write:
```yaml
environment:
  some_env:
    from_secret: some_secret
```

Also, it's possible to use complex yaml objects in `environment`,
they're turned into json (just like `settings`).
2024-02-22 18:25:57 +01:00
qwerty287
0c9bbf91a3
Do not alter secret key upper-/lowercase (#3375) 2024-02-20 14:20:25 +01:00
Elias
bffc9c8ff8
fix: can't run multiple services on k8s (#3395)
Fix Issue: https://github.com/woodpecker-ci/woodpecker/issues/3288

The way the pod service starts up makes it impossible to run two or more
pipelines at the same time when we have a service section.

The idea is to set the name of the service in the same way we did for
the pod name.

Pipeline: 

```yaml

services:
  mydb:
    image: mysql
    environment:
      - MYSQL_DATABASE=test
      - MYSQL_ROOT_PASSWORD=example
    ports:
      - 3306/tcp
steps:
  get-version:
    image: ubuntu
    commands:
      - ( apt update && apt dist-upgrade -y && apt install -y mysql-client 2>&1 )> /dev/null
      - sleep 30s # need to wait for mysql-server init
      - echo 'SHOW VARIABLES LIKE "version"' | mysql -uroot -hmydb test -pexample
```

Running more than one pipeline result:


![image](https://github.com/woodpecker-ci/woodpecker/assets/22245125/e512309f-0d1e-4125-bab9-2357a710fedd)

---------

Co-authored-by: elias.souza <elias.souza@quintoandar.com.br>
2024-02-17 12:30:06 +01:00
qwerty287
5d3a503f98
Add link checking (#3371)
Closes https://github.com/woodpecker-ci/woodpecker/issues/3332
2024-02-12 15:00:33 +01:00
qwerty287
894ab51215
Fix schema links (#3369)
Closes https://github.com/woodpecker-ci/woodpecker/issues/2063
2024-02-11 09:53:02 +01:00
qwerty287
f369d2c543
Lint for event filter and deprecate exclude (#3222)
Closes https://github.com/woodpecker-ci/woodpecker/discussions/2174

- return bad habit error if no event filter is set
- If this is applied, it's useless to allow `exclude`s on events.
Therefore, deprecate it together with `include`s which should be
replaced by `base.StringOrSlice` later.
2024-02-10 17:33:05 +01:00
sinlov
134fb7900c
fix: update schema event_enum to remove error warning when.event (#3357)
change test case to check

fix #3356
2024-02-09 08:05:21 +01:00
Anbraten
6785806873
Fix backend detection (#3353)
closes #3352
2024-02-09 00:04:43 +01:00
Anbraten
0b91317cde
Fix linter (#3354) 2024-02-08 22:49:07 +01:00
qwerty287
6892a9ca57
Parse backend options in backend (#3227)
Currently, backend options are parsed in the yaml parser.
This has some issues:
- backend specific code should be in the backend folders
- it is not possible to add backend options for backends added via
addons
2024-02-08 18:39:32 +01:00
qwerty287
f92f8b17a3
Make agent usable for external backends (#3270) 2024-02-08 16:33:22 +01:00
Fernando Barbosa
c7467b9828
fix: agent panic when node is terminated during step execution (#3331)
Fixes https://github.com/woodpecker-ci/woodpecker/issues/3330

This adds error handling on the agent's WaitStep function, on two
sections where it could encounter a `panic: runtime error: invalid
memory address or nil pointer dereference` in case it could no longer
access complete information about a specific pod.

This error was found to happen if the node in which the pod was running
was terminated during the step's execution.
spite active pipelines being executed on the node.

Now instead of a panic on the agent's logs and undefined behavior on the
UI it will display a more helpful error message on the UI.

### Additional context

We observed the bug first on v2.1.1, but tested the fix internally on
top of 2.3.0.


![image](https://github.com/woodpecker-ci/woodpecker/assets/7269710/dfbcf089-85f7-4b5d-8102-f21af95c5cda)
2024-02-05 22:46:14 +01:00
qwerty287
9df572ef31
Add release event trigger (#3226)
Supersedes #764 

Bitbucket does not support release webhooks.

---------

Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
2024-01-30 17:39:00 +01:00
Lukas
94b882fb95
Add spellcheck config (#3018)
Part of #738 

```
pnpx cspell lint --gitignore '{**,.*}/{*,.*}'
```

---------

Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2024-01-27 21:15:10 +01:00
Anbraten
0b5eef7d1e
Improve secret availability checks (#3271) 2024-01-27 20:59:44 +01:00