getsentry / team-ospo

Open Source Program Office (OSPO)
https://open.sentry.io/
11 stars 1 forks source link

Set up GitHub ⇔ Jira connector #63

Closed chadwhitacre closed 1 year ago

chadwhitacre commented 1 year ago

To support https://github.com/getsentry/team-ospo/issues/42 we want to set up an automation that creates a shadow Jira ticket for issues in the sentry GitHub repo. The purpose of the Jira ticket is to integrate with our existing customer tagging/tracking infrastructure, as well as our sprints and planning for EPD. Most comments and content should stay on GitHub. Ideally we wouldn't create a Jira for every GitHub, but only when we want to start doing something with it in Jira (tag a customer, bring it into a sprint, etc.(?)).

Requirements

  1. When someone applies Trigger: Create Jira Ticket
    1. Check the description for a link to an existing Jira.
    2. Create a new Jira if it doesn't exist, and link it in the description.
    3. Remove Trigger: Create Jira Ticket
  2. When resolved in Jira.
    1. Close on GitHub.
  3. When unresolved in Jira.
    1. Reopen on GitHub.

To Do

BYK commented 1 year ago

Sounds like you may wanna try Pipedream out.

chadwhitacre commented 1 year ago

Yeah, maybe! I saw when you first linked that a while ago (probs on Twitter?). Are you actively using it?

chadwhitacre commented 1 year ago

Options:

BYK commented 1 year ago

@chadwhitacre we've been using it at Formsort for many things and it works quite well. I think for Sentry's scale, you'd need to pay for the pro/team account up front as the daily limit of 66 invocations is a bit too low. The individual dev plan has more headroom for initial testing though.

We did build out that magical "automated changelog based on SaaS deploys powered by Jira tickets" thing we have been thinking about :)

chadwhitacre commented 1 year ago

Why should we use a nocode solution instead of eng-pipes?

BYK commented 1 year ago

It is not a no-code solution. You do write code but don't have to deal with the boring and error-prone parts like authentication, tokens etc. Arguably, you can probably replace whole eng-pipes with Pipedream workflows.

chadwhitacre commented 1 year ago

Link dump:

https://exalate.com/ppc-jira-github-integration/ https://marketplace.atlassian.com/apps/1218053/github-jira-two-way-sync https://support.atlassian.com/jira-cloud-administration/docs/integrate-with-github/

chadwhitacre commented 1 year ago

https://support.atlassian.com/jira-cloud-administration/docs/integrate-with-github/ - doesn't apply, it only covers code on GitHub not issues

https://exalate.com/ppc-jira-github-integration/

https://marketplace.atlassian.com/apps/1218053/github-jira-two-way-sync => https://unito.io/integrations/jira-github/, I started looking at this a long time ago.

So that's Exalate and Unito in addition to Pipedream and Zapier.

chadwhitacre commented 1 year ago

Twitter Followers

Company n
Zapier 70,253
Pipedream 6,524
Unito 1,067
Exalate 21

I checked, we don't already have any of these.

chadwhitacre commented 1 year ago

No-one ever got fired for buying Zapier? :o)

chadwhitacre commented 1 year ago

There's a "New Label in GitHub" event in Zapier but not afaict an "Apply label to issue" event.

chadwhitacre commented 1 year ago

Same with Pipedream, but there is a "create it" option.

Screen Shot 2022-11-11 at 12 10 49 PM
chadwhitacre commented 1 year ago

I looked through Pipedream's issues and PRs and didn't see anything already in the works for this event.

BYK commented 1 year ago

@chadwhitacre I think you are looking for "New or Updated Issue (Instant)"?

It is essentially the same logic with GitHub actions: new/updated issue -> filter by update type & label

chadwhitacre commented 1 year ago

Afaict Zapier and Pipedream are focused on one-way automations, vs. Unito and Exalate which are focused on bidirectional syncing between objects in disparate systems.

chadwhitacre commented 1 year ago

Unito was super easy to set up, no code! 😁

https://github.com/org-3392dc2e/testing/issues/1


GH
Jira
chadwhitacre commented 1 year ago
1 2 3 4 5
chadwhitacre commented 1 year ago

Seeing an unexpected result, when I remove the label from the GitHub issue, it moves the Jira ticket to "Done" and vice versa.

Screen Shot 2022-11-15 at 2 26 18 PM
chadwhitacre commented 1 year ago

Also seeing that Jira is using my auth (I selected OAuth 2 on setup). Not sure what's best, ideal might be to have issue author's auth used, more likely will need to set up a bot account on Jira.

chadwhitacre commented 1 year ago

Looking into Unito/Jira auth ...

https://guide.unito.io/a-guide-to-unitos-jira-integration https://guide.unito.io/what-permissions-are-required-for-jira-users

chadwhitacre commented 1 year ago

Unito GitHub perms FTR ...

https://guide.unito.io/what-permissions-are-required-for-github-users

chadwhitacre commented 1 year ago

Note: Before setting up permissions, we recommended you create a Jira bot user.

Well there ya go. :) That's for Jira.

chadwhitacre commented 1 year ago

Pricing

πŸ‘‰ https://unito.io/pricing/ πŸ‘ˆ

The word from GTM is that this would be useful across all tier 1 repos. That's currently 2,210 open issues/PRs.

Unito prices are based on "items in sync," and each side counts for one, so if all 2,210 issues are synced from GitHub to Jira then that is 4,420 items. I don't expect all tickets will have a Jira shadow, certainly not off the bat. That said we are likely to see more tickets created in GitHub more rapidly than before. Some history:

Assumptions

  1. We will be able to define "items in sync" as open GitHub issues with Sync: Jira label applied, across 27 repos.
  2. Eyeballing on the above chart:
    • 3,600 total new in getsentry in 2019
    • 6,000 in 2020 / 3,600 = 1.67
    • 7,200 in 2021 / 6,000 = 1.2
    • 9,000 in 2022 / 7,200 = 1.25
      1. So that is 1.2x – 1.67x growth yoy in getsentry repo. Let's assume roughly the same rate in other repos.
      2. How many issues will have the Sync: Jira label applied? 10%? 50%? 80%?

Scenarios

Base is 4,420, calculation is "items in sync".

scenario now now + 1yr now + 2 yrs now + 3 yrs
lo 442 530 637 764
mid 2,210 3,094 4,331 6,064
hi 3,536 6,011 10,219 17,372

I'm inclined to lean towards the higher estimate, because the whole point of this exercise is to get more issues created in GitHub, both by GTM teams and by customers directly. On the other hand it's not like we're going to label 3,500 issues immediately out of the gate. We'll start with zero, maybe label a couple hundred in an initial migration, and then grow from there.

Plans

The two relevant plans are:

Plan Items $/yr Sync Lag
Team 150 – 2,000 288 – 1,668 ~6 minutes
Company 1,500 – 15,000 2,376 – 11,700 ~20 seconds

Conclusion

I think we should go for the low end of the Company plan. We don't know exactly what to expect but if we're successful we should see significant growth this year. Remember that every new labeled GitHub issue counts for two items in sync, so we only need to label/sync 1,000 of our existing 2,210 issues (let alone sync new issues) in order to max out the Team plan. The sub-minute lag time will be beneficial for maintaining flow state for the ICs creating tickets.

chadwhitacre commented 1 year ago

Had a call w/ sales, open questions:

  1. Is it expected behavior to change status in Jira when the label is removed/re-applied? If so, is there a workaround to prevent the Jira change?
  2. Are checkbox tasks in GitHub indeed considered "items in sync," or only if/when converted to issues?
chadwhitacre commented 1 year ago

Is it expected behavior to change status in Jira when the label is removed/re-applied?

Maaaaaybe?

If so, is there a workaround to prevent the Jira change?

They're offering a manual workaround once we have the prod flow ready.

Are checkbox tasks in GitHub indeed considered "items in sync"?

No.

chadwhitacre commented 1 year ago

One limitation with Unito is that we can't sync items after they've already been created. The workflow would have to be to recreate in GitHub and then go from there.

chadwhitacre commented 1 year ago

What happens if we edit the link in the description? πŸ€”

chadwhitacre commented 1 year ago

I clobbered the footer in both GH and Jira for https://github.com/org-3392dc2e/testing/issues/5 and found that the connection appears to survive. Pure gravy.

chadwhitacre commented 1 year ago

Working through negotiations with Unito now, making progress.

chadwhitacre commented 1 year ago

NDA signed, proceeding with Security review.

chadwhitacre commented 1 year ago

Security review turned up a couple questions that we are waiting for answers on.

In the mean time here are a few other bidirectional sync vendors:

chadwhitacre commented 1 year ago

SO CLOSE

chadwhitacre commented 1 year ago

Compliance passed! Now to purchase and configure ...

chadwhitacre commented 1 year ago

Purchased. Installed in GitHub. Need help with Jira.

chadwhitacre commented 1 year ago

Got help with Jira!

chadwhitacre commented 1 year ago

Installed for sentry! πŸ’ƒ

chadwhitacre commented 1 year ago

Add to remaining repos.

Punting on this until there is demand. sentry-javascript has a Jira label already, will need to coordinate with them on that.

chadwhitacre commented 1 year ago

Put the thing in Advanced Options to avoid status jump on unlabel.

Punting. Shouldn't be common.

chadwhitacre commented 1 year ago

Dropping getsentry/sentry#42452 from scope here so I can close. πŸ’ƒ

chadwhitacre commented 1 year ago

jk reopening to roll out to remaining repos, first one was in sentry-dart lol

chadwhitacre commented 1 year ago

I've (manually) added the label in all of the Core and SDK repos. I don't think we need this in Shared repos, nobody from GTM should care about those.

chadwhitacre commented 1 year ago

I removed the Unito GitHub App from these repos we don't care to track:

  1. snuba
  2. snuba-sdk
  3. responses
  4. symbolic
  5. symbolicator
  6. craft
  7. arroyo
  8. cdc
  9. wal2json
chadwhitacre commented 1 year ago

Confirmed they do care about Relay (makes sense since it's customer-facing).

chadwhitacre commented 1 year ago

Done rolling out to other repos.