-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement embeds by issueId #329
Conversation
### Notes This implements a new feature to embed linear links based off of the `issueId` if it's placed in a message, such as `THESIS-123`. Additionally this adds a function to delete the embed if the original message link is deleted / changed. Still need to implement editing the original embed if it changes.
This will now pull in the issue tags dynamically from the Linear API rather than having to define it in `ISSUE_PREFIXES`
Let's switch the `robot.logger.info` into `robot.logger.debug`
This adds support for editing the embeds if the original message is updated with changed issues. Ready to roll out for testing. Adds support to `issueTagRegex` for different cased issues like `iSsUe-111` or `ISSUE-111`
Calling this one ready for review/merge. There is likely some edge cases to resolve but I suppose we can iterate further! I've implemented editing embeds and also grabbing issue |
const embedPromises = matches.map(async (match) => { | ||
const uniqueMatches = new Set<string>() | ||
|
||
urlMatches.forEach((match) => { | ||
const teamName = match[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for all of these you can use named capturing groups.
This resolves the issues with excessive json calls and fixing up the regex patterns as per review!
|
||
function initializeIssueTagRegex() { | ||
issueTagRegex = | ||
/(?<!https:\/\/linear\.app\/[a-zA-Z0-9-]+\/issue\/)[A-Z]{3,}-\d+\b/gi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point we can just put this in a const
rather than initializing, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one more note but I think it's minor, let's
Notes
This implements a new feature to embed linear links based off of the
issueId
if it's placed in a message, such asTHESIS-123
.Additionally this adds a function to delete the embed if the original message link is deleted / changed.
Still need to implement editing the original embed if it changes.