-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Change ownership of issues/comments/PR from Github user to Gitea user after migration #7410
Comments
@mrsdizzie Do you have any plan to work on this? |
I could try if what I said sounds good to you |
@mrsdizzie That's good to me. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
so, was this the last step before gitea can be migrated from github to gitea? |
@programmerjake I think yes. But there is a bug need to be fixed. #8504 . After that, we will begin to migrate to gitea.com. |
Will we do a test run were we can check things and all after migration for a few days (e.g. testmigration.gitea.com)? |
@guillep2k We can migrate gitea to a private repository to test if it works. A subdomain is unnecessary. And if there is no any problem. Then we can archive the old repository on github and then migrate formally. |
@6543 Done. Thanks! |
Now that #7293 has happened, I think we have a good path to give ownership of migrated issues/comments/PRs to local Gitea users after a repo is migrated from Github.
When migrating, we store the Github user ID in the
issues
andcomments
table asoriginal_author_id
which means that we can match them if admin sets up Github as Authentication Source and a local user links their Github account.For changing ownership we should create a task that compares
external_login_id
fromexternal_users_table
withoriginal_author_id
in issues/comments. Then change theposter_id
of the issue/comment from the user who ran the migration to the local Gitea user who has a matching Github ID (external_login_user.user_id
).At this time we should also NULL the
original_author
string so the templates show the new Gitea user information and behave as normal.I think we should offer this in 3 areas:
After the migration is run we should see if any of the items migrated match an already authenticated user and change the ownership then.
When somebody uses Github to authenticate we should see if their Github user ID is present in any migrated comments that still have
original_author
string and change ownership thenThere should also be a simple interface in the admin area to manually input a
original_author_id
and choose an existing local user to assign the issues/comments too. This would give admin full control over what accounts are linked to what issues/comments and let them also revert any previous ownership change/run the task again if an error occurs.The text was updated successfully, but these errors were encountered: