Proposal: Store original author in database for use with migrated content #3512

Closed
opened 2025-11-02 05:15:28 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @mrsdizzie on GitHub (Jun 25, 2019).

New migration features are really nice! However, the way we are showing the user who imported the content as the author for everything feels confusing and hard to read, especially with lots of issues/PRs. I think it would be very hard to work on a large repo (like gitea) that has been migrated and shows the same username for every issue and PR.

I'd like to propose using the original author name for templates/display only (not mapping it to another user or anything complicated). Keep it simple but make things much easier to read.

An example of what it might look like:

Old:
Screen Shot 2019-06-25 at 1 26 51 PM

These are confusing, especially when there are dozens of comments. It also makes a link to that user on the local instance even if they don't exist. This also makes it possible for a different person to register somebody else's name and have it maybe look like they made those comments.

Some new ideas:

Screen Shot 2019-06-25 at 1 47 02 PM Screen Shot 2019-06-25 at 1 47 51 PM

This makes it more clear who wrote the comment and gives a quick visual indication that it was copied over from Github. The username could link to their Github profile, or just nothing at all if that is easier (so people aren't mistakenly taken to a different site). And the avatar should be different than the user who ran the import as well probably.

There are other places we display the name that can change too, but this is just an example of what it might be like to use the real author name. If something like this seems ok, maybe other ideas for this can be discussed here as well.

Originally created by @mrsdizzie on GitHub (Jun 25, 2019). New migration features are really nice! However, the way we are showing the user who imported the content as the author for everything feels confusing and hard to read, especially with lots of issues/PRs. I think it would be very hard to work on a large repo (like gitea) that has been migrated and shows the same username for every issue and PR. I'd like to propose using the original author name for templates/display only (not mapping it to another user or anything complicated). Keep it simple but make things much easier to read. An example of what it might look like: Old: <img width="844" alt="Screen Shot 2019-06-25 at 1 26 51 PM" src="https://user-images.githubusercontent.com/1669571/60121209-908f5080-9750-11e9-8a83-15e0e4060dec.png"> These are confusing, especially when there are dozens of comments. It also makes a link to that user on the local instance even if they don't exist. This also makes it possible for a different person to register somebody else's name and have it maybe look like they made those comments. Some new ideas: <img width="840" alt="Screen Shot 2019-06-25 at 1 47 02 PM" src="https://user-images.githubusercontent.com/1669571/60121316-c9c7c080-9750-11e9-9239-5a9a8724f267.png"> <img width="842" alt="Screen Shot 2019-06-25 at 1 47 51 PM" src="https://user-images.githubusercontent.com/1669571/60121347-d77d4600-9750-11e9-83e1-fd14f75275e3.png"> This makes it more clear who wrote the comment and gives a quick visual indication that it was copied over from Github. The username could link to their Github profile, or just nothing at all if that is easier (so people aren't mistakenly taken to a different site). And the avatar should be different than the user who ran the import as well probably. There are other places we display the name that can change too, but this is just an example of what it might be like to use the real author name. If something like this seems ok, maybe other ideas for this can be discussed here as well.
GiteaMirror added the type/proposaltype/enhancement labels 2025-11-02 05:15:28 -06:00
Author
Owner

@lunny commented on GitHub (Jun 26, 2019):

@mrsdizzie Good idea. I just gave a simple handler with users and reactions when migrating issues.

To implement your idea, we should add a new column named original_author on table issues and add a orignal_url on repository I think.

Another idea is if you are a site administrator, you could create all the users automatically with random password if you check some options. When you migrating from Github Enterprise to Gitea, it's a useful feature.

@lunny commented on GitHub (Jun 26, 2019): @mrsdizzie Good idea. I just gave a simple handler with users and reactions when migrating issues. To implement your idea, we should add a new column named `original_author` on table `issues` and add a `orignal_url` on `repository` I think. Another idea is if you are a site administrator, you could create all the users automatically with random password if you check some options. When you migrating from Github Enterprise to Gitea, it's a useful feature.
Author
Owner

@jakimfett commented on GitHub (Jul 1, 2019):

I rather like the second of the two new GUI presentation of the imported bits, with the source to the side of the author, @mrsdizzie.

Thoughts on using a slight de-emphasis on the import source, especially if this will eventually allow us to import from one another's instances?
Screenshot from 2019-06-30 23-46-53


@lunny would a user, authenticated with the original source i.e. mirror.gitea.com, or GitHub (via OAuth or similar), be able to interact with their own imported comment(s)?

@jakimfett commented on GitHub (Jul 1, 2019): I rather like the second of the two new GUI presentation of the imported bits, with the source to the side of the author, @mrsdizzie. Thoughts on using a slight de-emphasis on the import source, especially if this will eventually allow us to import from one another's instances? ![Screenshot from 2019-06-30 23-46-53](https://user-images.githubusercontent.com/2565176/60409407-7b238780-9b91-11e9-9b72-1f87ae80e256.png) --- @lunny would a user, authenticated with the original source i.e. `mirror.gitea.com`, or GitHub (via OAuth or similar), be able to interact with their own imported comment(s)?
Author
Owner

@lunny commented on GitHub (Jul 1, 2019):

@jakimfett As my opinion, when a user login gitea instance with github OAuth2(or bind), we can assign the imported comments to that user so that he will have permission manage his comments.

@lunny commented on GitHub (Jul 1, 2019): @jakimfett As my opinion, when a user login gitea instance with github OAuth2(or bind), we can assign the imported comments to that user so that he will have permission manage his comments.
Author
Owner

@mrsdizzie commented on GitHub (Jul 2, 2019):

@lunny we should also have original_author on table comments too right? Should we try and store the email too if we are going to try to link with existing accounts in the future?

@mrsdizzie commented on GitHub (Jul 2, 2019): @lunny we should also have ```original_author``` on table ```comments``` too right? Should we try and store the email too if we are going to try to link with existing accounts in the future?
Author
Owner

@lunny commented on GitHub (Jul 3, 2019):

@mrsdizzie Right, issues and comments should have an extra column original_author and repoisitory should store migrating link or we may have an external table named repo_migration which will store columns of migrated repository, i.e. migrating_url and etc.

I think we cannot got email from github's API. We can link them back to github via login name.

@lunny commented on GitHub (Jul 3, 2019): @mrsdizzie Right, `issues` and `comments` should have an extra column `original_author` and `repoisitory` should store migrating link or we may have an external table named `repo_migration` which will store columns of migrated repository, i.e. migrating_url and etc. I think we cannot got email from github's API. We can link them back to github via login name.
Author
Owner

@mrsdizzie commented on GitHub (Jul 3, 2019):

@lunny OK I will try and do a PR for that then

@mrsdizzie commented on GitHub (Jul 3, 2019): @lunny OK I will try and do a PR for that then
Author
Owner

@techknowlogick commented on GitHub (Jul 3, 2019):

@mrsdizzie We should store user ID too, because Github allows users to change name, and if original user changes name a new user could impersonate them.

@techknowlogick commented on GitHub (Jul 3, 2019): @mrsdizzie We should store user ID too, because Github allows users to change name, and if original user changes name a new user could impersonate them.
Author
Owner

@lunny commented on GitHub (Jul 3, 2019):

@techknowlogick You are right. github API will return id. @mrsdizzie

@lunny commented on GitHub (Jul 3, 2019): @techknowlogick You are right. github API will return id. @mrsdizzie
Author
Owner

@lunny commented on GitHub (Jul 8, 2019):

Closed by #7352

@lunny commented on GitHub (Jul 8, 2019): Closed by #7352
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3512