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#854close#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>
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>
Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables.
- `CI_*` prefix replaces `DRONE_*`
- `CI` value is now `woodpecker`
- `DRONE=true` has been removed
Rewrite of the UI using Typescript, Vue3, Windicss and Vite. The design should be close to the current one with some changes:
- latest pipeline in a sidebar on the right
- secrets and registry as part of the repo-settings (secrets and registry entries shouldn't be used as much so they can be "hidden" under settings IMO)
- start page shows list of active repositories with button to enable / add new ones (currently you see all repositories and in most cases you only add new repositories once in a while)
- move cli files from `cli/drone` to `cli/`
- move cli main to `cmd/cli/main.go` to match agent and server
- use version from `version/version.go` to match agent and server
Before cold and hot runs are the same:
```
$ rm -rf $GOPATH/pkg
```
```
$ time make
go generate github.com/drone/drone/server/template
go generate github.com/drone/drone/store/datastore/ddl
go build --ldflags '-X github.com/drone/drone/version.VersionDev=' -o release/drone github.com/drone/drone/drone
real 0m43.638s
user 0m48.990s
sys 0m5.480s
```
```
$ time make
go generate github.com/drone/drone/server/template
go generate github.com/drone/drone/store/datastore/ddl
go build --ldflags '-X github.com/drone/drone/version.VersionDev=' -o release/drone github.com/drone/drone/drone
real 0m46.950s
user 0m49.506s
sys 0m6.086s
```
After hot builds are much faster:
```
$ rm -rf $GOPATH/pkg
```
```
$ rm -rf $GOPATH/pkg && time make
go generate github.com/drone/drone/server/template
go generate github.com/drone/drone/store/datastore/ddl
go install -ldflags '-X github.com/drone/drone/version.VersionDev=' github.com/drone/drone/drone
cp /Users/bobrik/projects/drone/bin/drone release/drone
real 0m44.735s
user 0m51.049s
sys 0m4.517s
```
```
$ time make
go generate github.com/drone/drone/server/template
go generate github.com/drone/drone/store/datastore/ddl
go install -ldflags '-X github.com/drone/drone/version.VersionDev=' github.com/drone/drone/drone
cp /Users/bobrik/projects/drone/bin/drone release/drone
real 0m3.364s
user 0m2.934s
sys 0m0.808s
```
Currently the archive gets created including the directories, so the
regular guide to just download and copy the binary doesn't work. With
that change I have dropped the folders from the archive and the Drone
binary gets directly into the toplevel of the archive.