Commit graph

23 commits

Author SHA1 Message Date
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
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
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
Zav Shotan 7313de2b1d
Add support for superseding runs (#831)
closes #11

Added support:
1. Environment variable `WOODPECKER_DELETE_MULTIPLE_RUNS_ON_EVENTS` (Default pull_request, push)
2. Builds will be marked as killed when they "override" another build
2022-05-09 11:26:09 +02:00
6543 acbde30c3b
Lint code with gofumpt (#664) 2022-01-06 07:44:14 +01:00
6543 f4c73792f3
Calculate build number on creation (#615)
* Calculate build number on creation
* Delete repo.Counter (form code and database)
2021-12-18 20:37:51 +01:00
Anbraten fe6c999160
Let remove be a remove (#593)
* UI: let remove be a remove
* UI: add deactivate repo btn
* Store: DeleteRepo also delete related
* Store: more test coverage

Co-authored-by: 6543 <6543@obermui.de>
2021-12-11 16:03:14 +01:00
Lukas 680d003a29
Add linter revive (#554)
* Add linter revive

* Add underscore to variable name to prevent shadowing

* Remove unnecessary leading underscore

* Revert changes to vendor file

* export ConfigFetcher as interface

* no 'yoda conditions'

* rename envsubst

Co-authored-by: 6543 <6543@obermui.de>
2021-12-01 14:22:06 +01:00
6543 7931bc78eb
Let normal repo admins change timeout to lower values (#543)
fix #534
fix #179

Co-authored-by: Anbraten <anton@ju60.de>
2021-11-27 16:06:00 +01:00
6543 5e6b38e0e7
Server obtain remote from glob config not from context (#540) 2021-11-26 13:01:54 +01:00
6543 fe31fb1e06
Drop error only on purpose or else report back or log (#514)
- Remove Deadcode
- Simplify Code
- Drop error only on purpose
2021-11-23 15:36:52 +01:00
6543 51617e7f86
Rename struct field and add new types into server/model's (#523)
Resolve some todos in server/model:
 * Move persistent queue into its own package
 * Create Types: StatusValue, SCMKind, RepoVisibly
 * Rename struct Repo fields: SCMKind, IsSCMPrivate
2021-11-22 12:55:13 +01:00
6543 965235e421
Remove some wrapper and make code more redable (#478)
* meaningful var names
* no context wrapper, use store directly
* retrieve store from context once
* rm store.GetRepoOwnerName
2021-10-28 11:12:58 +02:00
Anbraten d35f5158bc
Add repo branches endpoint (#481)
* add repo branches endpoint

* add branches func to remotes
2021-10-27 02:47:55 +02:00
Anbraten 72aa979644
Add repo permission endpoint (#436) 2021-10-13 14:16:26 +02:00
John Olheiser 9c85c8fd68
Enable pull_request hook by default on repository activation (#420)
Closes #419

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2021-10-09 03:26:35 +02:00
6543 e3499f610d
Pass down context.Context (#371)
* pass context down to remote clients

* make tests work

* add ctx to Refresh() and use it

* bitbucketserver

* code format

* plugin interface: add todo context

* solve todo

* RM TODO by using context.WithTimeout

* refactor & fix

* Apply suggestions from code review

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

* go fmt

* Update server/remote/coding/coding.go

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

Co-authored-by: Anbraten <anton@ju60.de>
2021-09-28 12:56:59 +02:00
6543 a94807efeb
Refactor: move model/ to server/model/ (#366) 2021-09-27 19:51:55 +02:00
6543 0bd10fa507
Cleanup Code (#348)
* Fix "Empty slice declaration using a literal"
* Fix "collides with imported package name"
* Remove unused code in pipeline
* Remove unused oauth2.providerAuthHeaderWorks()
* Add TODOs
* Format Code
* Cleanup doublestar import
* Migrate deprecated functions

Co-authored-by: Anbraten <anton@ju60.de>
2021-09-24 16:29:26 +02:00
Jacob Floyd 780c902a6b
Refactor: move remote/ to server/remote/ (#344) 2021-09-23 18:25:51 +02:00
Jacob Floyd 5fe712cca6
Move package store/ to server/store/ (#341)
* Refactor: move store/ to server/store/

* fix pipeline for moved tests

Co-authored-by: 6543 <6543@obermui.de>
2021-09-23 13:33:59 +02:00
Jacob Floyd b8f55f31e2
Move router package to server/router/ (#339) 2021-09-22 22:41:32 +02:00
Jacob Floyd 35a45b7961
Reorganize code into server/{api,grpc,shared} packages (#337)
* move api code to server/api
* move grpc server for agent communication to server/grpc
* move server.Config to server/config.go as it is used by both server/api and server/grpc
* move shared code used by server/api and server/grpc to server/shared
2021-09-22 20:48:01 +02:00
Renamed from server/repo.go (Browse further)