woodpecker/server/store/datastore
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
..
migration Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00
build.go Move Badge & CCMenue into own packages (#908) 2022-05-14 14:30:09 +02:00
build_test.go Calculate build number on creation (#615) 2021-12-18 20:37:51 +01:00
config.go Use editorconfig-checker (#982) 2022-06-17 12:03:34 +02:00
config_test.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
cron.go Add cron feature (#934) 2022-09-01 00:36:32 +02:00
cron_test.go Add cron feature (#934) 2022-09-01 00:36:32 +02:00
engine.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
engine_test.go Fix tests and pipeline (#732) 2022-01-31 14:39:53 +01:00
feed.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
feed_test.go Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00
file.go Dedup code and migrate away from deprecated funcs (#1141) 2022-08-30 01:14:07 +02:00
file_test.go Move away from deprecated go funcs (#1123) 2022-08-25 08:39:19 +02:00
helper.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
init.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
init_cgo.go Add linter revive (#554) 2021-12-01 14:22:06 +01:00
log.go Move away from deprecated go funcs (#1123) 2022-08-25 08:39:19 +02:00
log_test.go Dedup code and migrate away from deprecated funcs (#1141) 2022-08-30 01:14:07 +02:00
permission.go Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00
permission_test.go Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00
proc.go Make returned proc list to be returned always in correct order (#1060) 2022-08-02 18:34:16 +02:00
proc_test.go Rename struct field and add new types into server/model's (#523) 2021-11-22 12:55:13 +01:00
redirection.go Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00
redirection_test.go Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00
registry.go Fix registry delete (#532) 2021-11-25 19:04:36 +01:00
registry_test.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
repo.go Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00
repo_test.go Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00
secret.go Add global and organization secrets (#1027) 2022-08-14 13:48:53 +02:00
secret_test.go Add global and organization secrets (#1027) 2022-08-14 13:48:53 +02:00
server_config.go Use asym key to sign webhooks (#916) 2022-06-01 20:06:27 +02:00
server_config_test.go Use asym key to sign webhooks (#916) 2022-06-01 20:06:27 +02:00
task.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
task_test.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
user.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
users_test.go Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00