Commit graph

366 commits

Author SHA1 Message Date
6543
12df59d0ec
Add step name as label to docker containers (#3137)
and add a test
2024-01-09 06:01:34 +01:00
6543
c64340cf8f
Use UUID instead of step name where possible (#3136)
things I found while looking at  #3109
2024-01-09 05:43:03 +01:00
6543
31614d0e38
Use step type to detect services in Kubernetes backend (#3141)
and use the correct name for tail log

---------

Co-authored-by: Anbraten <anton@ju60.de>
2024-01-09 05:42:36 +01:00
Thomas Anderson
c0fc4828ff
Flexible image pull secret reference (#3016)
Co-authored-by: pat-s <patrick.schratz@gmail.com>
2024-01-05 08:33:56 +01:00
qwerty287
5517d87dd6
Fix step depends_on as string in schema (#3099) 2024-01-01 12:16:36 +01:00
Anbraten
6fbf98f1b9
Fix slice unmarshaling (#3097)
closes #3055
2024-01-01 11:03:31 +01:00
6543
8b47b3a978
make event in pipeline schema also a constraint_list (#3082) 2023-12-31 08:49:46 +01:00
6543
2cb7669413
add just more dag tests (#3083) 2023-12-30 16:45:11 +01:00
qwerty287
c74dc9ce92
Remove old files (#3077)
from https://github.com/woodpecker-ci/woodpecker/pull/3069

- `.changelog.yml`: no longer used
- `pipeline/samples`
2023-12-30 15:10:31 +01:00
qwerty287
a37af3eeac
Add imports checks to linter (#3056)
supersedes https://github.com/woodpecker-ci/woodpecker/pull/874

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-12-29 21:19:42 +01:00
qwerty287
7e2ea306c4
Remove workflow version again (#3052) 2023-12-28 14:34:13 +01:00
Kamila Borowska
4bc2fed550
Fix DAG cycle detection (#3049)
Previously a graph like this.

    a <- b
    ^    ^
    |    |
    c <- d

Was incorrectly recognized as having a cycle.

Fixes #3048.
2023-12-28 00:14:28 +01:00
6543
840fca198e
make backend step dag generation deterministic (#3037)
the the generation for backend steps if a dag is used deterministic.

this also fix where the test randomly fail like in:
- https://ci.woodpecker-ci.org/repos/3780/pipeline/11057/30
- https://ci.woodpecker-ci.org/repos/3780/pipeline/11076/25
2023-12-27 12:38:33 +02:00
qwerty287
e575ffe72d
Add some tests (#3030) 2023-12-27 10:36:49 +01:00
Anbraten
f01ac3f0a3
Add pull request closed event (#2684)
- [x] updates docs
- [x] adjust UI
  - [x] show correct icon
  - [x] show correct link (to pr)
  - [x] add as option in secret edit
- [x] parse webhook
- [x] update tests
  - [x] github merged
  - [x] github closed
  - [x] gitea merged
  - [x] gitea closed
  - [x] bitbucket merged
  - [x] bitbucket closed
  - [x] gitlab merged
  - [x] gitlab closed

closes #286
2023-12-26 19:22:52 +01:00
Anbraten
2b1e5f35de
Add depends_on support for steps (#2771)
Co-authored-by: 6543 <6543@obermui.de>
2023-12-24 12:14:30 +01:00
qwerty287
9d9bcbf363
Hide PR tab if PRs are disabled (#3004)
Closes https://github.com/woodpecker-ci/woodpecker/issues/2988
2023-12-24 11:04:18 +02:00
Thomas Anderson
253d702bc7
Fix IPv6 host aliases for kubernetes (#2992)
Closes #2991


[Tests](https://github.com/woodpecker-ci/woodpecker/pull/2993#issuecomment-1868048169)

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-12-23 00:42:30 +01:00
6543
cd9d425a0d
Fix cli lint throwing error on warnings (#2995)
split out from  #2771

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-12-23 00:34:17 +02:00
qwerty287
ce4f952b50
Switch to ULID (#2986)
Closes https://github.com/woodpecker-ci/woodpecker/discussions/2156
2023-12-21 20:23:51 +01:00
Thomas Anderson
01a955ed0e
Kubernetes refactor (#2794)
Kubernetes backend refactoring and tests

---------
Co-authored-by: 6543 <6543@obermui.de>
2023-12-19 04:53:52 +01:00
Nikolai Rodionov
f7f78b2a3f
feat(k8s): Add a port name to service definition (#2933)
It should cover this issue:  https://github.com/woodpecker-ci/woodpecker/issues/2931

To sum up, when several ports need to be specified, they must be named
2023-12-19 02:38:18 +01:00
6543
936c9bdb0d
Export changed files via builtin environment variables (#2935)
add **`CI_PIPELINE_FILES`** to builtin env vars

close  #853

---
*Sponsored by Kithara Software GmbH*
2023-12-18 22:37:38 +01:00
renovate[bot]
b66f6cb118
fix(deps): update golang (packages) (#2958)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[github.com/caddyserver/certmagic](https://togithub.com/caddyserver/certmagic)
| require | minor | `v0.19.2` -> `v0.20.0` |
| [github.com/expr-lang/expr](https://togithub.com/expr-lang/expr) |
require | patch | `v1.15.6` -> `v1.15.7` |
| [github.com/google/uuid](https://togithub.com/google/uuid) | require |
minor | `v1.4.0` -> `v1.5.0` |
|
[github.com/jellydator/ttlcache/v3](https://togithub.com/jellydator/ttlcache)
| require | patch | `v3.1.0` -> `v3.1.1` |
| [github.com/mattn/go-sqlite3](https://togithub.com/mattn/go-sqlite3) |
require | patch | `v1.14.18` -> `v1.14.19` |
| [github.com/xanzy/go-gitlab](https://togithub.com/xanzy/go-gitlab) |
require | minor | `v0.94.0` -> `v0.95.2` |
| [google.golang.org/grpc](https://togithub.com/grpc/grpc-go) | require
| minor | `v1.59.0` -> `v1.60.0` |
| [k8s.io/api](https://togithub.com/kubernetes/api) | require | minor |
`v0.28.4` -> `v0.29.0` |
| [k8s.io/apimachinery](https://togithub.com/kubernetes/apimachinery) |
require | minor | `v0.28.4` -> `v0.29.0` |
| [k8s.io/client-go](https://togithub.com/kubernetes/client-go) |
require | minor | `v0.28.4` -> `v0.29.0` |

---

### Release Notes

<details>
<summary>caddyserver/certmagic
(github.com/caddyserver/certmagic)</summary>

###
[`v0.20.0`](https://togithub.com/caddyserver/certmagic/releases/tag/v0.20.0)

[Compare
Source](https://togithub.com/caddyserver/certmagic/compare/v0.19.2...v0.20.0)

This release vastly improves storage cleaning as well improving a few
smaller things. There is a minor breaking change as we get ever closer
to v1.0.

- ⚠️ The `DecisionFunc` for On-Demand TLS now takes a
`context.Context` value as its first argument. The context carries the
`ClientHelloInfo` value (keyed by `ClientHelloInfoCtxKey`) for logging
purposes.
- Storage cleaning is now synchronized across the cluster, including
process restarts. The state of cleaning expired certificates and OCSP
staples is written to storage, and distributed locking is used to ensure
that only 1 instance does it at a time. This greatly reduces costs for
expensive storage backends! Cleaning is also done less often when the
process is frequently restarted because the state is written to storage,
so it is not forgotten after shutting down.
-   `.home.arpa` is now considered an internal suffix.
-   Backoff timings have been tuned based on real-world experience.

#### What's Changed

- README: Add hint about NextProtos for certmagic.TLS by
[@&#8203;oliverpool](https://togithub.com/oliverpool) in
[https://github.com/caddyserver/certmagic/pull/251](https://togithub.com/caddyserver/certmagic/pull/251)
- Bump golang.org/x/net from 0.11.0 to 0.17.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/caddyserver/certmagic/pull/253](https://togithub.com/caddyserver/certmagic/pull/253)
- Optionally pass the context argument down to the OnDemand decision
func by [@&#8203;ankon](https://togithub.com/ankon) in
[https://github.com/caddyserver/certmagic/pull/255](https://togithub.com/caddyserver/certmagic/pull/255)
- Retain the error stack if `checkIfCertShouldBeObtained` returns an
error by [@&#8203;ankon](https://togithub.com/ankon) in
[https://github.com/caddyserver/certmagic/pull/256](https://togithub.com/caddyserver/certmagic/pull/256)
- Add OCSP stapling unit tests by
[@&#8203;kenjenkins](https://togithub.com/kenjenkins) in
[https://github.com/caddyserver/certmagic/pull/259](https://togithub.com/caddyserver/certmagic/pull/259)

#### New Contributors

- [@&#8203;oliverpool](https://togithub.com/oliverpool) made their first
contribution in
[https://github.com/caddyserver/certmagic/pull/251](https://togithub.com/caddyserver/certmagic/pull/251)

**Full Changelog**:
https://github.com/caddyserver/certmagic/compare/v0.19.2...v0.20.0

</details>

<details>
<summary>expr-lang/expr (github.com/expr-lang/expr)</summary>

###
[`v1.15.7`](https://togithub.com/expr-lang/expr/releases/tag/v1.15.7)

[Compare
Source](https://togithub.com/expr-lang/expr/compare/v1.15.6...v1.15.7)

**Expr** is a Go-centric expression language designed to deliver dynamic
configurations with unparalleled accuracy, safety, and speed.

##### In this release:

- Fixed commutative property for comparison between a value and a
pointer. ([#&#8203;490](https://togithub.com/expr-lang/expr/issues/490))
- Checker: forbid accessing built-ins and custom functions from `$env`.
([#&#8203;495](https://togithub.com/expr-lang/expr/issues/495))
- Enhanced the number parser to include support for parsing hexadecimal,
binary, and octal literals.
([#&#8203;483](https://togithub.com/expr-lang/expr/issues/483))
- Added `GetSource()` method to `vm.Program`.
([#&#8203;491](https://togithub.com/expr-lang/expr/issues/491))

</details>

<details>
<summary>google/uuid (github.com/google/uuid)</summary>

### [`v1.5.0`](https://togithub.com/google/uuid/releases/tag/v1.5.0)

[Compare
Source](https://togithub.com/google/uuid/compare/v1.4.0...v1.5.0)

##### Features

- Validate UUID without creating new UUID
([#&#8203;141](https://togithub.com/google/uuid/issues/141))
([9ee7366](9ee7366e66))

</details>

<details>
<summary>jellydator/ttlcache
(github.com/jellydator/ttlcache/v3)</summary>

###
[`v3.1.1`](https://togithub.com/jellydator/ttlcache/releases/tag/v3.1.1)

[Compare
Source](https://togithub.com/jellydator/ttlcache/compare/v3.1.0...v3.1.1)

Fix a bug in the `Range` method that causes a panic when the cache is
empty

</details>

<details>
<summary>mattn/go-sqlite3 (github.com/mattn/go-sqlite3)</summary>

###
[`v1.14.19`](https://togithub.com/mattn/go-sqlite3/compare/v1.14.18...v1.14.19)

[Compare
Source](https://togithub.com/mattn/go-sqlite3/compare/v1.14.18...v1.14.19)

</details>

<details>
<summary>xanzy/go-gitlab (github.com/xanzy/go-gitlab)</summary>

###
[`v0.95.2`](https://togithub.com/xanzy/go-gitlab/compare/v0.95.1...v0.95.2)

[Compare
Source](https://togithub.com/xanzy/go-gitlab/compare/v0.95.1...v0.95.2)

###
[`v0.95.1`](https://togithub.com/xanzy/go-gitlab/compare/v0.95.0...v0.95.1)

[Compare
Source](https://togithub.com/xanzy/go-gitlab/compare/v0.95.0...v0.95.1)

###
[`v0.95.0`](https://togithub.com/xanzy/go-gitlab/compare/v0.94.0...v0.95.0)

[Compare
Source](https://togithub.com/xanzy/go-gitlab/compare/v0.94.0...v0.95.0)

</details>

<details>
<summary>grpc/grpc-go (google.golang.org/grpc)</summary>

### [`v1.60.0`](https://togithub.com/grpc/grpc-go/releases/tag/v1.60.0):
Release 1.60.0

[Compare
Source](https://togithub.com/grpc/grpc-go/compare/v1.59.0...v1.60.0)

### Security

- credentials/tls: if not set, set TLS MinVersion to 1.2 and
CipherSuites according to supported suites not forbidden by RFC7540.
- This is a behavior change to bring us into better alignment with RFC
7540.

### API Changes

- resolver: remove deprecated and experimental
`ClientConn.NewServiceConfig`
([#&#8203;6784](https://togithub.com/grpc/grpc-go/issues/6784))
- client: remove deprecated `grpc.WithServiceConfig` `DialOption`
([#&#8203;6800](https://togithub.com/grpc/grpc-go/issues/6800))

### Bug Fixes

- client: fix race that could cause a deadlock while entering idle mode
and receiving a name resolver update
([#&#8203;6804](https://togithub.com/grpc/grpc-go/issues/6804))
- client: always enable TCP keepalives with OS defaults
([#&#8203;6834](https://togithub.com/grpc/grpc-go/issues/6834))
- credentials/alts: fix a bug preventing ALTS from connecting to the
metadata server if the default scheme is overridden
([#&#8203;6686](https://togithub.com/grpc/grpc-go/issues/6686))
- Special Thanks: [@&#8203;mjamaloney](https://togithub.com/mjamaloney)

### Behavior Changes

- server: Do not return from Stop() or GracefulStop() until all
resources are released
([#&#8203;6489](https://togithub.com/grpc/grpc-go/issues/6489))
    -   Special Thanks: [@&#8203;fho](https://togithub.com/fho)

### Documentation

- codes: clarify that only codes defined by this package are valid and
that users should not cast other values to `codes.Code`
([#&#8203;6701](https://togithub.com/grpc/grpc-go/issues/6701))

</details>

<details>
<summary>kubernetes/api (k8s.io/api)</summary>

###
[`v0.29.0`](https://togithub.com/kubernetes/api/compare/v0.28.4...v0.29.0)

[Compare
Source](https://togithub.com/kubernetes/api/compare/v0.28.4...v0.29.0)

</details>

<details>
<summary>kubernetes/apimachinery (k8s.io/apimachinery)</summary>

###
[`v0.29.0`](https://togithub.com/kubernetes/apimachinery/compare/v0.28.4...v0.29.0)

[Compare
Source](https://togithub.com/kubernetes/apimachinery/compare/v0.28.4...v0.29.0)

</details>

<details>
<summary>kubernetes/client-go (k8s.io/client-go)</summary>

###
[`v0.29.0`](https://togithub.com/kubernetes/client-go/compare/v0.28.4...v0.29.0)

[Compare
Source](https://togithub.com/kubernetes/client-go/compare/v0.28.4...v0.29.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am" (UTC), Automerge -
"before 4am" (UTC).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/woodpecker-ci/woodpecker).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy45My4xIiwidXBkYXRlZEluVmVyIjoiMzcuOTMuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2023-12-17 14:37:26 +01:00
6543
1f8b3b5e1b
Only update pipelineStatus in one place (#2952) 2023-12-15 10:03:05 +01:00
qwerty287
ff1f51d6a9
Rename engine to backend (#2950)
rename based on https://woodpecker-ci.org/docs/usage/terminiology

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-12-14 19:20:47 +01:00
gapanyc
547f5dea35
Init CI_COMMIT_TAG if commit ref is a tag (#2934)
When triggering a deployment event on an existing pipeline, there is no
way to get the tag used to trigger the parent pipeline, even if this
parent was a tag event.

In our company CI/CD current setup with drone, we use the tag event to
trigger a kaniko image build step, using the git tag as an image tag,
and the deployment/promotion step to effectively deploy this image using
the tag reference in our cluster. This is the only point blocking us to
completely switch to woodpecker and get rid of drone...

What's done:
- changed the metadata environ() method to populate CI_COMMIT_TAG env
var if commit ref starts with /refs/tags (like it's done in drone),
independently of event type EventTag.

Please let me know if I'm wrong, I will happily contribute in this nice
project.

---------

Co-authored-by: Christian Gapany <christian.gapany@netplus.pro>
Co-authored-by: Lauris BH <lauris@nix.lv>
2023-12-12 18:05:06 +02:00
Nikolai Rodionov
b3541e314e
fix: Add backend_options to service linter entry (#2930)
I've tried setting resources for a service and have seen the linter
warning that is not supported, though the the pipeline was successful
and resources were actually set on the pod. So I assume it shouldn't be
a linter issue.

I"m also not sure if my change is correct, I only hope it is

## Some Context

A pipeline example (I've removed steps that are not related directly:
```yaml
---
steps:
  test:
    name: Test charts
    image: quay.io/helmpack/chart-testing
    environment:
      - DOCKER_HOST=tcp://docker:2375
    commands:
      - export PATH=$PWD/.bin:$PATH
      - apk update && apk add docker
      - kind create cluster --config kind.yaml
      - sed -i -E -e 's/localhost|0\.0\.0\.0/docker/g' ~/.kube/config
      - git fetch origin
      - |
        if [ -e .changed ]; then
          ct install --target-branch main --chart-dirs .
          ct install --target-branch main --chart-dirs . --upgrade
        fi

services:
  docker:
    image: docker:dind
    commands: dockerd -H tcp://0.0.0.0:2375 --tls=false
    privileged: true
    ports:
      - 2375
    backend_options:
      kubernetes:
        resources:
          requests:
            memory: 400Mi
            cpu: 100m
          limits:
            memory: 400Mi
            cpu: 100m
```

Pod description:
```
Containers:
  wp-01hhczdknafj81jv80gzjbgt93-0-services-0:
    Limits:
      cpu:     100m
      memory:  400Mi
    Requests:
      cpu:     100m
      memory:  400Mi
```

Warning in the Woodpecker UI:

```
[linter]woodpecker: services.dockerAdditional property backend_options is not allowed
```
2023-12-11 19:22:55 +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
Lauris BH
511cfec66a
Fix schema validation with array syntax for clone and services (#2920)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
Co-authored-by: Anbraten <anton@ju60.de>
2023-12-07 16:56:13 +01:00
renovate[bot]
428fe659fe
Update golang (packages) (#2904)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| code.gitea.io/sdk/gitea | require | minor | `v0.16.0` -> `v0.17.0` |
| [github.com/antonmedv/expr](https://togithub.com/antonmedv/expr) |
require | patch | `v1.15.5` -> `v1.15.6` |
| [github.com/golang-jwt/jwt/v5](https://togithub.com/golang-jwt/jwt) |
require | minor | `v5.1.0` -> `v5.2.0` |
| [github.com/urfave/cli/v2](https://togithub.com/urfave/cli) | require
| minor | `v2.25.7` -> `v2.26.0` |

---

### Release Notes

<details>
<summary>antonmedv/expr (github.com/antonmedv/expr)</summary>

###
[`v1.15.6`](https://togithub.com/expr-lang/expr/releases/tag/v1.15.6)

[Compare
Source](https://togithub.com/antonmedv/expr/compare/v1.15.5...v1.15.6)

-   This is a new release for `expr-lang/epxr`.

</details>

<details>
<summary>golang-jwt/jwt (github.com/golang-jwt/jwt/v5)</summary>

### [`v5.2.0`](https://togithub.com/golang-jwt/jwt/releases/tag/v5.2.0)

[Compare
Source](https://togithub.com/golang-jwt/jwt/compare/v5.1.0...v5.2.0)

#### What's Changed

- Exported `NewValidator` by
[@&#8203;oxisto](https://togithub.com/oxisto) in
[https://github.com/golang-jwt/jwt/pull/349](https://togithub.com/golang-jwt/jwt/pull/349)
- Improve ErrInvalidKeyType error messages by
[@&#8203;Laurin-Notemann](https://togithub.com/Laurin-Notemann) in
[https://github.com/golang-jwt/jwt/pull/361](https://togithub.com/golang-jwt/jwt/pull/361)
- Update MIGRATION_GUIDE.md by
[@&#8203;jbarham](https://togithub.com/jbarham) in
[https://github.com/golang-jwt/jwt/pull/363](https://togithub.com/golang-jwt/jwt/pull/363)

#### New Contributors

- [@&#8203;Laurin-Notemann](https://togithub.com/Laurin-Notemann) made
their first contribution in
[https://github.com/golang-jwt/jwt/pull/361](https://togithub.com/golang-jwt/jwt/pull/361)
- [@&#8203;jbarham](https://togithub.com/jbarham) made their first
contribution in
[https://github.com/golang-jwt/jwt/pull/363](https://togithub.com/golang-jwt/jwt/pull/363)

**Full Changelog**:
https://github.com/golang-jwt/jwt/compare/v5.1.0...v5.2.0

</details>

<details>
<summary>urfave/cli (github.com/urfave/cli/v2)</summary>

### [`v2.26.0`](https://togithub.com/urfave/cli/releases/tag/v2.26.0)

[Compare
Source](https://togithub.com/urfave/cli/compare/v2.25.7...v2.26.0)

#### What's Changed

- Bash completion nits by
[@&#8203;meatballhat](https://togithub.com/meatballhat) in
[https://github.com/urfave/cli/pull/1762](https://togithub.com/urfave/cli/pull/1762)
- Chore: Rename mkdocs requirements file name by
[@&#8203;dearchap](https://togithub.com/dearchap) in
[https://github.com/urfave/cli/pull/1776](https://togithub.com/urfave/cli/pull/1776)
- Fix:(issue\_1787) Add fix for commands not listed when hide help
comma… by [@&#8203;dearchap](https://togithub.com/dearchap) in
[https://github.com/urfave/cli/pull/1788](https://togithub.com/urfave/cli/pull/1788)
- Fix nil HelpFlag panic (v2) by
[@&#8203;wxiaoguang](https://togithub.com/wxiaoguang) in
[https://github.com/urfave/cli/pull/1795](https://togithub.com/urfave/cli/pull/1795)
- Always get 0 for a nested int64 value in v2.25.7 by
[@&#8203;stephenfire](https://togithub.com/stephenfire) in
[https://github.com/urfave/cli/pull/1799](https://togithub.com/urfave/cli/pull/1799)
- Helper messages for documenting build process by
[@&#8203;abitrolly](https://togithub.com/abitrolly) in
[https://github.com/urfave/cli/pull/1800](https://togithub.com/urfave/cli/pull/1800)
- fix: check duplicated sub command name and alias by
[@&#8203;linrl3](https://togithub.com/linrl3) in
[https://github.com/urfave/cli/pull/1805](https://togithub.com/urfave/cli/pull/1805)
- Fix:(issue\_1689) Have consistent behavior for default text in man
and… by [@&#8203;dearchap](https://togithub.com/dearchap) in
[https://github.com/urfave/cli/pull/1825](https://togithub.com/urfave/cli/pull/1825)
- Fix linting issues by
[@&#8203;skelouse](https://togithub.com/skelouse) in
[https://github.com/urfave/cli/pull/1696](https://togithub.com/urfave/cli/pull/1696)

#### New Contributors

- [@&#8203;stephenfire](https://togithub.com/stephenfire) made their
first contribution in
[https://github.com/urfave/cli/pull/1799](https://togithub.com/urfave/cli/pull/1799)
- [@&#8203;linrl3](https://togithub.com/linrl3) made their first
contribution in
[https://github.com/urfave/cli/pull/1805](https://togithub.com/urfave/cli/pull/1805)

**Full Changelog**:
https://github.com/urfave/cli/compare/v2.25.7...v2.26.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am" (UTC), Automerge -
"before 4am" (UTC).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/woodpecker-ci/woodpecker).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44MS4zIiwidXBkYXRlZEluVmVyIjoiMzcuODEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <ndev@web.de>
2023-12-04 20:53:46 +01:00
Kaylyn Bogle
bc95443853
Fix podman agent container in v2 (#2897)
Add additional string matching to determine when container is not found
or running when invoked via podman compatibility socket

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-12-02 20:22:23 +01:00
Thomas Anderson
3adb98b287
Simple security context options (Kubernetes) (#2550) 2023-11-26 08:46:06 +01:00
qwerty287
342b25826c
Rename link to url (#2812)
As of https://woodpecker-ci.org/docs/next/usage/terminiology#conventions
2023-11-14 17:12:12 +01:00
qwerty287
6a7e91bb0e
Fix env vars and add UI url (#2811)
Closes https://github.com/woodpecker-ci/woodpecker/issues/2219

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-11-13 09:38:02 +01:00
qwerty287
70711ed9db
Replace interface{} with any (#2807)
like golang:
2580d0e08d
2023-11-12 18:23:48 +01:00
Patrick Schratz
f3df6f8873
Add privileged schema definition (#2777)
Co-authored-by: 6543 <m.huber@kithara.com>
2023-11-09 19:31:08 +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
qwerty287
1bc4415075
Add workflow version (#2476)
Closes #1834

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
2023-11-06 01:37:02 +01:00
Anbraten
9e10100ad6
Fail on missing secrets (#2749)
Co-authored-by: pat-s <patrick.schratz@gmail.com>
2023-11-05 12:47:42 +01:00
Anbraten
a0f2ee9506
Add deprecation warnings (#2725) 2023-11-04 15:30:47 +01:00
J-Ha
9af71dcc98
Use unique label selector for pod label for kubernetes services (#2723)
Co-authored-by: Julian Haseleu <julian.haseleu@dreamit.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-11-04 10:35:37 +01:00
qwerty287
4cb48aab1d
Fix axisID for non-matrix (#2717)
Just one more from #2695
2023-11-03 14:04:37 +01:00
Anbraten
5ff006614f
Enhance linter and errors (#1572)
Co-authored-by: 6543 <m.huber@kithara.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-11-03 11:44:03 +01:00
6543
7bc40f20cb
Option to change temp dir for local backend (#2702)
---
*Sponsored by Kithara Software GmbH*
2023-11-02 15:45:18 +01:00
qwerty287
c1faa95d8f
Revert breaking pipeline changes (#2677)
Revert #2180 and #2480 so we can release v2.0 without breaking changes
in pipeline config.

After merging #2476 we should apply these changes to a new v2.

After merging this, we should be ready for the 2.0 release.

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-11-02 15:31:49 +01:00
6543
c75068920c
save GOOS and GOARCH in local engine (#2701)
make refactoring easyer
2023-11-02 07:58:32 +01:00
Thomas Anderson
de53b906e8
Add ports into pipeline backend step model (#2656)
Closes #2655.


[Pipeline](https://woodpecker-ci.org/docs/next/usage/services#complete-pipeline-example):
```yaml
services:
  database:
    image: mysql
    environment:
      - MYSQL_DATABASE=test
      - MYSQL_ROOT_PASSWORD=example
    ports:
      - 3306

steps:
  get-version:
    image: ubuntu
    commands:
      - ( apt update && apt dist-upgrade -y && apt install -y mysql-client 2>&1 )> /dev/null
      - sleep 60s # need to wait for mysql-server init
      - echo 'SHOW VARIABLES LIKE "version"' | mysql -uroot -hdatabase test -pexample
```

Service:
```yaml
apiVersion: v1
kind: Service
metadata:
  name: wp-01hdq6gbkw1mn6k1655fs3rntf-0-services-0
  namespace: woodpecker-runtime
  ...
  selfLink: >-
    /api/v1/namespaces/woodpecker-runtime/services/wp-01hdq6gbkw1mn6k1655fs3rntf-0-services-0
status:
  loadBalancer: {}
spec:
  ports:
    - protocol: TCP
      port: 3306
      targetPort: 3306
  selector:
    step: database
  clusterIP: 10.43.180.120
  clusterIPs:
    - 10.43.180.120
  type: ClusterIP
  sessionAffinity: None
  ipFamilies:
    - IPv4
  ipFamilyPolicy: SingleStack
  internalTrafficPolicy: Cluster
```
2023-11-02 04:12:41 +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
abb2f280eb
Unique status for matrix (#2695)
implement this fix but with an additional field on workflows to not
change the workflow name

closes #1840 
closes #713

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-11-01 17:28:02 +01:00
6543
ebe0307c6b
Let the backend engine report the current platform (#2688)
if you run woodpecker-agent on windows and connect it to an docker
daemon, there could be two different platforms possible, as you can
switch from linux to windows mode and visa versa


---
*Sponsored by Kithara Software GmbH*
2023-11-01 15:38:37 +01:00
6543
48e4eceb0a
local backend make cmd log output similar to other shells (#2678)
the cmd currently shows the full prompt and drop the exact error level.

this set the prompt to be hidden and let cmd exit with error level
reported by the command

---
*Sponsored by Kithara Software GmbH*
2023-11-01 11:49:36 +01:00
6543
e83357833d
Use path.Join for server side path generation (#2689)
make sure to have valid config even when server is running under windows

---
*Sponsored by Kithara Software GmbH*
2023-11-01 11:29:44 +01:00
Anbraten
4198c447fb
Destroy steps after they are done (#2681)
Co-authored-by: 6543 <m.huber@kithara.com>
2023-11-01 09:35:11 +01:00
6543
5742e8695c
Do not sanitzie secrets with 3 or less chars (#2680)
as this secrets have to low entropy they can not be valid secrets and
e.g. make log only unredable

just add a secret with value `a` to a repo an run a pipeline ...

---
*Sponsored by Kithara Software GmbH*
2023-10-31 19:44:03 +01:00
Patrick Schratz
856b2ef8c7
pre-commit fixes (#2669)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Anbraten <anton@ju60.de>
2023-10-31 09:14:09 +01:00
6543
5b3bba726d
local backend ignore errors in commands inbetween (#2636)
for normal posix shells we have to add the `-e ` option ... but as there
are more shells out there we have to handle this edgecases on base per
base case.

create a switch case statement in woodpecker should be fine as there is
only a finite number of shells, used in production.

also close  #2612

---
*Sponsored by Kithara Software GmbH*
2023-10-28 13:38:47 +02:00
qwerty287
e74115027b
Add some tests (#2652)
and some cleanups
2023-10-28 13:37:54 +02:00
Anbraten
f44aa8a6fd
Remove plugin-only option from secrets (#2213) 2023-10-24 20:38:47 +02:00
Anbraten
66a5ba4e4f
Add prettier (#2600) 2023-10-24 14:42:05 +02:00
qwerty287
31240b5771
Remove SSH backend (#2635)
The SSH backend is, similar to Gogs and Coding for forges, completely
unmaintained and seems unused (it is likely broken but we didn't get any
reports).
Instead, you should directly run the agent on the SSH machine with the
`local` backend.
2023-10-24 01:55:30 +02:00
qwerty287
efbde332a3
Fix CI_WORKSPACE in local backend (#2627)
closes https://github.com/woodpecker-ci/woodpecker/issues/2610
2023-10-23 12:54:10 +02:00
Patrick Schratz
1b98e58014
Update to docker 23 (#2577)
fix #1807
2023-10-14 12:39:45 +02:00
Anbraten
62d6a6bc34
Move skip-ci back in front of config fetching (#2555) 2023-10-09 18:15:53 +02:00
qwerty287
46273e54d8
Require Go 1.21 (#2553)
Main change are the new `maps` and `slices` stdlib packages so we can
replace `golang.org/x/exp`.
2023-10-09 09:11:08 +02:00
qwerty287
22dfd2ef62
Refactor pipeline parsing and forge refreshing (#2527)
- refactor pipeline parsing
- do not parse the pipeline multiple times to perform filter checks, do
this once and perform checks on the result directly
    - code deduplication
- refactor forge token refreshing
    - move refreshing to a helper func to reduce code

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-10-08 14:05:06 +02:00
renovate[bot]
e8ef1fb3c1
fix(deps): update module github.com/docker/distribution to v2.8.3+incompatible (#2517) 2023-10-03 09:35:40 +02:00
6543
8629a418f8
local backend set home variable windows-equivalent too (#2323) 2023-10-01 14:56:49 +02:00
qwerty287
842e8a8e50
Remove deprecated options parsing (#2480)
Main change is that backwards compatibility to `platform` was removed.
Part of
https://github.com/woodpecker-ci/woodpecker/discussions/2170#discussioncomment-7047394
2023-09-20 13:48:34 +02:00
qwerty287
aab7e73322
Execute make generate with new versions (#2365)
Fixes current swagger checks:
https://ci.woodpecker-ci.org/repos/3780/pipeline/7605/26
2023-09-01 16:44:55 +02:00
Anbraten
25225d4902
Update grpc generated code (#2339)
missed in #2173

---------
2023-08-28 18:00:52 +02:00
Kleber Rocha
61b5672051
Add option to configure tolerations in kubernetes backend (#2249)
This code add a feature to support tolerations in Kubernetes Backend

---------

Signed-off-by: Kleber Rocha <klinux@gmail.com>
2023-08-22 22:34:59 +02:00
6543
3954d85a5b
Add "plugin" support to local backend (#2239)
and a nit to improve the clone


---
*Sponsored by Kithara Software GmbH*
2023-08-22 22:00:32 +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
6543
0c282e86e8
fix regression and add trace in clone for local backend (#2241)
regression of #2017 
close  #2211
2023-08-18 14:26:04 +02:00
6543
55e98a186a
Skip settings proxy config with WithProxy if its empty (#2242)
close #2208
2023-08-18 13:09:28 +02:00
6543
a5ef372190
Move "skip ci" logic into global pipeline conditions (#2216)
... and make custom errors follow std err conventions

this fix a 500 response if the whole pipeline is filtered out
2023-08-17 15:52:43 +02:00
6543
0563d7a30f
Bump default git clone plugin (#2215)
- and add alternate quay registry to trusted clone image
- add alternate registry for buildx plugin
2023-08-16 15:17:43 +02:00
qwerty287
4d83ea0de8
Add SSH clone URL env var (#2198)
to improve https://github.com/woodpecker-ci/plugin-git/pull/75
2023-08-12 17:39:13 +02:00
qwerty287
8cdac56d8f
Check for correct license header (#2137) 2023-08-10 11:06:00 +02:00
6543
eb8fb407f9
Add TestCompilerCompile (#2183)
just add tests about compile frontend config into backend config
2023-08-10 09:52:52 +02:00
6543
23ad363c97
fix error message 2023-08-10 00:01:16 +02:00
6543
63d5c40afd
Deprecate "platform" filter in favour of "labels" (#2181)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-08-09 16:09:44 +02:00
6543
71666f0500
Fail hard on deprecated pipeline keys (#2180)
so we can drop it in next minor version complete
2023-08-09 15:33:10 +02:00
Anbraten
f02eaa115e
Pass netrc to trusted clone images (#2163)
closes #1975
2023-08-08 12:49:29 +02:00
6543
d253f8cc30
Make sure we dont have hidden options for backend and pipeline compiler (#2123)
move options based on **os.Getenv** into flags

---------
*Sponsored by Kithara Software GmbH*
2023-08-07 21:13:26 +02:00
6543
10b1cfcd3b
Enhance local backend (#2017)
make local backend able to clone from private

---------
*Sponsored by Kithara Software GmbH*
Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2023-08-07 15:39:58 +02:00
Anbraten
e0ed1b3e49
Change master to main (#2044) 2023-07-31 05:47:23 +02:00
6543
da9bfa64ce
Fix docs nit and add rm todo for v1.2.0 (#2049) 2023-07-28 15:33:23 +02:00
6543
a83b0fcfd3
Drop deprecated built-in environment variables (#2048)
Drop:
 - `CI_BUILD_*`
 - `CI_PREV_BUILD_*`
 - `CI_JOB_*`
 - `*_LINK`
 - `CI_SYSTEM_ARCH`
 - `CI_REPO_REMOTE`
2023-07-28 14:58:20 +02:00
6543
3cd78c9409
Refactor agent (#2021)
- code cleanup
- init backend engine only once
- pass a taskUUID to the backend

---
*Sponsored by Kithara Software GmbH*
2023-07-20 20:39:20 +02:00
6543
b54f6ebad6
Let pipeline-compiler export step types (#1958) 2023-07-11 15:53:05 +02:00
6543
7b97e27fea
docker: use uuid instead of name as identifyer (#1967)
close #1959
2023-07-10 17:59:25 +02:00
Anbraten
f2c33a0d89
Fix netrc passing to clone image (#1964)
closes #1837
2023-07-09 23:41:13 +02:00
6543
5393aa5d3b
Move docker specific volume & network settings into backend code (#1956)
... if we want to make them be changed ... it should be an
agent-backend-option
2023-07-09 21:03:19 +02:00
Thomas Anderson
1875e2a416
Fix platform to node-selector mapping for k8s (#1963)
Closes #1955
2023-07-09 20:22:50 +03:00
6543
de13aeea33
Remove unused step options (#1957)
remove them as they did never had any functionality
2023-07-09 12:32:19 +02:00
6543
b3f65d9d01
pipeline-StepBuilder extract item generation of workflow into own function (#1950) 2023-07-08 22:17:09 +02:00
Thomas Anderson
cef135eba5
Do not set Pod's Image pull policy if not explicitly set (#1914) 2023-07-07 20:02:13 +02:00
Thomas Anderson
d46b91a94c
Refactored K8s Pod node selector (#1909)
- using existing map instead of an array
- applying var name convention
- using arch constant
2023-07-07 07:46:48 +02:00
Thomas Anderson
b616a822a0
Fixed when:evaluate on non-standard (non-CI*) env vars (#1907)
Makes it possible to evaluate `when` constraint on custom environment
variables.
2023-07-02 23:45:22 +02:00
Thomas Anderson
2ba64dcb7d
Removed env vars filtering (#1913)
Closes #1911
2023-07-02 19:14:59 +02:00
qwerty287
cd982fcbd1
Fix pipeline status calculation/reporting (#1898)
Closes #1895 
Regression of #1784
2023-06-29 14:56:01 +02:00
qwerty287
3033abc3b4
Add own workflow model (#1784)
Closes #1287

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-06-27 18:01:18 +02:00
qwerty287
eaae6b44c7
Remove default event filter (#1880)
Closes https://github.com/woodpecker-ci/woodpecker/issues/1863
2023-06-21 18:12:20 +02:00
Ovidiu Calbajos
609ba481b5
Support for k8s serviceAccount and nodeSelector (#1842)
Add the possiblity to specify the Kubernetes serviceAccount and/or
nodeSelector to be used on individual steps for Kubernetes executor
2023-06-12 16:00:59 +02:00
6543
7bae68758f
[Docs] Fix schema to replace "tag" by "ref"-filter (#1841)
#1820 followup
2023-06-09 12:43:12 +02:00
Ben Cordero
3158980d3e
Get workflow id from clone steps (#1839)
When in local mode, `getWorkflowIDFromStep` can handle normal steps with
a name like `wp_01h2a6qggwz68zekrkbwqq9rny_0_step_0`.

However, it will fail on clone (unless `skip_clone: true`) with an
`invalid step name` error.

```
invalid step name wp_01h2a2ebppp43bwjdfdsyj1m6m_0_clone
```

This patch handles either `_stage_` or `_clone` as the separator that
the local backend can use to extract the workflowID.
2023-06-08 03:33:23 +02:00
qwerty287
5d74174bc3
Drop old columns (#1838) 2023-06-07 19:22:44 +02:00
6543
7e708874ae
Rename yaml pipeline to steps (#1833)
Adjust pipeline-config to match
[Terminology](https://woodpecker-ci.org/docs/next/usage/terminology)
2023-06-07 12:04:37 +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
6543
971cb52032
Rename pipeline frontend types (#1829)
this adjust the packages that parse the yaml-config-file to match
[Terminology](https://woodpecker-ci.org/docs/next/usage/terminology)
2023-06-06 09:14:21 +02:00
6543
f81b447638
remove undocumented docker specific option (#1825) 2023-06-05 17:30:32 +02:00
6543
ea895baf83
Resolve built-in variables for global when filter (#1790)
addresses
bd461477bd

close  #1244, close #1580

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-06-05 00:15:07 +02:00
Stephen Muth
2941e508b3
Allow setting resources for kubernetes on a per-step basis (#1767)
This add a simple implementation of requests/limits for individual
steps. There is no validation of what the resource actually is beyond
checking that it can successfully be converted to a Quantity, so it can
be used for things other than just memory/CPU.

close #1809
2023-06-04 00:50:08 +02:00
Patrick Schratz
3d0338315f
Revert to docker 20.10.x for API 1.41 compatibility (#1792)
fix #1786

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-06-02 15:09:38 +02:00
6543
524611cf00
Add Forge Metadata (#1789)
close  #1787
2023-05-31 18:30:41 +02:00
6543
a1943aa49e
Buildin Env Vars, use _URL for all links/urls (#1794)
based on https://framadate.org/jVSQHwIGfJYy82IL

close #1793
2023-05-31 18:03:38 +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
Patrick Schratz
d13a8744ce
Add nodeSelector using platform for kubernetes (#1737)
Co-authored-by: Anbraten <anton@ju60.de>
2023-05-18 11:21:20 +02:00
Anbraten
435f5ae207
Improve local backend (#1762)
Co-authored-by: 6543 <6543@obermui.de>
2023-05-17 14:53:23 +02:00
Anbraten
188123ea74
Update dependencies (#1744) 2023-05-11 00:28:02 +02:00
6543
204d05f447
Implement YAML Map Merge, Overrides, and Sequence Merge Support (#1720)
close  #1192
2023-04-29 14:49:41 +02:00
6543
80d5d233b3
Local Backend should create SubDirs (#1706)
close #1705
2023-04-20 00:56:03 +02:00
Anbraten
36b5ae3459
Add env for workflow and step name (#1693)
closes #1681
2023-04-08 13:15:28 +02:00
Bruno BELANYI
ea95d5aa76
Set 'HOME' during local pipeline step (#1686)
close #1685

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
2023-04-02 16:47:22 +02:00
qwerty287
0970f35df5
Do not store inactive repos (#1658)
Do not sync repos with forge if the repo is not necessary in DB.

In the DB, only repos that were active once or repos that are currently
active are stored. When trying to enable new repos, the repos list is
fetched from the forge instead and displayed directly. In addition to
this, the forge func `Perm` was removed and is now merged with `Repo`.

Solves a TODO on RepoBatch.

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-03-21 23:01:59 +01:00
Neil Hanlon
a95a5b43bf
fix(backend/kubernetes): Ensure valid naming of name field (#1661)
- Kubernetes v1.26 on VKE causes error when creating persistent volume
claim because of uppercase characters in name field

This patch is trivial just in order to get it working - happy to
implement differently.

The error in question:

```
The PersistentVolumeClaim "wp-01G1131R63FWBSPMA4ZAZTKLE-0-clone-0" is invalid: metadata.name: Invalid value: "wp-01G1131R63FWBSPMA4ZAZTKLE-0-clone-0": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
```
2023-03-21 20:00:45 +01:00
Lauris BH
46452fbd84
Update Go dependencies and minimal Go version to 1.20 (#1650)
Signed-off-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
2023-03-21 00:48:15 +01:00
6543
e28b43ab19
Only inject netrc to trusted clone plugins (#1352)
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: 6543 <6543@obermui.de>
2023-03-20 21:17:49 +01: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
qwerty287
f582ad3159
Various enhancements in configuration (#1645)
- backends: move to cli flags instead of os.Getenv
- ssh: support 2fa with key and password
- allow to set grpc jwt secret (solves todo)
- allow to set default and max timeout (solves todo)

Closes https://github.com/woodpecker-ci/woodpecker/issues/896
Closes https://github.com/woodpecker-ci/woodpecker/issues/1131
2023-03-19 20:24:43 +01:00
6543
56e6639396
Refactor nits (#1652)
-
https://github.com/woodpecker-ci/woodpecker/pull/1641/files#r1141405630
-
ade8e6d010 (r105091268)
-
https://github.com/woodpecker-ci/woodpecker/pull/1647/files#r1141410010

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-03-19 18:32:19 +01:00
qwerty287
42a115e19e
Add PR pipeline list (#1641)
Instead of viewing PR pipelines in the branches lists, add a separate
list for them. The API endpoint for PRs supports pagination (thus I
added a lot of pagination-related stuff), the UI doesn't yet though.


![wp](https://user-images.githubusercontent.com/80460567/226099133-bb4935d6-c357-4d73-8465-9157e25c0d82.png)

Closes #1619 

Extends this part of #1640

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-03-19 10:43:57 +01:00
qwerty287
7ddc18348f
Only grant privileged to plugins (#1646)
Closes https://github.com/woodpecker-ci/woodpecker/issues/1525

Co-authored-by: Anbraten <anton@ju60.de>
2023-03-19 03:07:10 +01:00
Anbraten
fa5b0fb96e
Fix linter (#1647) 2023-03-18 20:35:27 +01:00
6543
9945e27c01
pipeline compiler: handle nil entrys in settings list (#1626)
close #1609
2023-03-17 08:54:53 +01:00
Lukas
1b43b0bf20
Add pull request labels as environment variable (#1321)
Closes #1308 

Co-authored-by: Anbraten <anton@ju60.de>
2023-03-17 03:43:04 +01:00
Alexander Matyushentsev
ee969979c6
fix: backend auto-detection should be consistent (#1618)
Closes https://github.com/woodpecker-ci/woodpecker/issues/1617

The `woodpecker exec` auto-detects the backend by iterating over a map
of backends. However, since Go 1 the runtime randomizes map iteration
order, so a random backend might be chosen during each execution.

PR changes to auto-detection to iterate over the backends list with
predefined priority: `docker`, `local`, `ssh`, `kubernetes`.

---------

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2023-03-13 09:07:41 +02:00
Alexander Matyushentsev
5e1171d7a7
fix: docker backend should not close 'engine.Tail' result (#1616)
Closes https://github.com/woodpecker-ci/woodpecker/issues/1615

The error described in
https://github.com/woodpecker-ci/woodpecker/issues/1615 is happening
because `Tail` method of the docker backend closes the instance of
`io.ReadCloser` it returns in `defer` function. As a result anything
that try to read data returned by `Tail` method eventually will attempt
to read from closes reader and get an error:


2171212c5a/pipeline/backend/docker/docker.go (L229)

The fix is just don't close returned reader and let the consumer of
`Tail` method do it. Good thing is that `Tail` is used only in one place
and reader is correctly closed:


2171212c5a/pipeline/pipeline.go (L231-L237)

Example of `woodpecker exec` output using pipeline from
https://github.com/woodpecker-ci/woodpecker/issues/1615 with the fix:

```
woodpecker exec .woodpecker.yaml
[step1:L0:0s] + echo step1
[step1:L1:0s] step1
[step2:L0:0s] + echo step2
[step2:L1:0s] step2
```

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2023-03-12 16:01:09 +01:00
Stephen Muth
be4ce2e02d
Ensure the SharedInformerFactory closes eventually (#1585)
Otherwise it will continue to collect events in the background, consuming memory that can't be GC'd.
2023-02-16 00:54:33 +01:00
6543
18d3139e9e
Use modern error handling and enforce it via lint (#1327)
Co-authored-by: Anbraten <anton@ju60.de>
2023-02-02 00:08:02 +01:00
Lauris BH
f26a87acce
Deduplicate step docker container volumes (#1571)
Try to fix #1495

It's very hard to reproduce it and only way to fix when it gets in this
state is woodpecker agent restart.

This anyway fixes problem if step mounts and
`WOODPECKER_BACKEND_DOCKER_VOLUMES` conflict
2023-01-31 21:33:40 +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
6543
5c617accd8
kubernetes ignore labels and annotations if not set (#1528)
close #1527
regression of #1510
2023-01-04 19:51:21 +02:00
Stephen Muth
bc87208a33
Rework status constraint logic for successes (#1515)
Since "success" and "failure" are the only two possible values, and
"success" is considered to be included by default, the existing code can
also be simplified a little.

This has the side effect of ignoring the "exclude" part of the
constraint completely. I put it in the tests just to make sure the
workaround in
https://github.com/woodpecker-ci/woodpecker/issues/1181#issuecomment-1347253585
continues to work as expected, but couldn't think of any legitimate use
cases for it.

Fixes #1181
2023-01-02 06:36:57 +01:00
Stephen Muth
1816f6c715
Allow adding additional labels/annotations to kubernetes worker pods (#1510)
Example agent environment configuration using the new value:
```yaml
  - env:
    - name: WOODPECKER_BACKEND
      value: kubernetes
    - name: WOODPECKER_BACKEND_K8S_NAMESPACE
      value: default
    - name: WOODPECKER_BACKEND_K8S_POD_LABELS
      value: '{"sidecar.istio.io/inject":"false"}'
```
2022-12-31 01:37:09 +01:00
6543
b6399c0a08
Refactor agent: split code in subfunctions (#1441)
logs of a killed pipeline are stored, with this pull
2022-11-23 15:35:24 +01:00
smainz
b8900cdf88
Fix wrong drone env vars (#1419)
Provide up to date drone compatibility environment variables to each step execution.

closes #1416

Before a step is executed, some environemnt variables are updated.
This ensures, that the updated environment variables are copied to their corresponding `DRONE_` environemt variables.

Side effect is that the `DRONE_` environemnt variables are no longer available in the metadata which should not harm as they are not used inside woodpecker.
2022-11-22 23:57:12 +01:00
Michaël Dierick
7859bde63d
add support for DRONE_COMMIT_SHA alias (#1421)
[The docker plugin
uses](d0e7d7f01b/cmd/drone-docker/main.go (L43))
the `DRONE_COMMIT_SHA` variant. According to [drone
reference](https://docs.drone.io/pipeline/environment/reference/) doc,
`DRONE_COMMIT_SHA` and `DRONE_COMMIT` are the same thing (although the
default value in the docker plugin suggests the 8-char short form).
2022-11-16 18:14:06 +01:00