Remote references #12

Closed
opened 2022-07-22 16:48:29 +00:00 by xy · 0 comments
xy commented 2022-07-22 16:48:29 +00:00 (Migrated from gitea.com)

Remote references are deceptively easy. The basic idea here is that we want to reference an issue or ping a user located on another instance. For instance, I can use #3 to mention a local issue, but what about issues somewhere else?

The natural syntax to use here is username@instance.com/reponame#123 to reference a remote issue (since it's similar to Gitea's current user/repo#123 syntax), and it's not too difficult to search for these in a new comment, figure out which issue it's referring to, send out a Mention activity to the remote instance, and then hooray, we're done! Mentioning a local issue like #3 even works well without any changes when combined with remote collaborators, since clicking on the link would take you to the copy of #3 on your instance. If your instance doesn't have #3 for some reason (for example, maybe you aren't a collaborator but just commented on another issue which synced to your instance), it could redirect you to the original instance where #3 probably does exist.

One particularly thorny challenge is what happens when a remote issue you referenced migrates to a different instance. One possible way to deal with this is to have a background job that goes through all the references and updates them if the repo did a migration. Another solution is to just do nothing, since accessing the old location will cause you to be redirected to the new location anyways, as long as the old name hasn't been claimed yet. Any thoughts?

Remote references are deceptively easy. The basic idea here is that we want to reference an issue or ping a user located on another instance. For instance, I can use #3 to mention a local issue, but what about issues somewhere else? The natural syntax to use here is username@instance.com/reponame#123 to reference a remote issue (since it's similar to Gitea's current user/repo#123 syntax), and it's not too difficult to search for these in a new comment, figure out which issue it's referring to, send out a Mention activity to the remote instance, and then hooray, we're done! Mentioning a local issue like #3 even works well without any changes when combined with remote collaborators, since clicking on the link would take you to the copy of #3 on your instance. If your instance doesn't have #3 for some reason (for example, maybe you aren't a collaborator but just commented on another issue which synced to your instance), it could redirect you to the original instance where #3 probably does exist. One particularly thorny challenge is what happens when a remote issue you referenced migrates to a different instance. One possible way to deal with this is to have a background job that goes through all the references and updates them if the repo did a migration. Another solution is to just do nothing, since accessing the old location will cause you to be redirected to the new location anyways, as long as the old name hasn't been claimed yet. Any thoughts?
a closed this issue 2024-01-11 19:02:12 +00:00
This repo is archived. You cannot comment on issues.
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: a/gitea#12
No description provided.