Commit graph

1191 commits

Author SHA1 Message Date
qwerty287
eaf10611eb
Allow to disable deployments (#3570)
…but if they're enabled, allow for all events. Also add warning that you
should only enable it if you trust the users with push access.

closes #3559

---------

Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2024-04-02 22:03:37 +02:00
Robert Kaussow
a6e054f9fe
Remove datastore testfiles (#3584)
Ref: https://github.com/woodpecker-ci/woodpecker/pull/3227/files
2024-04-02 10:10:29 +02:00
Aumetra Weisman
20b84a1aee
Add flag to only access public repositories on GitHub (#3566) 2024-03-29 14:36:48 +01: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
qwerty287
326069c983
Fix flag name (#3534)
and remove two unused flags

should close https://github.com/woodpecker-ci/woodpecker/issues/3528
2024-03-21 21:39:16 +01:00
qwerty287
6abc112262
Fix gitea login (#3533)
Closes #3531
2024-03-21 19:18:22 +01:00
qwerty287
fbdfa14a00
Allow separate gitea oauth URL (#3513)
closes https://github.com/woodpecker-ci/woodpecker/issues/3470

---------

Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2024-03-21 11:37:02 +01:00
qwerty287
e00b2d4bd3
Only allow to deploy from push, tag and release (#3522) 2024-03-20 21:04:51 +01:00
6543
e57a09a404
Update pipeline state on server as a whole on approval (#3504)
We can not just update some records for steps, as we want the pipeline
engine as single source of truth but not manage the state.
And the server should only manage the state but not how pipelines work.

We can match the pipeline but neither workflows or steps 1:1, so we
"update" them as a whole by deleting existing workflow and step data and
insert the new info from engine.

close   #3494
close  #3472

---------
*Sponsored by Kithara Software GmbH*

---------

Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2024-03-18 20:07:45 +01:00
6543
43264a5f8e
rename stepID to workflowID to reflect value (#3502)
address https://github.com/woodpecker-ci/woodpecker/issues/3494#issuecomment-2001986597
2024-03-18 15:21:26 +01:00
renovate[bot]
5d98a717ac
fix(deps): update module github.com/google/go-github/v59 to v60 (#3493) 2024-03-16 09:37:08 +01:00
Robert Kaussow
a779eed3df
Enable golangci linter gomnd (#3171) 2024-03-15 18:00:25 +01:00
Thor Anker Kvisgård Lange
632c946511
feat: Remove user part of http clone url (#3462)
Some configuration of Bitbucket Datacenter seems to return username as
part of the clone URL. This needs to be removed for `.netrc` to work
properly.

Closes #3443

---------

Signed-off-by: Thor Anker Kvisgård Lange <tal@netic.dk>
2024-03-07 18:06:05 +01:00
Thor Anker Kvisgård Lange
ce51d65829
fix: Make sure to refresh access token when reading commit information (#3447)
When receiving notification by webhook the forge tries to read
information on the latest commit when constructing the pipeline. This
requires a call to the Bitbucket API which again requires the access
token to be up-to-date.

Signed-off-by: Thor Anker Kvisgård Lange <tal@netic.dk>
2024-02-27 17:15:11 +01:00
qwerty287
cb3efd2cd9
Simplify store interfaces (#3437)
Use `store.Store` interface if possible.
2024-02-25 10:37:10 +01:00
qwerty287
5b0430ab4a
Fix storing steps (#3431)
Closes https://github.com/woodpecker-ci/woodpecker/issues/3427
2024-02-25 08:16:14 +01:00
qwerty287
16dca0abc2
Store workflows/steps for blocked pipeline (#2757)
This stores workflows and steps to DB even if it is not yet approved and
thus blocked.

I'm not really happy with this, because even though it is stored, it
must parse the pipeline again and set back the original UUID. If you
have any ideas how to fix/improve this just comment.

In addition, this allows to view step list and side panel for approved
pipelines, https://github.com/woodpecker-ci/woodpecker/pull/2345 is
partially not longer necessary.

Closes https://github.com/woodpecker-ci/woodpecker/issues/895

---------

Co-authored-by: 6543 <6543@obermui.de>
2024-02-22 15:48:29 +01:00
6543
10e4bac936
Parse email from Gitea webhook (#3420)
The CI_COMMIT_AUTHOR_EMAIL was empty for gitea/forgejo,
now the webhook is parsed correctly.
2024-02-22 09:02:19 +02:00
qwerty287
bf0a9455ce
Update org name on login (#3409)
and create a new org once a user is created (logged in for the first
time)

closes https://github.com/woodpecker-ci/woodpecker/issues/3342

---------

Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2024-02-21 19:56:37 +01:00
Thor Anker Kvisgård Lange
364d708923
Add bitbucket datacenter (server) support (#2503)
This pull-requests re-introduces the Bitbucket Server support with a
more or less complete rewrite of the forge implementation. We have a lot
of on-premises git repositories hosted in Bitbucket Server and need a CI
solution for running that and Woodpecker looks promising.

The implementation is based on external Bitbucket Server REST client
library which we are maintaining and have created in another context.
Besides the original support for Bitbucket the re-implementation also
adds support for handling Bitbucket pull-request events.
2024-02-20 15:58:02 +01:00
qwerty287
0c9bbf91a3
Do not alter secret key upper-/lowercase (#3375) 2024-02-20 14:20:25 +01:00
Anbraten
f86c2b7d0f
Fix pipeline restart (#3402)
closes #3399
2024-02-17 10:19:28 +01:00
renovate[bot]
4e44dd0e76
fix(deps): update module github.com/google/go-github/v58 to v59 (#3398) 2024-02-17 09:04:33 +01:00
Anbraten
0e0d0188a0
Fix agent polling (#3378) 2024-02-16 10:04:13 +01:00
qwerty287
451af535d3
Replace http types on forge interface (#3374) 2024-02-13 16:19:02 +01:00
Anbraten
65d88be523
Prevent agent deletion when it's still running tasks (#3377)
It wont solve the underlying issues like
https://github.com/woodpecker-ci/autoscaler/issues/50 completely, but
should be a first step in the correct direction.
2024-02-12 19:23:56 +01:00
Anbraten
82e1ce937c
Refactor internal services (#915) 2024-02-11 18:42:33 +01:00
qwerty287
e1521ef460
Set correct link for commit (#3368)
Closes https://github.com/woodpecker-ci/woodpecker/issues/2657
Closes https://github.com/woodpecker-ci/woodpecker/issues/906
2024-02-11 10:44:50 +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
Anbraten
9e96c9c25e
Fix correctly handle gitlab pr closed events (#3362)
closes #3355
2024-02-09 16:49:04 +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
Lukas
5cedc956e9
Ignore gitlab merge request events without code changes (#3338)
Closes #3320 

From the gitlab docs at:
https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#merge-request-events

> The field object_attributes.oldrev is only available when there are
actual code changes
2024-02-07 01:45:00 +01:00
Lukas
baf2e645bc
Ignore gitlab push events without commits (#3339)
Example of the resulting buggy pipeline:


![image](https://github.com/woodpecker-ci/woodpecker/assets/32853499/1e4bedc6-465b-466e-8d89-a7348e374c7f)
2024-02-07 02:24:08 +02:00
Lukas
db4a50951c
Consider gitlab inherited permissions (#3308)
The gitlab projects endpoint does not include information about
permissions granted by namespace memberships. To get this information a
separate query to
https://docs.gitlab.com/ee/api/members.html#get-a-member-of-a-group-or-project-including-inherited-and-invited-members
is necessary.
2024-02-06 00:10:23 +01:00
Patrick Schratz
e85762f791
Remove accidentally added file (#3304)
See discussion in [`1ab94d6`
(#3303)](1ab94d662b (r1473078205))

@qwerty287
2024-01-31 18:38:39 +01:00
Anbraten
6ed1655ce3
Add release types (#3303)
Co-authored-by: pat-s <patrick.schratz@gmail.com>
2024-01-31 16:18:32 +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
qwerty287
2eec1ce909
Fix agent updating (#3287) 2024-01-28 12:29:56 +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
Alconety
8cb86ddc68
fix bitbucket SSO using UUID from bitbucket api response as ForgeRemoteID (#3265) 2024-01-23 16:35:30 +01:00
qwerty287
c8fa71874a
Fix disabling PRs (#3258)
Closes https://github.com/woodpecker-ci/woodpecker/issues/3257
2024-01-22 20:46:46 +01:00
qwerty287
5e2f7d81b3
Clean up models (#3228) 2024-01-22 07:56:18 +01:00
6543
8ca51971be
Add gitea/forgejo driver check, to handle ErrUnknownVersion error (#3243)
close  #3240
2024-01-21 23:07:37 +02:00
Michalis Zampetakis
39c1beffc5
Fix Bitbucket get pull requests that ignores pagination (#3235)
Fixes #3180
2024-01-20 22:41:54 +01:00
qwerty287
b82790d54c
Remove some interfaces (#3220) 2024-01-19 16:20:35 +01:00
Alconety
07479dd645
Retrieve all user repo perms with a single API call (#3211)
This pull request addresses the issue https://github.com/woodpecker-ci/woodpecker/issues/3210.

Ideally, the Bitbucket API should include repository permissions when
utilizing the 'get all repositories' endpoint. However, as it currently
does not provide this information, a viable solution is to fetch all
permissions for every repository and then employ a dictionary to
associate each repository with its respective permissions.

Without implementing this fix, logging in becomes problematic for users
with access to a substantial number of repositories (300+), as the
process takes over 2 minutes to complete.

---------

Co-authored-by: Alberto Alcón <albertoalcon@bit2me.com>
2024-01-19 04:15:47 +01:00
6543
7b29d1da49
Make PipelineConfig unique again (#3215)
fix https://github.com/woodpecker-ci/woodpecker/issues/3093

reverts https://github.com/woodpecker-ci/woodpecker/pull/3128
2024-01-18 23:50:29 +02:00
qwerty287
001b5639a6
Use assert for test (#3201)
instead of `if`s
2024-01-14 19:33:58 +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
renovate[bot]
57dd88f94a
fix(deps): update module github.com/google/go-github/v57 to v58 (#3187) 2024-01-13 08:13:22 +01:00
Robert Kaussow
9bbba4441d
Enable golangci linter forcetypeassert (#3168)
Split out from https://github.com/woodpecker-ci/woodpecker/pull/2960
2024-01-12 02:01: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
d0380e31b5
Remove panic recovering (#3162) 2024-01-11 19:37:47 +01:00
qwerty287
b0a2b1cf2d
Lowercase all log strings (#3173)
from #3161

---------

Co-authored-by: 6543 <6543@obermui.de>
2024-01-11 19:17:07 +01:00
Robert Kaussow
7756c60a33
Enable golangci linter stylecheck (#3167)
This PR only fixes error string formatting, log message strings are
still mixed upper/lowercase (see
https://github.com/woodpecker-ci/woodpecker/pull/3161#issuecomment-1885140649)
and I'm not aware of a linter to enforce it.
2024-01-10 22:56:42 +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
1b380ff4b4
Enable nolintlint (#3158) 2024-01-10 12:11:18 +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
a63135363b
Step status update dont set to running again once it got stoped (#3151)
Because of the check `if step.Stopped == 0`

without the check there are edgecases where could be the case a stoped
steped can be markt as running again, witch is wrong.

I do remember we have "running" steps indefinetly in cancled pipelines.
This could be the fix, i just did not test that specific.

Anyway the func hat a good testcoverage ... so just look at the tests

_Source:
https://github.com/woodpecker-ci/woodpecker/pull/3143#discussion_r1446138088_
2024-01-09 18:34:55 +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
106508a094
Make config linking non-unique (#3128)
closes https://github.com/woodpecker-ci/woodpecker/issues/3093
2024-01-07 16:12:27 +01:00
qwerty287
ef1d286596
Allow PR secrets to be used on close (#3084)
closes https://github.com/woodpecker-ci/woodpecker/issues/3071

1. If a secret can be used on PRs, it can also be used on PR close.
2. If no events are set, disallow access to secret. This was different
before, secrets without any event set were allowed for all events.
3. Compare strings instead of patterns.

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-12-31 21:43:24 +01:00
qwerty287
72ae8828ca
Load changed files for closed PR (#3067) 2023-12-29 22:50: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
6543
74f6824d03
Add option to disable version check in admin web UI (#3040)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-12-27 22:16:15 +01:00
qwerty287
05f26bab00
Add another testcase (#3035)
Actually wanted to add this to #3030 but @6543 was too fast…
2023-12-27 10:51:39 +01: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
devlux
5671956a31
Correct http cache headers for firefox (#3017)
Co-authored-by: Luca Marinucci <luca.marinucci@devlux.ch>
Co-authored-by: Anbraten <anton@ju60.de>
2023-12-26 08:37:13 +01:00
6543
3f1f563180
fix and lint swagger file (#3007)
Co-authored-by: qwerty287 <ndev@web.de>
2023-12-24 15:50:01 +01:00
qwerty287
04d1f9ff5f
Support more addon types (#2984)
Actually support all types that can be possible.

Closes https://github.com/woodpecker-ci/woodpecker/discussions/2520
2023-12-24 13:26:23 +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
Anbraten
e5dbbd92c7
Fix gitlab project fetching (#3000) 2023-12-23 09:48:16 +01:00
Anbraten
619858e0e9
Ignore pipelines without config (#2949)
Co-authored-by: 6543 <6543@obermui.de>
2023-12-21 11:13:25 +01:00
6543
65c62e987f
gitlab: support nested repos (#2981)
close  #2311
2023-12-21 00:55:16 +01:00
Lauris BH
6432109daf
Fix static file caching (#2975)
Replaces #2972

Fixes #2483

Removed etag header as etag is used incorrectly, it should be based on
content not startup time and we don't handle it from request headers
anyway.
2023-12-20 10:31:52 +02:00
runephilosof-karnovgroup
a28e2e1920
Register Agent with hostname (#2936)
Transfer the agent hostname to the server's model.agent.Name field.

Previously the autoscaler had to create the agent with the server and
get a unique token to pass to the agent at boot up. This allows to get
the right name for the agent while using the shared master agent token
at agent boot up.
Both ways are still supported.
2023-12-19 14:17:36 +01:00
6543
2e7610379e
Update slogan & logo (#2962)
- Update woodpecker slogan to repo too
  we are not just a simple fork anymore 🎉
- use https://github.com/woodpecker-ci/design/blob/main/logo/non-square.svg
2023-12-19 14:12:18 +01:00
6543
1ca549190b
Gitea driver: ignore GetOrg error if we get a valid user. (#2967)
`[POST] /api/repos?forge_remote_id=12345`

```json
{"level":"error","error":"GetOrgByName","time":"2023-12-19T01:03:36Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/api/repo.go:143","message":"Could not fetch organization from forge."}
```

because `https://codeberg.org/api/v1/orgs/6543` returns an error.
`https://codeberg.org/api/v1/users/6543` do not.

close  #2714
2023-12-19 09:13:39 +01:00
6543
257a76c5ea
Improve error handling when activating a repository (#2965)
Activate Repo:
- Don't drop errors and also always log them on the server.
- Show users only meaningful error messages.
2023-12-19 06:25:59 +01:00
6543
ebbac258a2
Add check for storage where repo/org name is empty (#2968)
I just discovered that there is an organization created with name being empty.

we should at least catch it for now in the storage - and later trace
down why we get it in the first place
2023-12-19 06:03:56 +01:00
Robert Kaussow
23f58fc07a
Fix broken gated repos (#2959)
Fixes a bug introduced in
https://github.com/woodpecker-ci/woodpecker/pull/2923. I'll also try to
add a test case.
2023-12-17 18:44:48 +02:00
Anbraten
16803d6217
Show secrets from org and global level (#2873)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-12-16 10:29:13 +01:00
6543
1f8b3b5e1b
Only update pipelineStatus in one place (#2952) 2023-12-15 10:03:05 +01:00
qwerty287
360b41f961
Remove separate root path config (#2943) 2023-12-13 15:51:18 +01:00
6543
4974d4cffe
ignore some errors on repairAllRepos (#2792)
close  #2791

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-12-13 14:53:38 +01:00
Lauris BH
c6ce23e933
Allow to restart pipelines that has warnings (#2939) 2023-12-13 14:11:05 +01:00
Robert Kaussow
6de5922408
Fix skipped pipelines model (#2923)
Fixes: https://github.com/woodpecker-ci/woodpecker/issues/2901

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
2023-12-12 22:30:52 +02: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
renovate[bot]
621eed6205
Update module github.com/google/go-github/v56 to v57 (#2899) 2023-12-02 15:19:39 +01:00
qwerty287
237b2257f5
Fix bitbucket org fetching (#2874)
closes #2793
2023-12-01 20:45:42 +01:00
qwerty287
2f963d70e7
Add linting for any (#2893)
Add gofmt rules to make sure `interface{}` is not used but only `any`.
2023-11-29 20:21:18 +01:00
qwerty287
7bacbd5699
Migrate to Xormigrate (#2711)
Co-authored-by: Anbraten <anton@ju60.de>
2023-11-28 10:31:54 +01:00
qwerty287
849b02a433
Fix pipeline-related environment (#2876)
closes https://github.com/woodpecker-ci/woodpecker/issues/2672

pipeline model must be persisted first to have some fields like `Number`
and `ID`
2023-11-26 19:59:36 +01:00