Commit Graph

1221 Commits

Author SHA1 Message Date
Patrick Schratz
d9653dd2af [release/v2.8] Don't fail user creation if org exists (#4687) (#4692) 2025-01-11 08:15:50 +02:00
Patrick Schratz
17fc49187f [release/v2.8] Improve error on config loading (#4024) (#4698)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2025-01-11 08:10:36 +02:00
Patrick Schratz
8f46d0d85a [release/v2.8] Fix addon nil values (#4666) (#4693)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2025-01-10 18:48:32 +01:00
qwerty287
d76144ef42 Fix avatar column type (#4340) (#4602) 2024-12-21 11:59:24 +01:00
Robert Kaussow
5c589a7aac Do not log forge tokens (#4551) (#4590) 2024-12-19 21:18:14 +01:00
Joan Flotats
36e5b9514b Add Bitbucket fixes to Release/2.8 (#4547)
Co-authored-by: Joan Flotats <joanflotats@bit2me.com>
2024-12-10 15:21:37 +02:00
John Olheiser
21d9c6cece fix: addon JSON pointers (#4508) (#4512)
Signed-off-by: jolheiser <git@jolheiser.com>
2024-12-05 17:24:18 +01:00
6543
50a3749b60 Enforce exact matching for GitLab groups (#4473) (#4474)
Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
2024-11-28 19:49:00 +01:00
Anbraten
cc3f0412f2 Extend approval options (#3348) (#4429)
Co-authored-by: 6543 <6543@obermui.de>
2024-11-25 21:31:13 +01:00
6543
cbe74ec72f Process workflow logs in batches (#4045) (#4356)
Co-authored-by: hg <k@isakov.net>
2024-11-13 15:42:45 +01:00
6543
b68b038adf address review lint issues (#4354) (#4357) 2024-11-11 19:38:17 +01:00
6543
b89d4f059c Add migration to autofix corrupted users.org_id entrys in db (#4307) (#4327) 2024-11-06 15:30:18 +01:00
6543
3a1c3e72e4 Don't parse forge config files multiple times if no error occured (#4272) (#4273)
Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
2024-10-29 07:34:32 +02:00
6543
c427886d3c fix: repo/owner parsing for gitlab (#4255) (#4261)
Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
2024-10-27 10:50:09 +01:00
6543
10d8a13272 Run queue.process() in background (#4115) 2024-09-20 14:13:46 +02:00
6543
4576aef483 Fix agent last work update throttling (#4124) (#4126)
Co-authored-by: Lukas <lukas@slucky.de>
2024-09-18 23:28:22 +02:00
6543
6f5e0697d0 Only update agent.LastWork if not done recently (#4031) (#4100)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-09-10 15:53:16 +03:00
6543
9b18a90a59 [Backport] Lint privileged plugin match and allow to be set empty (#4084) 2024-09-05 20:30:03 +03: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
6543
764329ed1d Make sure plugins only mount the workspace base in a predefinde location (#3933) 2024-07-18 22:52:22 +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
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
6543
757f5a58e2 Gracefully shutdown server (#3896) 2024-07-14 01:46: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
b12d676546 Allow login using multiple forges (#3822) 2024-07-13 01:41:35 -07:00
6543
bc02d376b2 Sort users by login (#3891) 2024-07-12 20:27:37 +02:00
Lauris BH
40b496f13b Fix helper functions for MySQL syntax (#3874) 2024-07-12 18:18:55 +02:00
Anbraten
ceb14cadc5 Fix deploy task env (#3878) 2024-07-07 13:43:07 +02:00
Anbraten
b23fdaa6dc Fix registry migration (#3871) 2024-07-04 01:29:56 -07:00
Lauris BH
28e982fffb Global and organization registries (#1672)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-07-03 06:33:11 -07:00
Anbraten
918985c508 Add timestamp for last work done by agent (#3844) 2024-07-01 10:34:47 -07:00
Anbraten
2fa9432ef8 Cleanup state reporting (#3850) 2024-07-01 11:20:55 +02:00
Anbraten
2bda19024e Use proper oauth state (#3847) 2024-06-27 16:52:09 +02:00
qwerty287
92cd0d04a3 Unify DB tables/columns (#3806)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-06-27 09:32:06 +02:00
Anbraten
b8b6efb352 Enhance token checking (#3842) 2024-06-27 00:08:59 +02:00
6543
4dcdebd786 Let webhook pass on pipeline parsion error (#3829) 2024-06-26 15:07:19 +02:00
6543
402938e216 Exclude mocks from release build (#3831) 2024-06-25 12:23:07 +02:00
Anbraten
b0f3883bd5 Cleanup of the login flow and tests (#3810) 2024-06-21 16:25:27 +02:00
Anbraten
1a39d57f71 Enhance authentication UX (#3807) 2024-06-21 09:55:30 +02:00
Anbraten
fbb96ff8f5 Add api for forges (#3733) 2024-06-20 13:08:54 +02:00
qwerty287
760a903a30 Add release event to webhooks (#3784) 2024-06-13 19:04:15 +02:00
Anbraten
8b387e73ee Improve step logging (#3722) 2024-06-13 17:18:32 +02:00
Anbraten
1953a0ec5a Fix repo creation (#3756) 2024-06-10 12:28:54 +02:00
qwerty287
c72468478d Allow to store logs in files (#3568)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-06-06 14:34:57 +02:00
qwerty287
d28e150534 Use http constants (#3766) 2024-06-06 11:16:45 +02:00