Coder Social home page Coder Social logo

jtormey / linear-sync Goto Github PK

View Code? Open in Web Editor NEW
75.0 75.0 7.0 2 MB

Easily synchronize issues between Linear and GitHub

Home Page: https://linear-sync.com

Elixir 86.12% JavaScript 1.50% HTML 10.38% SCSS 0.75% Dockerfile 1.14% Shell 0.07% Batchfile 0.04%

linear-sync's People

Contributors

jtormey avatar seripap avatar underyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

linear-sync's Issues

Allow syncing from public repos without permission to org's private data

Heya! Awesome tool, really excited it might save us from having to use Jira! 🥳 We however have a requirement to not give linear-sync.com permission to our private issue data.

I originally tried to solve this by logging in with a dummy user which is outside our github org. to avoid giving the app access to our org's private issues. The user is r2c-demo, and I'd want to subscribe to issues on returntocorp/semgrep (and some other public repos). But sadly, it's not possible to select a repo unless the user is a member of the repo's organization:

Screen Shot 2021-07-09 at 10 23 50

I even tried to reverse engineer the API to subscribe to an undisplayed repo ID, but Phoenix's websockets are too difficult for me to wrangle like that. I wanted to try to find other ways around private permissions, but can't play around too much since #16 prevents me from switching github users.

Possible solutions

  1. When I logged in, linear-sync used an OAuth app. Using a GitHub app instead would make it possible to give access only to select repos. See https://docs.github.com/en/developers/apps/getting-started-with-apps/differences-between-github-apps-and-oauth-apps. I'm quite confused about this point actually, because the README instructs users to create a github app, but I think I saw the oauth app prompt when I first tried to log in.
  2. Two-way sync would not work, but at least for one-way, it should be possible to enter any public repository ID, right? The GitHub API allows reading public issue data whether you're in the org or not. Though I ran the app offline and noticed that webhook subscriptions need to be created on the repo, which cannot be automated without write access.
  3. This is a possible solution for me personally, not for the project: we could self-host linear-sync to get rid of the strict permissions requirement.

Issues created in Linear don't sync comments / close status / title

Hi @jtormey. Amazing tool, thanks so much. I switched to this after https://github.com/calcom/synclinear.com proved unreliable.

Problem

Creating issues in Github results in perfectly functioning two-way syncing.

But creating issues in Linear seems to break syncing.

That is, after the Linear issue successfully syncs to Github:

  • Subsequent Github comments / close statuses / title changes don't sync to Linear
  • And the reverse, Linear comments / close statuses / title changes don't sync to Github

Bug context

Sync ID is 5bd2722d-eaa4-4dd5-9d7f-489aa6d6d771

When I check out the webhook in the Github repo, here's what I see:

Screenshot 2022-10-19 at 10 45 30

Screenshot 2022-10-19 at 10 51 30

I can't debug this any further from the error message itself.

failed to enable issue sync (linear webhook failed

First of all thanks for the great project. I can't set it up with a new repo of mine though. I can connect my GitHub account, create an API key, setup an issue sync but when pressing "enable" the following error pops up:

image

The repository I try to connect is the following.

Any idea what could cause the problem?

Sync Github repo with specific Linear project

If one syncs two Github repos to the same team, which repo will a new Linear issue in that team sync back to? It would be helpful if we could (optionally) specify the Linear project that a connection syncs to/from:

  • If a project is set, then Linear issues will only copy to Github if they are part of the team.
  • Vice-versa, Github issues that sync to the team will be auto-attached to the defined project, if a project is set.

One-way sync from Github to Linear

Previously, Linear Sync went one way - pulling issues from Github and adding them to Linear. It seems like two way sync is now the default. Is there a way to restore the previous behavior?

Support two-way sync

Currently, this application only supports syncing new issues from GitHub to Linear. However, it would be nice if sync worked the other way as well.

Example use cases:

  • When an issue is completed or archived in Linear, close the corresponding GitHub issue
  • When an issue is commented on in Linear, add the comment to GitHub as well (maybe requiring some special syntax in the message, so that some comments may remain private)

For anyone looking to implement this feature, here are the relevant sections of the codebase:

  • The code for setting up and tearing webhooks can be found in Linear.IssueSyncService, and will simply need to be uncommented
  • Creating webhooks is currently broken, due to changes in Linear's API. This will have to be fixed in Linear.LinearAPI (and is the reason for the previously mentioned commented code)
  • Incoming webhook requests from Linear will have to be handled and the "business logic" implemented, which is done in Linear.Synchronize

Sync labels from Github

Currently, Linear Sync imports the issue title and text, but does not sync Github labels with labels in Linear.

I noticed in #14, sync is added in the reverse direction (Linear -> Github). It would be amazing if this worked in the other direction as well!

Label sync does not work for labels included when creating a new Github issue

Current Behavior: When creating a new Github issue that has labels, Linear Sync will import the issue title and text but will not include the labels.

When adding labels to an existing issue, the sync process works as expected and the labels from Github are added to Linear.

Expected Behavior: Linear Sync should import the labels for new issues, the same way that it syncs labels when they are added to existing issues.

New issue in GitHub does not create new Linear issue

Expected Behavior

  • New issues created in GitHub without a Linear issue ID in their name should create a new issue in Linear linked to the GitHub issue

Current Behavior

  • Creating a new issue in GitHub that is not linked to an existing Linear issue does not create a new Linear issue.

Sync enable failed and no webhooks listed,

In Linear Sync, after I added a sync to test one repository, it seemed to setup fine.
But when I click the "Enable" button, I get the error:
Failed to enable issue sync (:linear_webhook_enable_failure)

Clicking "View Webhooks", no webhooks are listed for either Linear or Github.
( In Linear setting, I see a webhook created: https://linear-sync.com/webhook/linear )
( In Github, I don't see a webhook created for that repository.)

Synced Linear issues should have an `Issue Attachment` to the related Github issue

I'm not exactly sure how, but Linear's github import tool and synclinear.com both manage to append these nice, official "Github issue" links to the bottom of the Linear issue description:

Screenshot 2022-10-19 at 16 29 47

By comparison, this tool only adds the link inside the rich text description. Whilst this is functionally fine, it's not quite as slick. The affordance of the button and consistent UI will make the UX this tool provides a bit nicer.

Screenshot 2022-10-19 at 16 45 38

Internal Server Error when connecting Github or deleting account, cannot disable a connection

Something went wrong with the Linear->Github syncing (for Github-created issues) so I tried to 'reset' the connection.

  • Clicking "disable" produced this error: Failed to disable issue sync (:github_webhook_disable_failure)
    Screenshot 2022-10-27 at 12 34 56
  • I tried reconnecting the Github, just in case something was going wrong there, and got an Internal Server Error
    Screenshot 2022-10-27 at 12 32 33
  • When I reloaded the page, I got stuck on the login / "connect your Github" flow
    Screenshot 2022-10-27 at 12 27 58
  • Somehow the view changed back to the connections page, so I tried to just delete the account, and again got an Internal Server Error.
  • When I reloaded the page, I got this notice: "Failed to delete your LinearSync account, please email [email protected] for assistance."
    Screenshot 2022-10-27 at 12 34 51

I've manually removed the webhooks and plan to create a new connection with a new API key, just filing this bug in case it's helpful for smoothing things out in future. It's no problem now but if I set up 10 syncs in future and then had to manually disable and recreate them, that would be a bit of a headache.

Setting to prevent issues from being renamed?

Is it possible to turn turn off the automatic renaming of public Github issues?

I'm imaging this as a checkbox on the Configure Issue Sync page, but could also be implemented by checking for the existence of a label, like no-rename?

Screen Shot 2021-07-19 at 12 10 30 PM

Show `userPresentableMessage` from Linear errors

Linear includes a userPresentableMessage in their GraphQL error responses. It would be nice to make this user-facing in the event that there is an API failure. Error-handling in general could be better too.

Unable to fix "there is already an issue sync for this team repo combination"

Someone previously set up Linear Sync from an account that I no longer have access to. They have revoked authorization from their Github and their Linear account has been suspended. However, now, when I try to recreate the sync using my own Github account I receive the following error message: "there is already an issue sync for this team repo combination"

Potential Solution:
Other members of a Linear workspace should be able to remove pre-existing 'syncs'

Re-opening a synced issue in Linear should re-open it in Github

Steps to reproduce:

  1. Create a Github issue, see that it is synced to Linear
  2. Close the synced Linear issue, see that the related Github issue has also closed
  3. Change the synced Linear issue status back to "to do", see that the related Github issue remains closed

Failed to enable issue sync (github_webhook_enable_failure)

I just setup a clean account (meaning I didn't have the Linear Sync GitHub app installed before), and a sync that I created is disabled by default. When enabling, I'm getting: Failed to enable issue sync (:github_webhook_enable_failure).

image

I tried to peek in the code, but I'm no Elixer developer and I'm a bit confused whether GitHub webhook means it's connecting to GitHub, as the Linear API is an argument in the functions invoked there. Anyways, any idea what's happening here @jtormey?

Linear username should be displayed in a synced Linear comment on Github

Right now, synced comments from Linear are posted in the name of the integrating user.

To avoid confusion, the name of the Linear user should appear in the comment, either in the footer alongside "synced from Linear" or somewhere else.

Ideally, comments wouldn't be posted on behalf of the integrating user but rather by the linear-sync.com application. (e.g. so the integrating user's name and avatar doesn't show up at all for a comment that doesn't involve them.) But this is a stretch goal, I think :)

Sync comment edits (in both directions)

For an issue created in Github, then synced to Linear, comment edits are not being synced either from Linear to Github or Linear to Github.

The same problem might be occurring for issues created in Linear but I can't test this before #43 is resolved.

Reopening a GitHub issue should set Linear ticket to configured "Open Status"

The simplest use case for this is: if a GH issue is accidentally closed and then reopened, I'd expect the Linear ticket to not be left as "Done". A reopen feels conceptually similar to a new issue with the same content being opened, which would sync to Linear as the configured "Open Status". So I think reopens should do the same.

Problem with new PR is made in GitHub

Expected Behavior

  • New PRs create in GitHub without a Linear issue ID in their name should create a new issue in Linear linked to the PR
  • New PRs created with a Linear issue ID should be linked to that ID
  • Comments should be synced both ways between Linear and GitHub

Current Behavior

  • Creating a new PR in GitHub that is not linked to an existing Linear issue does not create a new issue.
  • When linking a PR to an existing Linear issue, comments from Linear are pushed to GitHub, but comments from GitHub are not pushed to Linear.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.