Commit Graph
186 Commits
Author SHA1 Message Date
Levy-Talandtal 0ecd57d2df BitbucketDC: optimize repository search (#4919)
Co-authored-by: tal <tal@localhost>
2025-03-03 16:54:34 +02:00
qwerty287 434670ddbd Include forge type in netrc (#4908) 2025-02-28 15:07:30 +02:00
Jener Rasmussen 3f1fc7f4bd Fix nil dereference in Bitbucket webhook handling (#4896) 2025-02-24 18:04:49 +02:00
63393ed05f fix(deps): update module codeberg.org/mvdkleijn/forgejo-sdk/forgejo to v2 (#4858)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2025-02-22 12:59:05 +02:00
qwerty287 4ec9d4e285 Directly fetch directory contents (#4842) 2025-02-15 20:40:35 +01:00
renovate[bot]andlnx01 b78427e8b5 fix(deps): update module github.com/google/go-github/v68 to v69 (#4826)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-08 08:30:52 +02:00
Levy-Talandtal 983dfd1157 Add Git Ref To Build Status in BitbucketDatacenter (#4724)
Co-authored-by: tal <tal@localhost>
2025-01-23 15:11:09 +02:00
qwerty287 8779086224 Check organization first (#4723) 2025-01-13 15:54:05 +02:00
Levy-Talandtal d022bf229a feat(bitbucketdatacenter): Add support for fetching and converting projects to teams (#4663)
Co-authored-by: tal <tal@localhost>
2025-01-08 00:44:31 +01:00
qwerty287 ba68b446c0 Fix addon nil values (#4666) 2025-01-05 13:45:53 +02:00
afa6dee30b Migrate away from goblin (#4624)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-12-30 08:08:53 +02:00
828298bcf3 fix(deps): update module github.com/google/go-github/v67 to v68 (#4635)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-12-28 09:28:01 +01:00
qwerty287andPatrick Schratz fdfabe6368 Support Git as only VCS (#4346)
Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
2024-12-27 22:49:19 +01:00
qwerty287andRobert Kaussow 81b74025d4 Update Go imports paths (#4605)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-12-22 10:44:34 +01:00
8788794748 Do not log forge tokens (#4551)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2024-12-18 15:13:01 +01:00
Robert Kaussow 7fa474c5c3 Ignore blocked pipelines for badge rendering (#4582) 2024-12-18 08:58:08 +01:00
591f256d1e fix(deps): update golang-packages (#4553)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
2024-12-12 16:40:36 +01:00
Joan FlotatsandJoan Flotats 21755bef4e Fix BB ambiguous commit status key (#4544)
Co-authored-by: Joan Flotats <joanflotats@bit2me.com>
2024-12-09 17:23:46 +02:00
John Olheiser 9f0611d1a1 fix: addon JSON pointers (#4508)
Signed-off-by: jolheiser <git@jolheiser.com>
2024-12-03 20:58:42 +02:00
renovate[bot]andlnx01 6c641ae28d fix(deps): update module github.com/google/go-github/v66 to v67 (#4487)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-30 08:56:17 +02:00
Robert Kaussow 359e3af817 Add option to limit the resultset returned by paginate helper (#4475) 2024-11-29 10:39:01 +01:00
Patrick Schratz 6327dcd36f Enforce exact matching for GitLab groups (#4473) 2024-11-28 15:32:21 +01:00
Anbraten 53d6421940 Support github refresh tokens (#3811) 2024-11-22 19:12:43 +01:00
Anbraten 5e2fa8164b Extend approval options (#3348) 2024-11-18 14:49:12 +01:00
6543 4270eca597 gitea: add check if pull_request webhook is missing pull info (#4305) 2024-11-05 14:51:12 +01:00
Patrick Schratz 9a7623359e Delete GitLab webhooks with partial URL match (#4259) 2024-10-27 23:28:19 +01:00
Patrick Schratzand6543 d37c138738 fix: repo/owner parsing for gitlab (#4255)
Co-authored-by: 6543 <6543@obermui.de>
2024-10-26 23:20:15 +02:00
renovate[bot]andlnx01 254310556a fix(deps): update module github.com/google/go-github/v65 to v66 (#4205)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-07 07:56:59 +03:00
renovate[bot]andlnx01 bc74af507e fix(deps): update module github.com/google/go-github/v64 to v65 (#4185)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-05 15:46:36 +03:00
renovate[bot]andlnx01 8e0af15e85 fix(deps): update module github.com/google/go-github/v63 to v64 (#4073)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 17:41:02 +02:00
qwerty287 eeec084293 Set refspec for gitlab MR (#4021) 2024-08-10 21:43:50 +03:00
Jener Rasmussen f20327eb03 [Bitbucket Datacenter] Return empty list instead of null (#4010) 2024-08-06 18:31:50 +02:00
Patrick Schratz 106b6e01c0 Overhaul README (#3995) 2024-08-05 01:27:25 +02:00
Joan Flotats 2d6e1ea015 Fix BB PR pipeline ref (#3985) 2024-08-02 21:42:04 +02:00
Joan Flotats ec02379b04 Use Bitbucket PR title for pipeline message (#3984) 2024-07-30 20:37:33 +02:00
Joan Flotats 047eb19d42 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: https://github.com/woodpecker-ci/plugin-git/blob/7ac9615f409b539486b8841bd5ef01ae16bbc434/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:58:38 +02:00
Joan Flotatsandqwerty287 3a4ffe951e 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:17:58 +02:00
Harri Avellan 1274de2b2d Handle empty repositories in gitea when listing PRs (#3925) 2024-07-18 04:30:45 -07:00
renovate[bot]andlnx01 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
Anbraten ceb14cadc5 Fix deploy task env (#3878) 2024-07-07 13:43:07 +02:00
6543 402938e216 Exclude mocks from release build (#3831) 2024-06-25 12:23:07 +02:00
Anbraten 1a39d57f71 Enhance authentication UX (#3807) 2024-06-21 09:55:30 +02:00
qwerty287 760a903a30 Add release event to webhooks (#3784) 2024-06-13 19:04:15 +02:00
qwerty287 d28e150534 Use http constants (#3766) 2024-06-06 11:16:45 +02:00
4ec046e415 Spellcheck "server/*" (#3753)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-06-04 08:30:54 +02:00
91b122e1ce Native forgejo support (#3684)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2024-06-01 11:23:19 +02:00
renovate[bot]andlnx01 bf4061b72d fix(deps): update module github.com/google/go-github/v61 to v62 (#3730)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-26 18:18:34 +02:00
37ea906958 fix(deps): update golang-packages (#3713)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
2024-05-23 17:37:21 +02:00
5527d9bf86 Cleanup server env settings (#3670)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2024-05-15 15:45:08 +02:00
Robert Kaussow 89e100cfd1 Add godot linter to harmonitze toplevel comments (#3650) 2024-05-13 22:58:21 +02:00