Closed asottile closed 3 years ago
this would be the most straightforward patch:
diff --git a/src/githubHelper.ts b/src/githubHelper.ts
index b4af99e..baa4b7b 100644
--- a/src/githubHelper.ts
+++ b/src/githubHelper.ts
@@ -846,7 +846,7 @@ export default class GithubHelper {
dateformatOptions
);
- const attribution = `In GitLab by @${item.author.username} on ${formattedDate}`;
+ const attribution = `In GitLab by [@${item.author.username}](https://gitlab.com/${item.author.username}) on ${formattedDate}`;
const lineRef =
item && item.position
? GithubHelper.createLineRef(item.position, repoLink)
this prevents emailing the user, I wasn't sure whether it should link to github or gitlab though (I'm not sure the intent of that line)
I wasn't sure whether it should link to github or gitlab though
That's a tough one... as in theory, the usernames on GitLab and Github don't have to match, so linking to GitLab will be more correct. On the other hand, the idea is to migrate away from GitLab and in a few years, links to GitLab may not be relevant, and for most users, the username will be the same and map nicely. Since pointing to GitLab is what you've drafted, that's what I'll be using to test this technique with the migration of importlib_resources.
I notice now that the migration tool provides a usermap, so those links should be to Github.
GitLab provides a way to disable notifications for a project, but I don't see a way to do that in Github. If only they provided that feature and allow it to be twiddled through the API, then the migration tool could disable notifications during the migration and re-enable them at the end. That way, mentions could still trigger subscription to salient issues also.
Testing hyperlink-only notification suppression: @warsaw shouldn't get notified here (or be subscribed to the issue).
Confirmed - it's not necessary to have a zero-width space. Just enclosing the mention in an explicit hyperlink seemed to have suppressed the mention mechanics.
Users have reported that email notices are still happening with this change present.
Would there be interest in implementing such a feature? A repository was just migrated and I received 50+ emails from the scripts!
A similar script I've used in the past for bitbucket => github avoids mentioning / assigning but preserves usernames by linking them directly: https://github.com/jeffwidman/bitbucket-issue-migration/blob/4c797925f322f49956e3dc925f6dff0f2ed075ca/migrate.py#L657-L675
could be a less-noisy alternative