Remote references #12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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?