Skip to content

feat: Linear integration / destination #30917

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

Merged
merged 19 commits into from
Apr 11, 2025
Merged

Conversation

daibhin
Copy link
Contributor

@daibhin daibhin commented Apr 8, 2025

Problem

Let customers send issues from PostHog to their issue tracking tool

Changes

linear-destination

  • Update OAuth flow to support GraphQL APIs
  • Ability to fetch teams
  • TODO: Add template for Linear destination
  • TODO: Create from issue page (follow up PR)
  • TODO: There might be one bug left in the Hog template but I'm not certain if my code just wasn't correctly reloading

daibhin added 3 commits April 8, 2025 09:37
author David Newell <david@posthog.com> 1743427919 +0100
committer David Newell <david@posthog.com> 1744101366 +0100

feat: error tracking integrations
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR introduces a new Linear integration that enables fetching and displaying Linear teams, adds support for Linear’s OAuth via GraphQL, and updates both frontend and backend to integrate with PostHog's existing patterns.

  • Added kea logic in /frontend/src/lib/integrations/linearIntegrationLogic.ts for loading Linear teams.
  • Updated /frontend/src/lib/integrations/integrationsLogic.ts to map the new 'linear' kind and filter integrations.
  • Introduced LinearTeamPicker in /frontend/src/lib/integrations/LinearIntegrationHelpers.tsx for team selection.
  • Extended API support in /frontend/src/lib/api.ts to fetch Linear team data.
  • Added Linear OAuth support and team fetching in backend endpoints and settings.

13 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

16 snapshot changes in total. 0 added, 16 modified, 0 deleted:

  • chromium: 0 added, 16 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

github-actions bot commented Apr 8, 2025

Size Change: +149 B (0%)

Total Size: 13.2 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 13.2 MB +149 B (0%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

16 snapshot changes in total. 0 added, 16 modified, 0 deleted:

  • chromium: 0 added, 16 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Comment on lines +332 to +337
if oauth_config.token_info_graphql_query:
token_info_res = requests.post(
oauth_config.token_info_url,
headers={"Authorization": f"Bearer {config['access_token']}"},
json={"query": oauth_config.token_info_graphql_query},
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PostHog/team-cdp this is probably the most interesting part for ya'll. Linear only has a GraphQL API so I had to change the request type slightly to exchange the token

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the hipsters api

@daibhin daibhin requested review from a team, hpouillot and oliverb123 April 9, 2025 16:37
@daibhin daibhin changed the title feat: Linear integration feat: Linear integration / destination Apr 9, 2025
Copy link
Member

@MarconLP MarconLP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good - just need to document the oauth app

import { HogFunctionTemplate, SUB_TEMPLATE_COMMON } from '../../types'

export const template: HogFunctionTemplate = {
status: 'alpha',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experimental destinations are hidden by default and can only be installed with the direct link. This should probably be beta instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually made it alpha because I wanted to test the bug I mentioned above about the Hog templating. I'm also working on a GitHub integration and some more native integrations with issues so will release them all together

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@daibhin daibhin enabled auto-merge (squash) April 11, 2025 10:02
@daibhin daibhin merged commit 803c283 into master Apr 11, 2025
108 of 109 checks passed
@daibhin daibhin deleted the err-dn/linear-integration branch April 11, 2025 10:21
frankh added a commit that referenced this pull request Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants