woodpecker/server/model
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
..
agent.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
build.go Add cron feature (#934) 2022-09-01 00:36:32 +02:00
config.go Fix reggression, save not activated repos to database on sync again (#510) 2021-11-14 22:13:59 +01:00
const.go Add cron feature (#934) 2022-09-01 00:36:32 +02:00
cron.go Add cron feature (#934) 2022-09-01 00:36:32 +02:00
environ.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
event.go Send decline events back to UI (#680) 2022-01-09 03:47:31 +01:00
feed.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
file.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
log.go Update type of 'log_data' from blob to longblob (#1050) 2022-07-29 14:57:18 +02:00
netrc.go Refactor: move model/ to server/model/ (#366) 2021-09-27 19:51:55 +02:00
perm.go Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00
proc.go Document package architecture (#972) 2022-06-16 15:35:58 +02:00
proc_test.go proc.Tree() func do not depend on sorted procs list (#647) 2021-12-31 17:43:09 +01:00
redirection.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
repo.go Fetch repositories with remote ID if possible (#1078) 2022-09-05 17:08:51 +02:00
resource_limit.go Refactor: move model/ to server/model/ (#366) 2021-09-27 19:51:55 +02:00
secret.go Add global and organization secrets (#1027) 2022-08-14 13:48:53 +02:00
secret_test.go Add field for image list in Secrets Repo Settings (Web UI) (#638) 2021-12-30 07:26:36 +01:00
server_config.go Use asym key to sign webhooks (#916) 2022-06-01 20:06:27 +02:00
settings.go Refactor: move model/ to server/model/ (#366) 2021-09-27 19:51:55 +02:00
task.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
team.go Refactor: move model/ to server/model/ (#366) 2021-09-27 19:51:55 +02:00
user.go Migrate to Xorm (#474) 2021-11-13 20:18:06 +01:00
user_test.go gofumpt -w -l -extra . (#661) 2022-01-05 21:50:23 +01:00