Skip to content
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

Closed
mrsdizzie opened this issue Jul 10, 2019 · 10 comments · Fixed by #7751
Closed
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Milestone

Comments

@mrsdizzie
Copy link
Member

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.

@lunny lunny added the type/enhancement An improvement of existing functionality label Jul 10, 2019
@lunny
Copy link
Member

lunny commented Jul 11, 2019

@mrsdizzie Do you have any plan to work on this?

@mrsdizzie
Copy link
Member Author

@mrsdizzie Do you have any plan to work on this?

I could try if what I said sounds good to you

@lunny
Copy link
Member

lunny commented Jul 12, 2019

@mrsdizzie That's good to me.

@lunny lunny mentioned this issue Jul 13, 2019
20 tasks
@stale
Copy link

stale bot commented Sep 10, 2019

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.

@stale stale bot added the issue/stale label Sep 10, 2019
@lafriks lafriks added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Sep 10, 2019
@stale stale bot removed the issue/stale label Sep 10, 2019
@lunny lunny added this to the 1.10.0 milestone Sep 27, 2019
@programmerjake
Copy link

so, was this the last step before gitea can be migrated from github to gitea?

@lunny
Copy link
Member

lunny commented Oct 14, 2019

@programmerjake I think yes. But there is a bug need to be fixed. #8504 . After that, we will begin to migrate to gitea.com.

@guillep2k
Copy link
Member

Will we do a test run were we can check things and all after migration for a few days (e.g. testmigration.gitea.com)?

@lunny
Copy link
Member

lunny commented Oct 15, 2019

@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
Copy link
Member

6543 commented Nov 7, 2019

@lunny can you crosline this pr in #1029?

@lunny
Copy link
Member

lunny commented Nov 7, 2019

@6543 Done. Thanks!

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Projects
None yet
6 participants