-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
preserve users if restoring a repository on the same Gitea instance #18604
Conversation
When calling DumpRepository and RestoreRepository on the same Gitea instance, the users are preserved: all labels, issues etc. belong to the external user who is, in this particular case, the local user. Dead code verifying g.gitServiceType.Name() == "" (i.e. plain git) is removed. The function is never called because the plain git downloader does not migrate anything that is associated to a user, by definition. Errors returned by GetUserIDByExternalUserID are no longer ignored. The userMap is used when the external user is not kown, which is the most common case. It was only used when the external user exists which happens less often and, as a result, every occurence of an unknown external user required a SQL query. Signed-off-by: Loïc Dachary <loic@dachary.org>
I classified this as |
Codecov Report
@@ Coverage Diff @@
## main #18604 +/- ##
==========================================
+ Coverage 46.25% 46.32% +0.07%
==========================================
Files 842 846 +4
Lines 121180 121236 +56
==========================================
+ Hits 56052 56164 +112
+ Misses 58321 58260 -61
- Partials 6807 6812 +5
Continue to review full report at Codecov.
|
- Pass the correct context into `db.GetEngine()`. - Introduced in: go-gitea#18604
- Pass the correct context into `db.GetEngine()`. - Introduced in: #18604
…o-gitea#18604) When calling DumpRepository and RestoreRepository on the same Gitea instance, the users are preserved: all labels, issues etc. belong to the external user who is, in this particular case, the local user. Dead code verifying g.gitServiceType.Name() == "" (i.e. plain git) is removed. The function is never called because the plain git downloader does not migrate anything that is associated to a user, by definition. Errors returned by GetUserIDByExternalUserID are no longer ignored. The userMap is used when the external user is not kown, which is the most common case. It was only used when the external user exists which happens less often and, as a result, every occurence of an unknown external user required a SQL query. Signed-off-by: Loïc Dachary <loic@dachary.org> Co-authored-by: Loïc Dachary <loic@dachary.org> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
- Pass the correct context into `db.GetEngine()`. - Introduced in: go-gitea#18604
When calling DumpRepository and RestoreRepository on the same Gitea
instance, the users are preserved: all labels, issues etc. belong to
the external user who is, in this particular case, the local user.
Dead code verifying g.gitServiceType.Name() == "" (i.e. plain git) is
removed. The function is never called because the plain git downloader
does not migrate anything that is associated to a user, by definition.
Errors returned by GetUserIDByExternalUserID are no longer ignored.
The userMap is used when the external user is not kown, which is the
most common case. It was only used when the external user exists
which happens less often and, as a result, every occurence of an
unknown external user required a SQL query.
Signed-off-by: Loïc Dachary loic@dachary.org
forgefriends source