Commit graph

956 commits

Author SHA1 Message Date
qwerty287
f91ee5d23a
Remove MSSQL specific code and cleanups (#1796)
We don't have MSSQL support

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-05-31 21:27:57 +02:00
6543
524611cf00
Add Forge Metadata (#1789)
close  #1787
2023-05-31 18:30:41 +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
f5a85d21be
Drop ".drone.yml" as default pipeline config (#1795)
it did make sense to have it still supported within v0.15.0,

but as we move future away and with the release of v1.0.0
we should not give the appearance of still support the original drone
v0.8 config
2023-05-31 16:02:20 +02:00
qwerty287
540ad108df
Fix static assets with subpath (#1783)
Closes #1773
2023-05-30 17:25:18 +02:00
qwerty287
3605979df0
Fix pipeline used for status reporting (#1758) 2023-05-14 16:12:48 +02:00
qwerty287
a15821428f
Always send a status back to forge (#1751) 2023-05-14 14:18:43 +02:00
qwerty287
2ccf7c6f1a
Drop Gogs support (#1752)
Gogs support is broken (and we won't fix it because we don't care about
it...) because it does not support OAuth, at least after we introduced
the new Vue UI.

See:

77d830d5b5/server/forge/gogs/gogs.go (L84)

This route is not present in the new UI.
2023-05-14 10:34:05 +02:00
meak
41a50ae915
Allow to configure port for SSL (#1735)
Co-authored-by: Mehdi Katranji <hello@mek.yt>
Co-authored-by: Lauris BH <lauris@nix.lv>
2023-05-11 06:11:10 +02:00
qwerty287
6d2240b2e6
Identify users using their remote ID (#1732) 2023-05-11 05:19:35 +02:00
6543
f3074ddaf9
Some small code refactorings (#1727)
Refactorings taken from pull requests #1722 and #1725
2023-04-30 17:02:47 +02:00
qwerty287
54d4ec04c0
Drop Gogs private mode (#1726)
You should use `WOODPECKER_AUTHENTICATE_PUBLIC_REPOS` instead if repos
sent from forge as public should be authenticated
2023-04-30 14:01:11 +02:00
qwerty287
0f9188597e
Initiate Pagination Implementation for API and Infinite Scroll in UI (#1651)
- Add pagination support to the API endpoints that return lists of items
- Adjust UI to enable infinite scrolling via pagination
2023-04-30 03:40:13 +02:00
qwerty287
b90e7904a5
Support path prefix (#1714)
closes #1636 
closes #1429
supersedes #1586

Uses a different approach: just take the index.html compiled by vite and
replace the paths to js and other files using regex. This is not
compatible with the dev proxy which is also the reason why we can't use
go templates for this.
2023-04-29 17:51:50 +02:00
qwerty287
cfdb32ae45
Fully support .yaml (#1713)
Follow-up to https://github.com/woodpecker-ci/woodpecker/pull/1388
Closes https://github.com/woodpecker-ci/woodpecker/issues/1073

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-04-29 10:12:36 +02:00
qwerty287
9b32d021b3
Consistent status on delete (#1703)
Closes #1675
2023-04-15 15:22:39 +02:00
qwerty287
a06d3e1a61
Stable sort order for DB lists (#1702) 2023-04-11 09:33:27 +02:00
Anbraten
36b5ae3459
Add env for workflow and step name (#1693)
closes #1681
2023-04-08 13:15:28 +02:00
Julien Palard
6af9371011
Docs: The WOODPECKER_ADMIN environment variable is singular. (#1699) 2023-04-08 01:34:36 +02:00
qwerty287
4b4d078377
Fix Bitbucket Server branches (#1698)
Closes #1695
2023-04-07 18:09:17 +02:00
qwerty287
0970f35df5
Do not store inactive repos (#1658)
Do not sync repos with forge if the repo is not necessary in DB.

In the DB, only repos that were active once or repos that are currently
active are stored. When trying to enable new repos, the repos list is
fetched from the forge instead and displayed directly. In addition to
this, the forge func `Perm` was removed and is now merged with `Repo`.

Solves a TODO on RepoBatch.

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-03-21 23:01:59 +01:00
Anbraten
f13ffc2c8f
Save agent-id for tasks and add endpoint to get agent tasks (#1631)
Save which agent is running a task. This is now visible in the admin UI
in the queue and in the agent details screen.

# changes
- [x] save id of agent executing a task
- [x] add endpoint to get tasks of an agent for #999 
- [x] show assigned agent-id in queue
- [x] (offtopic) use same colors for queue stats and icons (similar to
the ones used by pipelines)
- [x] (offtopic) use badges for queue labels & dependencies


![image](https://user-images.githubusercontent.com/6918444/226541271-23f3b7b2-7a08-45c2-a2e6-1c7fc31b6f1d.png)
2023-03-21 15:10:43 +02:00
Lauris BH
46452fbd84
Update Go dependencies and minimal Go version to 1.20 (#1650)
Signed-off-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
2023-03-21 00:48:15 +01:00
6543
e28b43ab19
Only inject netrc to trusted clone plugins (#1352)
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: 6543 <6543@obermui.de>
2023-03-20 21:17:49 +01:00
Anbraten
2337f1854a
Add queue details UI for admins (#1632)
# Changes
- Adds an admin view to see the whole work-queue of the server. 
- The admin can also pause / resume the queue. 
- The view is reloading data every 5 seconds automatically.
- The task model from queue got removed in favor of the one from models.
2023-03-20 04:50:56 +01: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
qwerty287
f582ad3159
Various enhancements in configuration (#1645)
- backends: move to cli flags instead of os.Getenv
- ssh: support 2fa with key and password
- allow to set grpc jwt secret (solves todo)
- allow to set default and max timeout (solves todo)

Closes https://github.com/woodpecker-ci/woodpecker/issues/896
Closes https://github.com/woodpecker-ci/woodpecker/issues/1131
2023-03-19 20:24:43 +01:00
6543
56e6639396
Refactor nits (#1652)
-
https://github.com/woodpecker-ci/woodpecker/pull/1641/files#r1141405630
-
ade8e6d010 (r105091268)
-
https://github.com/woodpecker-ci/woodpecker/pull/1647/files#r1141410010

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-03-19 18:32:19 +01:00
qwerty287
ade8e6d010
Various fixes and improvements (#1643)
- allow repo names to be case-insensitive
- improve backend error handling on DB get errors (record not found ->
404, else -> 500)
- replace magic numbers of http response codes
- unify the look and feel of cancel / save buttons on forms and view
them in one line

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
2023-03-19 13:52:58 +01:00
qwerty287
42a115e19e
Add PR pipeline list (#1641)
Instead of viewing PR pipelines in the branches lists, add a separate
list for them. The API endpoint for PRs supports pagination (thus I
added a lot of pagination-related stuff), the UI doesn't yet though.


![wp](https://user-images.githubusercontent.com/80460567/226099133-bb4935d6-c357-4d73-8465-9157e25c0d82.png)

Closes #1619 

Extends this part of #1640

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-03-19 10:43:57 +01:00
qwerty287
37dc8a46e0
Drop coding support (#1644)
Coding support is likely broken and nobody will ever fix it. Also it
looks like nobody wants to use it, otherwise we would have get some bug
reports.

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-03-19 09:36:04 +01:00
Anbraten
277a839157
Add users UI for admins (#1634)
Co-authored-by: Lauris BH <lauris@nix.lv>
2023-03-18 21:21:20 +01:00
Anbraten
fa5b0fb96e
Fix linter (#1647) 2023-03-18 20:35:27 +01:00
Lukas
1b43b0bf20
Add pull request labels as environment variable (#1321)
Closes #1308 

Co-authored-by: Anbraten <anton@ju60.de>
2023-03-17 03:43:04 +01:00
6543
7e3bf2202c
Return 404 if pipeline not exist and handle 404 errors in WebUI (#1627) 2023-03-17 02:10:51 +01:00
Hayden
c60c59bd65
fix: apply permissions when flatPermissions enabled (#1603)
Closes #1582 

When `WOODPECKER_FLAT_PERMISSIONS=true` workaround is applied all
permissions are set to false (default) and query never returns any
matches.

This fixes it by always assigning Pull/Push/Admin to true when flatPermissions is enabled.
2023-03-14 03:42:11 +01:00
Lukasz
dc90f97524
Persist DepStatus of tasks (#1610) 2023-03-11 01:58:28 +01:00
Hayden
a2f226f7f9
fix: return 404 on badge request for inactive repo (#1600)
closes #1427 with suggested edit.
2023-03-04 11:36:13 +01:00
6543
18d3139e9e
Use modern error handling and enforce it via lint (#1327)
Co-authored-by: Anbraten <anton@ju60.de>
2023-02-02 00:08:02 +01:00
Earl Warren
7835a632e4
Define WOODPECKER_FORGE_TIMEOUT server config (#1558)
When a server such as Codeberg has unusually high response time, three
seconds may not be enough to fetch the configuration.

Signed-off-by: Earl Warren <contact@earl-warren.org>
Co-authored-by: 6543 <6543@obermui.de>
2023-02-01 18:53:19 +01:00
Anbraten
71d6c03ca7
Add agent no-schedule flag (#1567)
This flag allows an agent owner / admin to stop the agent from taking
new workflows / pipelines.
2023-01-30 20:18:48 +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
c276bc8937
use same sql for set default statement on mysql/mariadb and postgres (#1540)
introduced by #1027 so it does not need a changelog or backport
2023-01-14 12:52:41 +02:00
antomy-gc
6516a28cdd
Secrets encryption in database (#1475)
closes #101

Added secrets encryption in database

- Google TINK or simple AES as encryption mechanisms
- Keys rotation support on TINK
- Existing SecretService is wrapped by encryption layer
- Encryption can be enabled and disabled at any time

Co-authored-by: Kuzmin Ilya <ilia.kuzmin@indrive.com>
Co-authored-by: 6543 <6543@obermui.de>
2023-01-12 20:59:07 +01:00
6543
af2c278723
Dont panic on hook parsing (#1501)
close #1422
2022-12-25 22:50:57 +02:00
6543
fc4af44b43
router: create apiBase (#1442)
- refactor to dedup string `api`
- bump golang.org/x/next
2022-12-21 16:16:36 +01:00
Anbraten
a3f4f3056c
disable metrics access if no token is set (#1469) 2022-12-09 18:03:43 +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
47faff3eff
Refresh token before executing a cron pipeline (#1432)
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Anbraten <anton@ju60.de>
2022-11-19 21:47:47 +01:00
Joaquin
482678daf5
Fix pipeline feed not updated by new events (#1424)
Co-authored-by: Anbraten <anton@ju60.de>
2022-11-18 10:59:24 +01:00
Anbraten
de8ea95dd3
Rename forge-id to forge-remote-id (#1418) 2022-11-15 15:01:23 +01:00
Josh Soref
12cbe15de0
Fix spelling: gitlab (#1411)
This is most of the GitLab changes that I dropped from #1405. 

As before, I'm happy to adjust things...

<details><summary>Problematic Changes</summary>

Fwiw, this is the part that causes the tests to break (I don't
understand why, but I'm leaving this change out):

```patch
commit 703cbe3ed398bf32535120ead733b80aa145c8db
Author: Josh Soref <2119212+jsoref@users.noreply.github.com>
Date:   Tue Nov 8 17:09:06 2022 -0500

    event?! -- this seems broken

diff --git a/server/forge/gitlab/testdata/hooks.go b/server/forge/gitlab/testdata/hooks.go
index 7d39306..e394afc 100644
--- a/server/forge/gitlab/testdata/hooks.go
+++ b/server/forge/gitlab/testdata/hooks.go
@@ -27,7 +27,7 @@ var (
 	ServiceHookHeaders = http.Header{
 		"Content-Type":   []string{"application/json"},
 		"User-Agent":     []string{"GitLab/14.3.0"},
-		"X-Gitlab-Event": []string{"Service Hook"},
+		"X-GitLab-Event": []string{"Service Hook"},
 	}
 )
 
diff --git a/shared/token/token.go b/shared/token/token.go
index 3f15537..191e5ee 100644
--- a/shared/token/token.go
+++ b/shared/token/token.go
@@ -64,7 +64,7 @@ func ParseRequest(r *http.Request, fn SecretFunc) (*Token, error) {
 		return parse(bearer, fn)
 	}
 
-	token = r.Header.Get("X-Gitlab-Token")
+	token = r.Header.Get("X-GitLab-Token")
 	if len(token) != 0 {
 		return parse(token, fn)
 	}

```
</details>

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2022-11-09 17:16:17 +01:00
Josh Soref
023d03dd61
Spelling (#1405)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-11-09 08:12:17 +01:00
6543
18311d4360
Split and refactor (#1394)
Closes #974
2022-11-06 12:44:04 +01:00
qwerty287
3372d1a87c
Rename remote to forge (#1357)
As of #745

Co-authored-by: Anbraten <anton@ju60.de>
2022-11-05 00:35:06 +01:00
Michael
2477d2e57f
Support .yaml as file-ending for workflow config too (#1388)
This implements #1073, adds .yaml to the accepted endings for woodpecker configs.

This currently adds some more lines to the duplication (tried to compensate by fixing the other duplication in the configFetcher) as the CLI and Server are still separate.
2022-11-03 19:12:40 +01:00
Joonhyeok Ahn (Joon)
aed3a80287
Migrate sql querys to xorm query builder (#1356)
Co-authored-by: 6543 <6543@obermui.de>
2022-10-31 16:08:57 +01:00
Divya Jain
280d27d723
Fix pipeline cancel API endpoint and update Web and CLI clients (#1372)
Fixes #1369 

Co-authored-by: Anbraten <anton@ju60.de>
2022-10-30 14:39:01 +01:00
qwerty287
8f183c82a8
Support changed files for Gitea PRs (#1342)
- add tests to fetch changed files
- ignore error if gitea version is to low
- adjust docs accordingly

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
2022-10-28 19:17:30 +02: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
e568c42e84
Support plugin-only secrets (#1344)
Closes #1071
2022-10-27 04:21:07 +02:00
qwerty287
de4e62cfcf
Allow to run cron manually (#1338)
Closes #1154
2022-10-26 01:23:28 +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
Joonhyeok Ahn (Joon)
186aee61cf
Check if repo exists before creating pipeline (#1297)
Close #1257

make sure the repo exists first before triggering the pipeline
2022-10-22 01:34:11 +02:00
6543
0bad73860f
Remove old build api routes (#1283) 2022-10-18 07:51:12 +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
Avinil Bedarkar
493ec45be6
Return return 404 if registry to delete do not exist (#1278)
Closes #524

Co-authored-by: 6543 <6543@obermui.de>
2022-10-18 01:48:04 +02:00
Avinil Bedarkar
11f37f4649
Converting all inputs which are coming as secret to lowercase (#1276)
Closes #926

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2022-10-16 14:58:13 +02:00
Lauris BH
86bc8b46ed
Change build message column type to text (#1252)
Fixes #1115
Fixes #1194
2022-10-13 00:47:11 +02:00
Lukas
12ff74c4cb
Fix branch loading (#1249)
Fixes a panic I got while viewing the branches in the UI.

```
runtime error: index out of range [0] with length 0
/home/gitpod/go/src/runtime/panic.go:113 (0x44053e)
        goPanicIndex: panic(boundsError{x: int64(x), signed: true, y: y, code: boundsIndex})
/workspace/woodpecker/server/remote/gitea/gitea.go:444 (0xd36764)
        (*Gitea).Branches.func1: result[i] = branches[i].Name
/workspace/woodpecker/server/remote/common/utils.go:34 (0xd3942a)
        Paginate[...]: batch, err := get(page)
/workspace/woodpecker/server/remote/gitea/gitea.go:439 (0xd36665)
        (*Gitea).Branches: branches, err := common.Paginate(func(page int) ([]string, error) {
/workspace/woodpecker/server/api/repo.go:202 (0xc823a1)
        GetRepoBranches: branches, err := r.Branches(c, user, repo)
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xc71d44)
        (*Context).Next: c.handlers[c.index](c)
/workspace/woodpecker/server/router/middleware/session/repo.go:148 (0xc71bba)
        MustPull: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xc71aee)
        (*Context).Next: c.handlers[c.index](c)
/workspace/woodpecker/server/router/middleware/session/repo.go:139 (0xc71aaa)
        SetPerm.func1: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xc71251)
        (*Context).Next: c.handlers[c.index](c)
/workspace/woodpecker/server/router/middleware/session/repo.go:53 (0xc710ec)
        SetRepo.func1: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xccb50f)
        (*Context).Next: c.handlers[c.index](c)
/workspace/woodpecker/server/router/middleware/token/token.go:50 (0xccb248)
        Refresh: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xc721fc)
        (*Context).Next: c.handlers[c.index](c)
/workspace/woodpecker/server/router/middleware/session/user.go:72 (0xc721e3)
        SetUser.func1: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xcd069e)
        (*Context).Next: c.handlers[c.index](c)
/workspace/woodpecker/server/router/middleware/store.go:29 (0xcd0685)
        Store.func1: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xccff47)
        (*Context).Next: c.handlers[c.index](c)
/workspace/woodpecker/server/router/middleware/logger.go:23 (0xccff2a)
        Logger.func1: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xccaf99)
        (*Context).Next: c.handlers[c.index](c)
/workspace/woodpecker/server/router/middleware/header/header.go:38 (0xccaec4)
        Options: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xccae21)
        (*Context).Next: c.handlers[c.index](c)
/workspace/woodpecker/server/router/middleware/header/header.go:30 (0xccae06)
        NoCache: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xccf32a)
        (*Context).Next: c.handlers[c.index](c)
/workspace/woodpecker/server/router/router.go:39 (0xccf310)
        Load.func1: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xa2e0c1)
        (*Context).Next: c.handlers[c.index](c)
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/recovery.go:101 (0xa2e0ac)
        CustomRecoveryWithWriter.func1: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 (0xa2cf30)
        (*Context).Next: c.handlers[c.index](c)
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616 (0xa2cb98)
        (*Engine).handleHTTPRequest: c.Next()
/workspace/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572 (0xa2c6dc)
        (*Engine).ServeHTTP: engine.handleHTTPRequest(c)
/home/gitpod/go/src/net/http/server.go:2947 (0x79cc4b)
        serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/home/gitpod/go/src/net/http/server.go:1991 (0x797e66)
        (*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/home/gitpod/go/src/runtime/asm_amd64.s:1594 (0x476d80)
        goexit: BYTE    $0x90   // NOP
```

Co-authored-by: Anbraten <anton@ju60.de>
2022-10-09 21:10:36 +02:00
6543
c7fd1eb9d4
Introduce and use Pagination helper func (#1236) 2022-10-08 18:25:32 +02:00
[X]
3130a1c523
Fetch all branches from gitea (#1231)
Both repo branch view and manual branch selector were limited to the
stock pageSize of gitea client.

this add a loop to fetch all branches from gitea
2022-10-06 19:52:12 +02:00
Anbraten
287800ac62
Add when evaluate filter (#1213)
closes #312 
closes #224
closes #963

Have a look for

https://github.com/antonmedv/expr/blob/master/docs/Language-Definition.md
2022-10-06 01:49:23 +02:00
Anbraten
f1339412eb
Fix invalid service names for Kubernetes (#1234)
closes #1232
2022-10-05 13:39:48 +02:00
6543
612eee8269
Sort secret lists and events (#1223)
close  #1176
2022-09-29 22:46:20 +02:00
6543
5d7fdbc71c
fix: create secret for manual build (#1222) 2022-09-29 07:30:05 +02:00
qwerty287
7838f84b69
Fix SCM visibility if user visibility is private (#1217)
Closes https://codeberg.org/Codeberg-CI/feedback/issues/74
2022-09-27 21:24:33 +02:00
[X]
b4d89a1cce
Add ability to trigger manual builds (#1156)
closes #83 
closes #240 

Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2022-09-27 11:05:00 +02:00
Zav Shotan
ec9b0a62a7
Add support for pipeline root.when conditions (#770)
Co-authored-by: Zav Shotan <zshotan@bloomberg.net>
Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: 6543 <6543@obermui.de>
2022-09-26 09:27:20 +02:00
Martin Herren
1d47da647b
[Bitbucket] Use workspaces instead of deprecated/removed teams path (#1166)
Crude fix to allow to correctly list workspaces for bitbucket cloud
(https://bitbucket.org) and so run a pipeline.
Last year they removed a bunch of deprecated APIs and replaced them with
new ones.

Signed-off-by: Martin Herren <martin.herren@gmail.com>
Co-authored-by: Martin Herren <martin.herren@ecorobotix.com>
Co-authored-by: 6543 <6543@obermui.de>
2022-09-18 09:26:13 +02:00
qwerty287
6433dfea23
Use package's structs and fix missing clone (#1172)
Closes #1169

Replaces structs that were added inline in hook structs with structs of
the corresponding SDKs. This makes it more readable and error-proof.
2022-09-07 18:16:40 +01:00
想出网名啦
eaf05dbae8
On Repo update, keep old "Clone" if update would empty it (#1170)
fixed #1169 

after debugging, I found that:
if `Clone` in database is empty, before
https://github.com/woodpecker-ci/woodpecker/blob/master/server/api/hook.go#L128,
the `repo.Clone` be always unset, so clone is failed.

This PR makes the empty `Clone` can't overwrite the value in database.
2022-09-07 17:34:08 +01:00
qwerty287
52d3652f2e
Fetch repositories with remote ID if possible (#1078)
Use IDs of the forge to fetch repositories instead of their names and owner names. This improves handling of renamed and transferred repos.

TODO

- [ ] try to support as many forges as possible
    - [x] Gogs (no API)
    - [ ] Bitbucket Server
    - [x] Coding (no API?)
- [x] update repo every time it is fetched or received from the forge
- [x] if repo remote IDs are not available, use owner / name to get it
- [x] handle redirections (redirect a renamed repo to its new path)
- [x] ~~pull all repos once during migration to update ID (?)~~ issue fixed by on-demand loading of remote IDs
- [x] handle redirections in web UI
- [ ] improve handling of hooks after a repo was renamed (currently it checks for a redirection to the repo)
- [x] tests
- [x] `UNIQUE` constraint for remote IDs after migration shouldn't work (all repos have an empty string as remote ID)

close #854
close #648 partial
close https://codeberg.org/Codeberg-CI/feedback/issues/46

Possible follow-up PRs
- apply the same scheme on everything fetched from the remote (currently only users)

Co-authored-by: 6543 <6543@obermui.de>
2022-09-05 17:08:51 +02:00
Anbraten
d8f598c2ad
Only enable debug endpoints if log level is debug or below (#1160) 2022-09-03 20:48:53 +02:00
Anbraten
5ca7ede9e4
Improve logging (#1158)
* switch default log level to info add start message and cleanup server start
* refactor code
* fix agent debug / trace logging
2022-09-03 20:41:23 +02:00
Anbraten
7db7e97f3f
fix (auto) cancel of blocked pipelines (#1157) 2022-09-02 22:14:38 +02:00
6543
4afddc2821
Extract commit message from branch creation (#1150)
if commit already exist

close https://codeberg.org/Codeberg-CI/feedback/issues/52
2022-09-02 16:41:51 +02:00
6543
3f2af06bbc
Respect WOODPECKER_GITEA_SKIP_VERIFY (#1152) 2022-09-01 22:48:33 +02:00
6543
18c1807f4f
Create mock for store and add unit tests for cron (#1146)
* pass remote on init as argument like store

* mock store

* TestCreateBuild
2022-09-01 01:19:49 +02:00
6543
383f273392
Add cron feature (#934)
https://woodpecker-ci.org/docs/usage/cron

Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2022-09-01 00:36:32 +02:00
6543
08a99152d6
Dedup code and migrate away from deprecated funcs (#1141)
Co-authored-by: Anbraten <anton@ju60.de>
2022-08-30 01:14:07 +02:00
6543
ca84f703e3
Add default event filter (#1140)
breakout from #934

when new events are added you don't have to worry that pipeline will behave different as it does now with this

Co-authored-by: Anbraten <anton@ju60.de>
2022-08-30 00:36:37 +02:00
6543
ae771a9931
Fix migration number (#1134) 2022-08-27 23:58:52 +02:00
6543
f15b27aadf
Remove own copy of oauth2 implementation (#1127)
at some point (~7years ago) the oauth2 implementation was copied into the code-base and never touched.
We only use it for gitlab the rest is already back using std.

This migrates to the std oauth2 implementation
2022-08-26 21:42:41 +02:00
6543
f21d854114
Move away from deprecated go funcs (#1123) 2022-08-25 08:39:19 +02:00
6543
a4453dc5af
Implement Refresher for GitLab and refactor nits (#1031)
* refactor & update gitea remote

* refactor & update gitlab remote

* gitlab remote: add Refresh()

* change as suggested by @dsanader
2022-08-24 15:46:11 +02:00
Lauris BH
5a945c10e9
Fix to show build pipeline parse error (#1066) 2022-08-15 14:37:46 +02:00
Lauris BH
1ac2c42652
Add global and organization secrets (#1027)
* Implement database changes and store methods for global and organization secrets

* Add tests for new store methods
* Add organization secret API and UI
* Add global secrets API and UI

* Add suggestions

* Update warning style

* Apply suggestions from code review

Co-authored-by: Anbraten <anton@ju60.de>

* Fix lint warning

Co-authored-by: Anbraten <anton@ju60.de>
2022-08-14 13:48:53 +02:00
qwerty287
bed3ef104c
Support Docker credential helpers (#1075)
* support docker credential and add docker-credential-ecr-login into alpine image

* Remove ecr from docker and add docs

* Update docs/docs/30-administration/22-backends/10-docker.md

Co-authored-by: WeStone <xuecanlong@qq.com>
Co-authored-by: Anbraten <anton@ju60.de>
2022-08-14 10:46:18 +02:00
Dejan SANADER
7a4827bbf6
Fix duplicate pipeline status in GitLab (#1095) 2022-08-12 17:49:40 +02:00