You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/services/migrations
Yarden Shoham f204ff4ef7
Prevent duplicate labels when importing more than 99 (#22591) (#22598)
Backport #22591

Importing labels (via `gitea restore-repo`) did not split them up into
batches properly. The first "batch" would create all labels, the second
"batch" would create all labels except those in the first "batch", etc.
This meant that when importing more than 99 labels (the batch size)
there would always be duplicate ones.

This is solved by actually passing `labels[:lbBatchSize]` to the
`CreateLabels()` function, instead of the entire list `labels`.

Co-authored-by: Sybren <122987084+drsybren@users.noreply.github.com>
2 years ago
..
codebase.go Add more checks in migration code (#21011) 3 years ago
codebase_test.go Update go tool dependencies (#19676) 3 years ago
common.go Add system setting table with cache and also add cache supports for user setting (#18058) 2 years ago
dump.go Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551) 2 years ago
error.go Prevent NPE whilst migrating if there is a team request review (#19855) 3 years ago
git.go format with gofumpt (#18184) 3 years ago
gitbucket.go Fix migration from GitBucket (#22465) 2 years ago
gitea_downloader.go Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551) 2 years ago
gitea_downloader_test.go Update HTTP status codes to modern codes (#18063) 3 years ago
gitea_uploader.go Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551) 2 years ago
gitea_uploader_test.go Refactor git command arguments and make all arguments to be safe to be used (#21535) 2 years ago
github.go Fix migration from GitBucket (#22465) 2 years ago
github_test.go Store the foreign ID of issues during migration (#18446) 3 years ago
gitlab.go Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551) 2 years ago
gitlab_test.go Update go tool dependencies (#19676) 3 years ago
gogs.go Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551) 2 years ago
gogs_test.go Store the foreign ID of issues during migration (#18446) 3 years ago
http_client.go Use `hostmatcher` to replace `matchlist`, improve security (#17605) 3 years ago
main_test.go Use a struct as test options (#19393) 3 years ago
migrate.go Prevent duplicate labels when importing more than 99 (#22591) (#22598) 2 years ago
migrate_test.go Refactor AssertExistsAndLoadBean to use generics (#20797) 3 years ago
onedev.go Add more checks in migration code (#21011) 3 years ago
onedev_test.go Update go tool dependencies (#19676) 3 years ago
restore.go Add more checks in migration code (#21011) 3 years ago
update.go Move more model into models/user (#17826) 3 years ago