Skip to content

feat(tools): added linear tools/block#439

Merged
waleedlatif1 merged 18 commits into
mainfrom
feat/linear
May 30, 2025
Merged

feat(tools): added linear tools/block#439
waleedlatif1 merged 18 commits into
mainfrom
feat/linear

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Description

Users can now read and write Linear issues when both a team and project are specified.

Fixes #104

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Tested by configuring the Linear integration, attempting to create and read issues, Verified that issue creation and retrieval work as expected when all required fields are provided.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel

vercel Bot commented May 30, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2025 6:25am
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2025 6:25am

@waleedlatif1 waleedlatif1 changed the title feat/linear: added linear tools/block feat(tools): added linear tools/block May 30, 2025

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

Added Linear integration to enable reading and creating issues through the platform, with team and project selection capabilities and OAuth authentication support.

  • Implemented GraphQL-based Linear API integration in /apps/sim/tools/linear/ with separate tools for reading and creating issues
  • Added Linear OAuth configuration in lib/oauth.ts and lib/auth.ts with proper scopes and user info handling
  • Created UI components for team/project selection in /apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/project-selector/
  • Added API routes for Linear teams and projects under /apps/sim/app/api/tools/linear/
  • Comprehensive documentation added in /apps/docs/content/docs/tools/linear.mdx with usage instructions and API specifications

20 files reviewed, 27 comments
Edit PR Review Bot Settings | Greptile

Comment thread apps/sim/app/api/tools/linear/teams/route.ts
Comment thread apps/sim/app/api/tools/linear/teams/route.ts
Comment thread apps/sim/lib/env.ts
Comment thread apps/sim/tools/registry.ts
Comment on lines +67 to +74
issues: (data.data.issues.nodes as LinearIssue[]).map((issue) => ({
id: issue.id,
title: issue.title,
description: issue.description,
state: issue.state,
teamId: issue.teamId,
projectId: issue.projectId,
})),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

logic: Response mapping is incorrect - accessing issue.teamId and issue.projectId directly will be undefined since the GraphQL response nests these under team.id and project.id

Suggested change
issues: (data.data.issues.nodes as LinearIssue[]).map((issue) => ({
id: issue.id,
title: issue.title,
description: issue.description,
state: issue.state,
teamId: issue.teamId,
projectId: issue.projectId,
})),
issues: (data.data.issues.nodes as LinearIssue[]).map((issue) => ({
id: issue.id,
title: issue.title,
description: issue.description,
state: issue.state,
teamId: issue.team.id,
projectId: issue.project.id,
})),

Comment on lines +15 to +22
interface LinearTeamSelectorProps {
value: string
onChange: (teamId: string, teamInfo?: LinearTeamInfo) => void
credential: string
label?: string
disabled?: boolean
showPreview?: boolean
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: showPreview prop is defined but never used in the component. Either implement the preview functionality or remove the unused prop.

return {
success: false,
output: { issues: [] },
error: data.errors.map((e: any) => e.message).join('; '),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Using any type for error mapping is unsafe. Consider defining proper error types from Linear API

id: issue.id,
title: issue.title,
description: issue.description,
state: issue.state,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

logic: state is passed through directly but the type expects a string - should be issue.state.name based on the query

Suggested change
state: issue.state,
state: issue.state.name,

@waleedlatif1 waleedlatif1 merged commit 88d8a1b into main May 30, 2025
6 checks passed
@waleedlatif1 waleedlatif1 mentioned this pull request May 30, 2025
12 tasks
@waleedlatif1 waleedlatif1 deleted the feat/linear branch May 30, 2025 07:37
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.

[REQUEST] Linear Tools/Block

2 participants