Skip to content
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

References to issues should be re-written when synced #113

Open
ericallam opened this issue Jul 13, 2023 · 3 comments
Open

References to issues should be re-written when synced #113

ericallam opened this issue Jul 13, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@ericallam
Copy link

For example, here is an issue I just created in linear that was synced to GitHub:

CleanShot 2023-07-13 at 20 02 50@2x

That [TR-654] links back to Linear, instead of linking to the synced issue in GitHub. It would be great if those reference links could automatically be rewritten to reference the correct GitHub issue (or if the linear issue references isn't public, then it should just keep the link as is now)

@maige-app maige-app bot added enhancement New feature or request self-hosting Forks; Railway; DigitalOcean; environment variables; Docker labels Jul 13, 2023
@tedspare tedspare removed the self-hosting Forks; Railway; DigitalOcean; environment variables; Docker label Jul 13, 2023
@tedspare
Copy link
Collaborator

Interesting! One possible approach:

  • Include a RegEx check-and-replace for Linear ticket refs ("ABC-123" where "ABC" is known at runtime as linearTeamId) in prepareMarkdownContent()
  • Check the DB for a GH issue corresponding to that ticket via the SyncedIssues table where linearIssueId is known
  • For each Regex match, add a GH link if possible
  • Watch out for infinite loops if the content is different on each side

@ericallam
Copy link
Author

Is checking that the content is equal the way you prevent infinite loops?

@tedspare
Copy link
Collaborator

That's right, at least after SyncLinear's transformations: linearMarkdown === syncLinear(githubMarkdown)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants