Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • update required fields for linear

Type of Change

  • Bug fix

Testing

Tested all tools manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Nov 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Building Building Preview Comment Nov 20, 2025 5:17am

@waleedlatif1 waleedlatif1 merged commit f570592 into staging Nov 20, 2025
3 of 4 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/linear branch November 20, 2025 05:17
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 20, 2025

Greptile Summary

  • Updated required field configurations across Linear tools to make certain fields optional (projectId in create_issue, teamId/projectId in read_issues, body in update_comment) and others required (title in create_attachment/update_attachment)
  • Enhanced input validation to exclude null and empty string values from GraphQL mutations, preventing invalid data from being sent to Linear API
  • Improved error handling across all tools with explicit checks for GraphQL errors and missing data in responses

Confidence Score: 3/5

  • This PR is mostly safe but contains one logical error that needs fixing
  • The PR successfully improves field validation and error handling across 25 Linear tool files, but archive_project.ts has a bug where it references a GraphQL field that isn't queried
  • Pay close attention to apps/sim/tools/linear/archive_project.ts which contains a logic error

Important Files Changed

Filename Overview
apps/sim/tools/linear/archive_project.ts Improved error handling but references result.entity?.id which is not in the GraphQL query response
apps/sim/tools/linear/create_issue.ts Changed projectId from required to optional, improved GraphQL mutation structure and error handling
apps/sim/tools/linear/read_issues.ts Made teamId and projectId optional filters, updated GraphQL query to support dynamic filtering with improved error handling
apps/sim/blocks/blocks/linear.ts Added conditional required fields based on operation type for better UX in blocks UI

Sequence Diagram

sequenceDiagram
    participant User
    participant LinearTool
    participant LinearAPI
    
    User->>LinearTool: Call Linear operation (e.g., create_issue)
    LinearTool->>LinearTool: Validate required fields
    LinearTool->>LinearTool: Build input object (exclude null/empty optional fields)
    LinearTool->>LinearAPI: Send GraphQL mutation/query
    LinearAPI-->>LinearTool: Return response with data/errors
    LinearTool->>LinearTool: Check for errors in response
    alt Has errors
        LinearTool-->>User: Return error message
    else Success
        LinearTool->>LinearTool: Extract result data
        LinearTool-->>User: Return formatted output
    end
Loading

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.

25 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

success: data.data.projectArchive.success,
projectId: response.ok ? data.data.projectArchive.success : '',
success: result.success,
projectId: result.entity?.id || '',
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: result.entity?.id will always be undefined since the GraphQL query on line 40-45 doesn't request the entity field. Either add entity { id } to the query or use params.projectId here instead.

Suggested change
projectId: result.entity?.id || '',
projectId: params.projectId,
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/linear/archive_project.ts
Line: 77:77

Comment:
**logic:** `result.entity?.id` will always be undefined since the GraphQL query on line 40-45 doesn't request the `entity` field. Either add `entity { id }` to the query or use `params.projectId` here instead.

```suggestion
        projectId: params.projectId,
```

How can I resolve this? If you propose a fix, please make it concise.

@waleedlatif1 waleedlatif1 mentioned this pull request Nov 20, 2025
10 tasks
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.

2 participants