Issue/PR hyperlink embed upgrade
See original GitHub issueDescription
What this issue solves
This issue aims to solve two things:
- The format in which issues and pull requests are displayed in the embed that the bot automatically sends.
- The order in which the issues and pull requests are sent. This wasn’t part of the original issue but I figure if this is correctly implemented then this could be fixed too.
Current implementation
Upon mentioning an issue or pull requests in a message such as sir-lancebot#69
or bot#420
, the issue/PRs are displayed in an embed in a random order without knowing which issue/PR is which. This is not a problem when a single issue/PR is mentioned but with anymore it becomes hard to figure out which is which quickly. Here is an example:
It is unclear which pull request is site#474
and which is site#477
.
Currently the code uses a set
and so the order is not preserved and we can’t link a URL back to the issue or pull request without doing some fancy URL stuff.
Proposed implementation
This line should change from
issues = set(issues)
to
issues = list(dict.fromkeys(issues))
And on this line we could simply just change the format of the string as it is added onto the embed to include the issue/PR number.
Proposed Implementation 2
This implementation involves the more_itertools
library. Specifically, the more_itertools.unique_everseen
function which would mean the previous change would instead need to be to:
issues = list(more_itertools.unique_everseen(issues))
This comes with the advantage of more_itertools
being used in other parts of Sir Lancebot.
End result
Going with either implementation, we would like to reach an embed that looks more like this, namely, it includes the issue/PR number in the hyperlink. Example:
Image provided by A Real Username#8028
Reasoning
I think this would be useful as it prevents community members from clicking on each hyperlink and checking if they managed to somehow click the correct link. Otherwise, going back and trying again. It just saves time and effort.
Would you like to implement this yourself?
- I’d like to implement this feature myself
- Anyone can implement this feature
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
Hi! I would like to give it a try! 👍
Very cool.