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
and comments
table as original_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
from external_users_table
with original_author_id
in issues/comments. Then change the poster_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 then
There 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.
@mrsdizzie Do you have any plan to work on this?
@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.
@lunny can you crosline this pr in #1029?
@6543 Done. Thanks!
Most helpful comment
@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.