⚔️ How Swingback keeps GitHub and Linear in sync without the two sides fighting

by•

The feedback board was the easy part of building Swingback. The hard part was getting a post and its GitHub or Linear issues to agree, in both directions, without one side undoing the other.

Here's what the sync does, and some problems I had to solve along the way.

What it does:

  • From a post, you open an issue in GitHub or Linear, or link one that already exists. One post can link several issues, across repositories and both trackers.

  • When the issues move, the post follows. Close the last open issue and the post is marked completed, and everyone following it hears about it.

  • When you change the post's status, Swingback can update the issues too: their state and a label on GitHub, their workflow state on Linear.

Some problems I had to solve:

  • Webhooks can't be trusted on their own They arrive late, out of order, twice, or not at all. So Swingback doesn't act on what a webhook says. It records that something changed, then asks GitHub or Linear for the issue's current state and works from that. A delivery that arrives twice, or after a newer one, changes nothing.

  • GitHub limits how much an app can create per hour, so writes are paced for each installation. Creating an issue is also safe to retry. On GitHub, Swingback marks what it creates and looks for that mark before trying again. On Linear, it gives the issue an ID of its own, so a second attempt is refused instead of making a duplicate.

The GitHub and Linear sync is still in beta. If you've built a sync like this, or been burned by one, I'd love to hear how it went.

12 views

Add a comment

Replies

Be the first to reply

Have a question or a thought to share? Add a comment above to start the conversation.