Commit graph

88 commits

Author SHA1 Message Date
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
renovate[bot] afd457a534
Update golang (packages) (#3564)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/cenkalti/backoff/v4](https://togithub.com/cenkalti/backoff)
| `v4.2.1` -> `v4.3.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fcenkalti%2fbackoff%2fv4/v4.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fcenkalti%2fbackoff%2fv4/v4.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fcenkalti%2fbackoff%2fv4/v4.2.1/v4.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fcenkalti%2fbackoff%2fv4/v4.2.1/v4.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[github.com/charmbracelet/huh/spinner](https://togithub.com/charmbracelet/huh)
| `v0.0.0-20240306161957-71f31c155b08` -> `v0.3.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fcharmbracelet%2fhuh%2fspinner/v0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fcharmbracelet%2fhuh%2fspinner/v0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fcharmbracelet%2fhuh%2fspinner/v0.0.0-20240306161957-71f31c155b08/v0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fcharmbracelet%2fhuh%2fspinner/v0.0.0-20240306161957-71f31c155b08/v0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[github.com/distribution/reference](https://togithub.com/distribution/reference)
| `v0.5.0` -> `v0.6.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fdistribution%2freference/v0.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fdistribution%2freference/v0.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fdistribution%2freference/v0.5.0/v0.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fdistribution%2freference/v0.5.0/v0.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [github.com/expr-lang/expr](https://togithub.com/expr-lang/expr) |
`v1.16.2` -> `v1.16.3` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fexpr-lang%2fexpr/v1.16.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fexpr-lang%2fexpr/v1.16.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fexpr-lang%2fexpr/v1.16.2/v1.16.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fexpr-lang%2fexpr/v1.16.2/v1.16.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[github.com/go-sql-driver/mysql](https://togithub.com/go-sql-driver/mysql)
| `v1.8.0` -> `v1.8.1` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgo-sql-driver%2fmysql/v1.8.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgo-sql-driver%2fmysql/v1.8.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgo-sql-driver%2fmysql/v1.8.0/v1.8.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgo-sql-driver%2fmysql/v1.8.0/v1.8.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>cenkalti/backoff (github.com/cenkalti/backoff/v4)</summary>

###
[`v4.3.0`](https://togithub.com/cenkalti/backoff/compare/v4.2.1...v4.3.0)

[Compare
Source](https://togithub.com/cenkalti/backoff/compare/v4.2.1...v4.3.0)

</details>

<details>
<summary>charmbracelet/huh
(github.com/charmbracelet/huh/spinner)</summary>

###
[`v0.3.0`](https://togithub.com/charmbracelet/huh/releases/tag/v0.3.0)

[Compare
Source](https://togithub.com/charmbracelet/huh/compare/v0.2.3...v0.3.0)

### Scrolling, autocomplete, smaller binaries and more!

This is a big release with a tonne of new features.

-   Scrollable Forms
-   Scrollable Selects and Multi selects
-   Autocomplete for inputs
-   7x smaller binaries
-   Multi select filtering
-   Lotsa' bugfixes and quality-of-life improvements

To upgrade to `huh` v0.3.0:

```bash
go get -u github.com/charmbracelet/huh@latest
```

For details read on!

#### Scrollable forms

If a form is in a small terminal it will automatically resize to fit the
available space and the active group will scroll to stay in view. Form
heights can also be set manually with the new
[`WithHeight`](https://pkg.go.dev/github.com/charmbracelet/huh@v0.3.0#Form.WithHeight)
method.

<img width="800"
src="https://vhs.charm.sh/vhs-1krvQFrEFaf3H1h7jbQomc.gif" alt="Made with
VHS">

#### Select and Multi select Scrolling

Select and Multi select fields can now be restricted to a certain
height, allowing their options to be scrollable. This means you can now
pack in tonnes of options.

To make a `Select` or `MultiSelect` scrollable simply set the height on
the field or form through the `Height` method.

```go
s := huh.NewSelect()
    .Title("What’s for dinner?")
    .Options(/* ... */)
    .Height(height)
```

<img width="600"
src="https://vhs.charm.sh/vhs-7vcNAV9T20oeMFraAFd0B7.gif" alt="Made with
VHS">

#### Autocomplete

Now `Input`s can offer suggestions making it easier for users to fill
out inputs. These suggestions can be accepted autocomplete-style with a
configurable key binding (which defaults to <kbd>ctrl+e</kbd>).

Simply provide a `[]string` to `Suggestions` to enable this feature.

```go
huh.NewInput().
    Title("What's for lunch?").
    Prompt("? ").
    Suggestions([]string{
        "Artichoke",
        // ...
        "Cashew Apple",
        "Cashews",
        "Cat Food",
        "Coconut Milk",
        "Cucumber",
        "Curry Paste",
        "Currywurst",
        // ...
    })
```

<img width="600"
src="https://vhs.charm.sh/vhs-49L7gt948FkJxfTzfa2qmE.gif" alt="Made with
VHS">

#### More helpful help

Forms will automatically adjust their help text to indicate to the user
whether the form will continue or submit on actions. This works with
hidden groups. In the below example, the user will be asked to list
their allergies if they select "Yes" otherwise, the form will submit.

<img width="600"
src="https://vhs.charm.sh/vhs-7skg7qpQYCMG2Y5Vl751si.gif" alt="Made with
VHS">

#### Way smaller binaries

Huh now produces way smaller binaries! Thanks to
[#&#8203;94](https://togithub.com/charmbracelet/huh/issues/94) Huh now
has a 7x smaller compiled footprint.

Before, using `huh@v0.2.3`:

    33M     ./burger

After, using `huh@v0.3.0`:

    4.5M    ./burger

#### Thanks, Vitor!

Special thanks to the intrepid
[@&#8203;vitor-mariano](https://togithub.com/vitor-mariano), one of the
earliest `huh` contributors, who came in hot with features, fixes,
improvements and good vibes. Thank you, Vitor!

#### Changelog

##### New

- scrollable multi-select by
[@&#8203;meowgorithm](https://togithub.com/meowgorithm) in
[https://github.com/charmbracelet/huh/pull/71](https://togithub.com/charmbracelet/huh/pull/71)
- scrollable select by
[@&#8203;meowgorithm](https://togithub.com/meowgorithm) in
[https://github.com/charmbracelet/huh/pull/76](https://togithub.com/charmbracelet/huh/pull/76)
- feat: enable filtering on MultiSelect by
[@&#8203;vitor-mariano](https://togithub.com/vitor-mariano) in
[https://github.com/charmbracelet/huh/pull/81](https://togithub.com/charmbracelet/huh/pull/81)
- skippable Fields by
[@&#8203;maaslalani](https://togithub.com/maaslalani) in
[https://github.com/charmbracelet/huh/pull/116](https://togithub.com/charmbracelet/huh/pull/116)
- autocomplete suggestions on inputs by
[@&#8203;maaslalani](https://togithub.com/maaslalani) in
[https://github.com/charmbracelet/huh/pull/93](https://togithub.com/charmbracelet/huh/pull/93)
- scroll form Inputs by
[@&#8203;maaslalani](https://togithub.com/maaslalani) in
[https://github.com/charmbracelet/huh/pull/95](https://togithub.com/charmbracelet/huh/pull/95)
- next / previous dynamic help by
[@&#8203;maaslalani](https://togithub.com/maaslalani) in
[https://github.com/charmbracelet/huh/pull/104](https://togithub.com/charmbracelet/huh/pull/104)
- reduce binary size by
[@&#8203;maaslalani](https://togithub.com/maaslalani) in
[https://github.com/charmbracelet/huh/pull/94](https://togithub.com/charmbracelet/huh/pull/94)

##### Fixed

- fix Select and MultiSelect height when unfocused by
[@&#8203;vitor-mariano](https://togithub.com/vitor-mariano) in
[https://github.com/charmbracelet/huh/pull/80](https://togithub.com/charmbracelet/huh/pull/80)
- use CharLimit in textinput by
[@&#8203;maaslalani](https://togithub.com/maaslalani) in
[https://github.com/charmbracelet/huh/pull/79](https://togithub.com/charmbracelet/huh/pull/79)
- select viewport on filtering by
[@&#8203;vitor-mariano](https://togithub.com/vitor-mariano) in
[https://github.com/charmbracelet/huh/pull/84](https://togithub.com/charmbracelet/huh/pull/84)
- set default theme on inputs by
[@&#8203;maaslalani](https://togithub.com/maaslalani) in
[https://github.com/charmbracelet/huh/pull/92](https://togithub.com/charmbracelet/huh/pull/92)
- multiselect: set height in WithHeight by
[@&#8203;ardnew](https://togithub.com/ardnew) in
[https://github.com/charmbracelet/huh/pull/118](https://togithub.com/charmbracelet/huh/pull/118)
- shift+tab would fail if first group is hidden by
[@&#8203;caarlos0](https://togithub.com/caarlos0) in
[https://github.com/charmbracelet/huh/pull/103](https://togithub.com/charmbracelet/huh/pull/103)
- prevField should not select skippable fields by
[@&#8203;maaslalani](https://togithub.com/maaslalani) in
[https://github.com/charmbracelet/huh/pull/121](https://togithub.com/charmbracelet/huh/pull/121)

**Full Changelog**:
https://github.com/charmbracelet/huh/compare/v0.2.3...v0.3.0

***

<a href="https://charm.sh/"><img alt="The Charm logo"
src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a>

Thoughts? Questions? We love hearing from you. Feel free to reach out on
[Twitter](https://twitter.com/charmcli), [The
Fediverse](https://mastodon.technology/@&#8203;charm), or on
[Discord](https://charm.sh/chat).

###
[`v0.2.3`](https://togithub.com/charmbracelet/huh/releases/tag/v0.2.3)

[Compare
Source](https://togithub.com/charmbracelet/huh/compare/v0.2.2...v0.2.3)

#### Better Defaults!

Huh? `v0.2.3` fixes some bugs for more consistent behaviour across
inputs 🐞

- `Text` inputs now update values on each keystroke rather than on
`Blur` for consistency.
- `Select` and `MultiSelect` read their default values from the initial
values set by the `Value` variable if provided.

A *special* thanks to
[@&#8203;vitor-mariano](https://togithub.com/vitor-mariano) for all his
contributions to this release 🤗

##### Defaults Example

You can now have preselected options by declaring them in the `Value`
variable:

```go
var toppings = []string{"Lettuce", "Tomatoes"}
var options = huh.NewOptions("Lettuce", "Tomatoes", "Charm Sauce", "Cheese", "Vegan Cheese")

huh.NewMultiSelect[string]().Title("Toppings").Options(options...).Value(&toppings).Run()
```

In the above example, `Lettuce` and `Tomatoes` will be preselected by
default.

#### What's Changed

- `Text` value updates by
[@&#8203;vitor-mariano](https://togithub.com/vitor-mariano) in
[https://github.com/charmbracelet/huh/pull/64](https://togithub.com/charmbracelet/huh/pull/64)
- Prefill `Select` and `MultiSelect` inputs with default values by
[@&#8203;vitor-mariano](https://togithub.com/vitor-mariano) in
[https://github.com/charmbracelet/huh/pull/62](https://togithub.com/charmbracelet/huh/pull/62)

**Full Changelog**:
https://github.com/charmbracelet/huh/compare/v0.2.2...v0.2.3

***

<a href="https://charm.sh/"><img alt="The Charm logo"
src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a>

Thoughts? Questions? We love hearing from you. Feel free to reach out on
[Twitter](https://twitter.com/charmcli), [The
Fediverse](https://mastodon.technology/@&#8203;charm), or on
[Discord](https://charm.sh/chat).

###
[`v0.2.2`](https://togithub.com/charmbracelet/huh/releases/tag/v0.2.2)

[Compare
Source](https://togithub.com/charmbracelet/huh/compare/v0.2.1...v0.2.2)

#### Better Wrapping 🎁

`Huh?` v0.2.2 improves wrapping of the `Input` and `Text` fields.
It applies width set on the form to the inputs to perform wrapping based
on the specified or terminal width.

- Fixed in
[https://github.com/charmbracelet/huh/pull/60](https://togithub.com/charmbracelet/huh/pull/60)

#### New Contributors

- [@&#8203;ddddddO](https://togithub.com/ddddddO) made their first
contribution in
[https://github.com/charmbracelet/huh/pull/56](https://togithub.com/charmbracelet/huh/pull/56)
- [@&#8203;vitor-mariano](https://togithub.com/vitor-mariano) made their
first contribution in
[https://github.com/charmbracelet/huh/pull/57](https://togithub.com/charmbracelet/huh/pull/57)

**Full Changelog**:
https://github.com/charmbracelet/huh/compare/v0.2.1...v0.2.2

***

<a href="https://charm.sh/"><img alt="The Charm logo"
src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a>

Thoughts? Questions? We love hearing from you. Feel free to reach out on
[Twitter](https://twitter.com/charmcli), [The
Fediverse](https://mastodon.social/@&#8203;charmcli), or
[Discord](https://charm.sh/chat).

###
[`v0.2.1`](https://togithub.com/charmbracelet/huh/releases/tag/v0.2.1)

[Compare
Source](https://togithub.com/charmbracelet/huh/compare/v0.2.0...v0.2.1)

### New Theme! 😸

`huh?` forms can now use Catppuccin themes. (Thanks to the wonderful
[@&#8203;sgoudham](https://togithub.com/sgoudham) )

Simply add the following to your `huh.Form`s:

```go
.WithTheme(huh.ThemeCatppuccin())
```

<img width="500"
src="https://github.com/charmbracelet/huh/assets/42545625/fdea4eb5-fa3b-472c-8aa4-9537e9577ab5"
/>

***

<a href="https://charm.sh/"><img alt="The Charm logo"
src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a>

Thoughts? Questions? We love hearing from you. Feel free to reach out on
[Twitter](https://twitter.com/charmcli), [The
Fediverse](https://mastodon.social/@&#8203;charmcli), or
[Discord](https://charm.sh/chat).

###
[`v0.2.0`](https://togithub.com/charmbracelet/huh/releases/tag/v0.2.0)

[Compare
Source](https://togithub.com/charmbracelet/huh/compare/v0.1.0...v0.2.0)

### Better Help Styles!

`Help` Styles now apply on a `Theme` rather than embedded in
`FieldStyles`. (Thanks to the wonderful
[@&#8203;jolheiser](https://togithub.com/jolheiser) )

```go
// Old...
theme.Focused.Help.ShortKey = lipgloss.NewStyle() //...

// Updated!
theme.Help.ShortKey = lipgloss.NewStyle() //...
```

***

<a href="https://charm.sh/"><img alt="The Charm logo"
src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a>

Thoughts? Questions? We love hearing from you. Feel free to reach out on
[Twitter](https://twitter.com/charmcli), [The
Fediverse](https://mastodon.social/@&#8203;charmcli), or
[Discord](https://charm.sh/chat).

</details>

<details>
<summary>distribution/reference
(github.com/distribution/reference)</summary>

###
[`v0.6.0`](https://togithub.com/distribution/reference/releases/tag/v0.6.0)

[Compare
Source](https://togithub.com/distribution/reference/compare/v0.5.0...v0.6.0)

#### What's Changed

- remove deprecated SplitHostname by
[@&#8203;thaJeztah](https://togithub.com/thaJeztah) in
[https://github.com/distribution/reference/pull/5](https://togithub.com/distribution/reference/pull/5)
- refactor splitDockerDomain to include more documentation by
[@&#8203;thaJeztah](https://togithub.com/thaJeztah) in
[https://github.com/distribution/reference/pull/7](https://togithub.com/distribution/reference/pull/7)
- fix typo in readme by [@&#8203;xrstf](https://togithub.com/xrstf) in
[https://github.com/distribution/reference/pull/10](https://togithub.com/distribution/reference/pull/10)
- Exclude domain from name length check by
[@&#8203;ozairasim](https://togithub.com/ozairasim) in
[https://github.com/distribution/reference/pull/9](https://togithub.com/distribution/reference/pull/9)

#### New Contributors

- [@&#8203;xrstf](https://togithub.com/xrstf) made their first
contribution in
[https://github.com/distribution/reference/pull/10](https://togithub.com/distribution/reference/pull/10)
- [@&#8203;ozairasim](https://togithub.com/ozairasim) made their first
contribution in
[https://github.com/distribution/reference/pull/9](https://togithub.com/distribution/reference/pull/9)

**Full Changelog**:
https://github.com/distribution/reference/compare/v0.5.0...v0.6.0

</details>

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

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

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

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

```go
program, err := expr.Compile(`let x = 2 + 2; x ^ x`)
output, err := expr.Run(program, env)
```

**In this release**:

-   Improved printing for maps: `{(foo + bar): 42}`

**Expr Editor**

The [Expr Editor](https://expr-lang.org/editor) is an embeddable code
editor written in JavaScript with full support of Expr language.

**Expr Pro**

[Expr Pro](https://expr-lang.org/expr-pro) is a set of extensions for
Expr for advanced use cases. It includes expressions explanation,
performance profiling, and more.

</details>

<details>
<summary>go-sql-driver/mysql (github.com/go-sql-driver/mysql)</summary>

###
[`v1.8.1`](https://togithub.com/go-sql-driver/mysql/releases/tag/v1.8.1)

[Compare
Source](https://togithub.com/go-sql-driver/mysql/compare/v1.8.0...v1.8.1)

#### What's Changed

Bugfixes:

- fix race condition when context is canceled in
[#&#8203;1562](https://togithub.com/go-sql-driver/mysql/pull/1562) and
[#&#8203;1570](https://togithub.com/go-sql-driver/mysql/pull/1570)

**Full Changelog**:
https://github.com/go-sql-driver/mysql/compare/v1.8.0...v1.8.1

</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:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
2024-03-29 09:21:54 +01:00
Robert Kaussow a779eed3df
Enable golangci linter gomnd (#3171) 2024-03-15 18:00:25 +01:00
qwerty287 5e2f7d81b3
Clean up models (#3228) 2024-01-22 07:56:18 +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 45bf8600ef
Remove multipart logger (#3200) 2024-01-14 10:54:02 +01:00
Robert Kaussow f813badcf9
Enable golangci linter contextcheck (#3170)
Split out from https://github.com/woodpecker-ci/woodpecker/pull/2960
2024-01-11 22:15:15 +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
qwerty287 12c40eb957
Enable gocritic and don't ignore globally (#3159)
Use `nolint` directives instead.

From #2960
2024-01-10 15:34:44 +01:00
qwerty287 768fd71841
Enable some linters (#3129)
Mostly those that did not require much work.

From #2960

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-09 21:35:37 +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
6543 cd59a85230
Use name in backend types instead of alias (#3142) 2024-01-09 15:22:59 +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
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:
2580d0e08d
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
renovate[bot] 3d19d863d1
fix(deps): update module github.com/tevino/abool to v2 (#2460) 2023-09-14 07:34:36 +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
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
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
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
Harikesh00 36e42914fa
Renamed procs/jobs to steps in code (#1331)
Renamed `procs` to `steps` in code for the issue #1288

Co-authored-by: Harikesh Prajapati <harikesh.prajapati@druva.com>
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2022-10-28 17:38:53 +02:00
qwerty287 f88c70b55e
Rename to pipeline in DB and JSONs (#1296)
Closes #1282 

Follow-up to #1224, addresses #745

- changes JSON fields
- adds migration to rename columns
- fixes some comments
2022-10-22 15:54:43 +02:00
qwerty287 849e05bb8b
Rename build to pipeline in code (#1224)
Ref:  #745

Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: 6543 <6543@obermui.de>
2022-10-18 03:24:12 +02:00
6543 f21d854114
Move away from deprecated go funcs (#1123) 2022-08-25 08:39:19 +02:00
6543 068063655b
Make pipeline runtime log with description (#970)
* introduce runtime descriptors to pipeline runtime

* nit return orig error at traceStep()

* more logging

* refactor

Co-authored-by: Zav Shotan <zshotan@bloomberg.net>
2022-06-15 18:11:20 +02:00
Anbraten e79ad00826
Add agent tagging / filtering for pipelines (#902)
Officially support labels for pipelines and agents to improve pipeline picking. 

* add pipeline labels
* update, improve docs  and add migration
* update proto file

---
closes #304 & #860
2022-05-31 01:12:18 +02:00
Zav Shotan acbcc53872
Added support for step errors when executing backend (#817)
When executing a backend step, in case of failure of the specific step, the run is marked as errored but the step error is missing.

Added:
1. Log for the backend error (without trace)
2. Mark the step as errored with exit code 126 (Could not execute).

Co-authored-by: Zav Shotan <zshotan@bloomberg.net>
Co-authored-by: Anton Bracke <anton@ju60.de>
2022-05-11 13:40:44 +02:00
Anbraten c1a8884d62
Add backend selection for agent (#463)
- add backend selection option
- by default it will auto-detect a backend
2021-11-26 03:34:48 +01:00
Anbraten 063d0bb32a
Replace DRONE_ with CI_ variables in pipeline steps (#427)
Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables.
  - `CI_*` prefix replaces `DRONE_*`
  - `CI` value is now `woodpecker`
  - `DRONE=true` has been removed
2021-11-25 20:43:31 +01:00
Lukas 116c310820
Add linter misspell (#530)
* Add linter misspell

* Fix spelling

Co-authored-by: Anbraten <anton@ju60.de>
2021-11-24 02:01:12 +01:00
Lukas 25bf91bd37
Add linter whitespace (#531) 2021-11-24 01:31:11 +01:00
6543 fe31fb1e06
Drop error only on purpose or else report back or log (#514)
- Remove Deadcode
- Simplify Code
- Drop error only on purpose
2021-11-23 15:36:52 +01:00
6543 86bb8f195c
format do 'simplify' and check via CI (#509)
* `make format` simplify code now

* code format

* check simplified via linter
2021-11-14 22:33:45 +01:00
6543 ca8e215cfa
Migrate to Xorm (#474)
close #234

* Migrate store
* Migrate tests
* Rewrite migrations
* Init fresh DB in on step
* Rm old stuff (meddler, sql files, dead code, ...)
2021-11-13 20:18:06 +01:00
John Olheiser 4276a04f0c
Move entirely to zerolog (#426)
Completely switch to zerolog

(Remove usage of logrus and std logger)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2021-10-12 09:25:13 +02:00