1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00
Commit Graph

5800 Commits

Author SHA1 Message Date
6543
432f49cae3
Bump github.com/docker/docker from v24.0.9 to v24.0.9+30 (#4077) 2024-09-02 14:23:17 +02:00
6543
4535ef330a
Allow admins to specify priviledged plugins by name **and tag** (#4075) (#4076) 2024-09-01 23:06:06 +02:00
qwerty287
a360563fad
Warn if using secrets/env with plugin (#4027) (#4039) 2024-08-16 17:08:06 +02:00
qwerty287
4ab8374c9a Set refspec for gitlab MR (#4021) 2024-08-16 10:23:38 +02:00
Joan Flotats
1ec7525bf4 Change Bitbucket PR hook to point the source branch, commit & ref (#3965)
## Description

This is the first fix for: https://github.com/woodpecker-ci/woodpecker/issues/3932

Change the Pull Request hook parser to return the source commit, branch, and ref instead of the destination. Right now, the workflow pulls the destination configuration and code. It should pull the source configuration and code to verify that the configuration and code work as expected before merging the changes.

In case of the close event, the hook parser returns the destination branch, ref and merge commit. Usually, the contributor automatically deletes the source branch after merging the changes to the destination branch. Using the source values will cause the workflow to fail.

After the changes, Woodpecker will correctly download the workflow from the source branch (Pull Request commit), but it will fail to clone the repository. This issue is related to the commit format returned by the Bitbucket webhook. This inconsistency has already been reported: https://jira.atlassian.com/browse/BCLOUD-21201. The webhook returns a short SHA. The problem is that the `git fetch` command requires the full SHA. 

A workaround for this issue is to use the ref to fetch the code:

```yaml
clone:
  git:
    image: woodpeckerci/plugin-git
    settings:
      ref: ${CI_COMMIT_REF}
```

This is not ideal, because the Pull Request head won't always match the workflow commit, but it solves 80% of the event use cases (e.g. trigger a pull request workflow on change). This workaround won't work when re-running a previous workflow pointing to another commit, it will pull the last commit, not the previous one.

## Solutions

The solution proposed by the community is to retrieve the full SHA from the Bitbucket API using the short one. This solution has drawbacks:
- The Bitbucket API rate limit is 1000 req/h. This solution will reduce the maximum number of workflow runs per hour.
- It requires a braking change in the forges interface because the ´Hook(...)´ method does not have an instance of the HTTP Client. 

We propose to allow the git plugin to fetch the source code from a URL. The Bitbucket returns a link pointing to the commit. 

This proposal only requires a small change to the git plugin:
- Add a new optional parameter (e.g. CommitLink)
- Add a clause to the following conditional: 7ac9615f40/plugin.go (L79C1-L88C3)
```go
if p.Pipeline.CommitLink != "" {...}
```
Git commands:
```shell
$ git fetch --no-tags --depth=1 --filter=tree:0 https://bitbucket.org/workspace/repo/commits/692972aabfec
$ git reset --hard -q 692972aabfec # It works with the short SHA
```
Woodpecker will set CommitLink to a blank string for the other forges, but Bitbuckket will use the one returned by the webhook.
2024-07-23 16:59:17 +02:00
Joan Flotats
8f11a8ec9d Add updated, merged and declined events to bb webhook activation (#3963)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-07-23 14:41:53 +02:00
qwerty287
814fc92bb5 Fix panic if forge is unreachable (#3944) 2024-07-23 13:47:52 +02:00
Anbraten
7ab9aafc7f Fix login via navbar (#3962) 2024-07-23 13:46:52 +02:00
woodpecker-bot
805c3156f8
🎉 Release 2.7.0 (#3793)
## [2.7.0](https://github.com/woodpecker-ci/woodpecker/releases/tag/v2.7.0) - 2024-07-18

### 🔒 Security

- Add blocklist of environment variables who could alter execution of plugins [[#3934](https://github.com/woodpecker-ci/woodpecker/pull/3934)]
- Make sure plugins only mount the workspace base in a predefinde location [[#3933](https://github.com/woodpecker-ci/woodpecker/pull/3933)]
- Disallow to set arbitrary environments for plugins [[#3909](https://github.com/woodpecker-ci/woodpecker/pull/3909)]
- Use proper oauth state [[#3847](https://github.com/woodpecker-ci/woodpecker/pull/3847)]
- Enhance token checking [[#3842](https://github.com/woodpecker-ci/woodpecker/pull/3842)]
- Bump github.com/hashicorp/go-retryablehttp v0.7.5 -> v0.7.7 [[#3834](https://github.com/woodpecker-ci/woodpecker/pull/3834)]

###  Features

- Gracefully shutdown server [[#3896](https://github.com/woodpecker-ci/woodpecker/pull/3896)]
- Gracefully shutdown agent [[#3895](https://github.com/woodpecker-ci/woodpecker/pull/3895)]
- Convert urls in logs to links  [[#3904](https://github.com/woodpecker-ci/woodpecker/pull/3904)]
- Allow login using multiple forges [[#3822](https://github.com/woodpecker-ci/woodpecker/pull/3822)]
- Global and organization registries [[#1672](https://github.com/woodpecker-ci/woodpecker/pull/1672)]
- Cli get repo from git remote [[#3830](https://github.com/woodpecker-ci/woodpecker/pull/3830)]
- Add api for forges [[#3733](https://github.com/woodpecker-ci/woodpecker/pull/3733)]

### 📈 Enhancement

- Cli fix pipeline logs [[#3913](https://github.com/woodpecker-ci/woodpecker/pull/3913)]
- Migrate to github.com/urfave/cli/v3 [[#2951](https://github.com/woodpecker-ci/woodpecker/pull/2951)]
- Allow to change the working directory also for plugins and services [[#3914](https://github.com/woodpecker-ci/woodpecker/pull/3914)]
- Remove `unplugin-icons` [[#3809](https://github.com/woodpecker-ci/woodpecker/pull/3809)]
- Release windows binaries as zip file [[#3906](https://github.com/woodpecker-ci/woodpecker/pull/3906)]
- Convert to openapi 3.0 [[#3897](https://github.com/woodpecker-ci/woodpecker/pull/3897)]
- Enhance pipeline list [[#3898](https://github.com/woodpecker-ci/woodpecker/pull/3898)]
- Add user registries UI [[#3888](https://github.com/woodpecker-ci/woodpecker/pull/3888)]
- Sort users by login [[#3891](https://github.com/woodpecker-ci/woodpecker/pull/3891)]
- Exclude dummy backend in production [[#3877](https://github.com/woodpecker-ci/woodpecker/pull/3877)]
- Fix deploy task env [[#3878](https://github.com/woodpecker-ci/woodpecker/pull/3878)]
- Get default branch and show message in pipeline list [[#3867](https://github.com/woodpecker-ci/woodpecker/pull/3867)]
- Add timestamp for last work done by agent [[#3844](https://github.com/woodpecker-ci/woodpecker/pull/3844)]
- Adjust logger types [[#3859](https://github.com/woodpecker-ci/woodpecker/pull/3859)]
- Cleanup state reporting [[#3850](https://github.com/woodpecker-ci/woodpecker/pull/3850)]
- Unify DB tables/columns [[#3806](https://github.com/woodpecker-ci/woodpecker/pull/3806)]
- Let webhook pass on pipeline parsing error [[#3829](https://github.com/woodpecker-ci/woodpecker/pull/3829)]
- Exclude mocks from release build [[#3831](https://github.com/woodpecker-ci/woodpecker/pull/3831)]
- K8s secrets reference from step [[#3655](https://github.com/woodpecker-ci/woodpecker/pull/3655)]

### 🐛 Bug Fixes

- Handle empty repositories in gitea when listing PRs [[#3925](https://github.com/woodpecker-ci/woodpecker/pull/3925)]
- Update alpine package dep for docker images [[#3917](https://github.com/woodpecker-ci/woodpecker/pull/3917)]
- Don't report error if agent was terminated gracefully [[#3894](https://github.com/woodpecker-ci/woodpecker/pull/3894)]
- Let agents continuously report their health [[#3893](https://github.com/woodpecker-ci/woodpecker/pull/3893)]
- Ignore warnings for cli exec [[#3868](https://github.com/woodpecker-ci/woodpecker/pull/3868)]
- Correct favicon states [[#3832](https://github.com/woodpecker-ci/woodpecker/pull/3832)]
- Cleanup of the login flow and tests [[#3810](https://github.com/woodpecker-ci/woodpecker/pull/3810)]
- Fix newlines in logs [[#3808](https://github.com/woodpecker-ci/woodpecker/pull/3808)]
- Fix authentication error handling [[#3807](https://github.com/woodpecker-ci/woodpecker/pull/3807)]

### 📚 Documentation

- Streamline docs for new users [[#3803](https://github.com/woodpecker-ci/woodpecker/pull/3803)]
- Add mastodon verification [[#3843](https://github.com/woodpecker-ci/woodpecker/pull/3843)]
- chore(deps): update docs npm deps non-major [[#3837](https://github.com/woodpecker-ci/woodpecker/pull/3837)]
- fix(deps): update docs npm deps non-major [[#3824](https://github.com/woodpecker-ci/woodpecker/pull/3824)]
- Add openSUSE package [[#3800](https://github.com/woodpecker-ci/woodpecker/pull/3800)]
- chore(deps): update docs npm deps non-major [[#3798](https://github.com/woodpecker-ci/woodpecker/pull/3798)]
- Add "Docker Tags" Plugin [[#3796](https://github.com/woodpecker-ci/woodpecker/pull/3796)]
- chore(deps): update dependency marked to v13 [[#3792](https://github.com/woodpecker-ci/woodpecker/pull/3792)]
- chore: fix some comments [[#3788](https://github.com/woodpecker-ci/woodpecker/pull/3788)]

### Misc

- chore(deps): update web npm deps non-major [[#3930](https://github.com/woodpecker-ci/woodpecker/pull/3930)]
- chore(deps): update dependency vitest to v2 [[#3905](https://github.com/woodpecker-ci/woodpecker/pull/3905)]
- fix(deps): update module github.com/google/go-github/v62 to v63 [[#3910](https://github.com/woodpecker-ci/woodpecker/pull/3910)]
- chore(deps): update docker.io/woodpeckerci/plugin-docker-buildx docker tag to v4.1.0 [[#3908](https://github.com/woodpecker-ci/woodpecker/pull/3908)]
- Update plugin-git and add renovate trigger [[#3901](https://github.com/woodpecker-ci/woodpecker/pull/3901)]
- chore(deps): update docker.io/mstruebing/editorconfig-checker docker tag to v3.0.3 [[#3903](https://github.com/woodpecker-ci/woodpecker/pull/3903)]
- fix(deps): update golang-packages [[#3875](https://github.com/woodpecker-ci/woodpecker/pull/3875)]
- chore(deps): lock file maintenance [[#3876](https://github.com/woodpecker-ci/woodpecker/pull/3876)]
- [pre-commit.ci] pre-commit autoupdate [[#3862](https://github.com/woodpecker-ci/woodpecker/pull/3862)]
- Add dummy backend [[#3820](https://github.com/woodpecker-ci/woodpecker/pull/3820)]
- chore(deps): update dependency replace-in-file to v8 [[#3852](https://github.com/woodpecker-ci/woodpecker/pull/3852)]
- Update forgejo sdk [[#3840](https://github.com/woodpecker-ci/woodpecker/pull/3840)]
- chore(deps): lock file maintenance [[#3838](https://github.com/woodpecker-ci/woodpecker/pull/3838)]
- Allow to set dist dir using env var [[#3814](https://github.com/woodpecker-ci/woodpecker/pull/3814)]
- chore(deps): lock file maintenance [[#3805](https://github.com/woodpecker-ci/woodpecker/pull/3805)]
- chore(deps): update docker.io/lycheeverse/lychee docker tag to v0.15.1 [[#3797](https://github.com/woodpecker-ci/woodpecker/pull/3797)]
2024-07-18 23:24:31 +02:00
6543
31a45e5633
Add blocklist of environment variables who could alter execution of plugins (#3934) 2024-07-18 22:54:29 +02:00
6543
764329ed1d
Make sure plugins only mount the workspace base in a predefinde location (#3933) 2024-07-18 22:52:22 +02:00
renovate[bot]
d6e3ebf051
chore(deps): update web npm deps non-major (#3930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-07-18 12:31:28 -07:00
6543
da5b9c9257 Translated using Weblate (German)
Currently translated at 100.0% (329 of 329 strings)

Translation: Woodpecker CI/UI
Translate-URL: http://translate.woodpecker-ci.org/projects/woodpecker-ci/ui/de/
2024-07-18 19:20:29 +00:00
6543
925e099115
Remove unused override docs depencency (#3931) 2024-07-18 12:19:18 -07:00
qwerty287
16773855ed
Revert pipeline list UI change (#3926) 2024-07-18 20:53:33 +02:00
smainz
49c2029cad
Cli fix pipeline logs (#3913)
Co-authored-by: Thomas Anderson <127358482+zc-devs@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2024-07-18 20:39:18 +02:00
6543
7b7c83d040
remove undocumented networks option from steps (#3915)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-07-18 18:18:39 +02:00
6543
c81a6d67b1
Add docs for v2.7.0 (#3921) 2024-07-18 14:57:03 +02:00
Harri Avellan
1274de2b2d
Handle empty repositories in gitea when listing PRs (#3925) 2024-07-18 04:30:45 -07:00
6543
cd5f6f71a2
Migrate to github.com/urfave/cli/v3 (#2951) 2024-07-18 01:26:35 +02:00
6543
e39345688d
Allow to change the working directory also plugins and services (#3914) 2024-07-18 01:02:38 +02:00
qwerty287
059cb93d06
Remove unplugin-icons (#3809) 2024-07-17 08:13:56 -07:00
Anbraten
e234db1244
Streamline docs for new users (#3803) 2024-07-17 17:03:47 +02:00
6543
aa276403b3
Update alpine package dep for docker images (#3917) 2024-07-16 21:39:23 +02:00
Michael
575f83cbea Translated using Weblate (French)
Currently translated at 99.7% (336 of 337 strings)

Translation: Woodpecker CI/UI
Translate-URL: http://translate.woodpecker-ci.org/projects/woodpecker-ci/ui/fr/
2024-07-15 22:19:23 +00:00
qwerty287
4f06b62cf7 Translated using Weblate (German)
Currently translated at 100.0% (337 of 337 strings)

Translation: Woodpecker CI/UI
Translate-URL: http://translate.woodpecker-ci.org/projects/woodpecker-ci/ui/de/
2024-07-15 22:19:23 +00:00
renovate[bot]
3a528de56d
chore(deps): update dependency vitest to v2 (#3905)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-14 16:49:08 -07:00
6543
8aa3e5ec82
Disalow to set arbitrary environments for plugins (#3909) 2024-07-14 14:35:19 -07:00
6543
904d8da51a
Release windows binaries as zip file (#3906) 2024-07-14 22:59:45 +02:00
6543
008378fae9 Translated using Weblate (German)
Currently translated at 100.0% (337 of 337 strings)

Translation: Woodpecker CI/UI
Translate-URL: http://translate.woodpecker-ci.org/projects/woodpecker-ci/ui/de/
2024-07-14 11:58:58 +00:00
qwerty287
fa26a68dc9 Translated using Weblate (German)
Currently translated at 100.0% (337 of 337 strings)

Translation: Woodpecker CI/UI
Translate-URL: http://translate.woodpecker-ci.org/projects/woodpecker-ci/ui/de/
2024-07-14 11:58:58 +00:00
renovate[bot]
8aef8d2af9
fix(deps): update module github.com/google/go-github/v62 to v63 (#3910)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-14 07:58:35 +02:00
renovate[bot]
660368e1da
chore(deps): update docker.io/woodpeckerci/plugin-docker-buildx docker tag to v4.1.0 (#3908)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-13 17:37:56 -07:00
6543
757f5a58e2
Gracefully shutdown server (#3896) 2024-07-14 01:46:01 +02:00
6543
30cd800110
Gracefully shutdown agent (#3895) 2024-07-14 01:06:20 +02:00
Patrick Schratz
d1c0f781f1
Update plugin-git and add renovate trigger (#3901)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-07-13 13:43:13 -07:00
Anbraten
f61bff2fff
Convert urls in logs to links (#3904) 2024-07-13 12:34:35 -07:00
6543
1c0073f984
chore(deps): update docker.io/mstruebing/editorconfig-checker docker tag to v3.0.3 (#3903)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-13 20:02:14 +02:00
6543
8831a0e6fd increase test timeouts
as the agent do exec multible steps it could happen that because of resource constrains the tests take longer thaan on a normal dev pc
2024-07-13 16:55:01 +02:00
Anbraten
43b82ba047
Convert to openapi 3.0 (#3897)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2024-07-13 15:55:13 +02:00
Anbraten
cff393d644
Enhance pipeline list (#3898)
Co-authored-by: 6543 <6543@obermui.de>
2024-07-13 14:45:18 +02:00
6543
28cd815c42
Move setupEvilGlobals from server.go into setup.go (#3899) 2024-07-13 13:11:07 +02:00
Anbraten
b12d676546
Allow login using multiple forges (#3822) 2024-07-13 01:41:35 -07:00
Lauris BH
a26c7a475b
Add user registries UI (#3888) 2024-07-12 20:32:10 -07:00
6543
2d607a9ae4
agent dont report error if terminated gracefully (#3894) 2024-07-13 03:24:55 +02:00
6543
0575f36374
Let agents continuously report their health (#3893)
The agent should continue to report the health status as long as it got not terminated.

extracted from #2951

Right now there exist the case where you have ''shadow agents" who pull tasks even if they don't report healthy...
2024-07-12 23:43:24 +02:00
6543
bc02d376b2
Sort users by login (#3891) 2024-07-12 20:27:37 +02:00
6543
90f519caf3
Fix flake add sqlite (#3890)
Adds sqlite to the nix flake
2024-07-12 11:37:02 -05:00
Lauris BH
40b496f13b
Fix helper functions for MySQL syntax (#3874) 2024-07-12 18:18:55 +02:00
finga
388f14185c
docs: Fix spelling (#3887)
Co-authored-by: finga <finga@onders.org>
2024-07-12 14:57:30 +02:00