Skip to content

improvement(linear): cleanup linear checks#2075

Merged
icecrasher321 merged 1 commit intostagingfrom
improvement/linear
Nov 20, 2025
Merged

improvement(linear): cleanup linear checks#2075
icecrasher321 merged 1 commit intostagingfrom
improvement/linear

Conversation

@icecrasher321
Copy link
Collaborator

Summary

  • Fix archive graphql query to use non-deprecated projectDelete mutation
  • Cleanup undefined + null checks

Type of Change

  • Bug fix

Testing

No functional change

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.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Nov 20, 2025 9:29am

@icecrasher321 icecrasher321 merged commit 304cafe into staging Nov 20, 2025
9 checks passed
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 20, 2025

Greptile Overview

Greptile Summary

This PR refactors Linear integration tools to improve code quality and fix a deprecation issue. The changes migrate from the deprecated projectArchive mutation to projectDelete, and standardize null/undefined checks across 31 files using the idiomatic != null pattern.

Key Changes:

  • Updated archive_project.ts to use projectDelete mutation instead of deprecated projectArchive, and added entity ID field to response
  • Replaced verbose null checks (!== undefined && !== null) with concise != null across all Linear tool files
  • Maintained identical behavior - the loose equality != null catches both null and undefined values
  • Empty string checks (!== '') remain separate and unchanged for proper validation

The refactoring is purely stylistic with no functional changes to validation logic. All tools maintain the same input filtering behavior.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects a well-executed refactoring with consistent patterns applied across all files. The != null pattern is idiomatic JavaScript/TypeScript and semantically equivalent to the previous explicit checks. The GraphQL mutation update fixes a deprecation issue with proper response handling. No logical changes to validation behavior, making this a safe cleanup PR.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/tools/linear/archive_project.ts 5/5 Updated GraphQL mutation from deprecated projectArchive to projectDelete, added entity ID field to response
apps/sim/tools/linear/create_customer.ts 5/5 Simplified null checks for all optional fields (domains, externalIds, logoUrl, ownerId, revenue, size, statusId, tierId)
apps/sim/tools/linear/create_issue.ts 5/5 Simplified null checks for projectId and description fields
apps/sim/tools/linear/update_issue.ts 5/5 Simplified null checks for title, description, stateId, assigneeId, priority, estimate, and labelIds fields
apps/sim/tools/linear/update_project.ts 5/5 Simplified null checks for name, description, leadId, startDate, targetDate, and priority fields

Sequence Diagram

sequenceDiagram
    participant Client as API Client
    participant Tool as Linear Tool
    participant Validator as Input Validator
    participant Linear as Linear GraphQL API

    Note over Client,Linear: Archive Project Flow (Updated Mutation)
    Client->>Tool: Call archive_project(projectId)
    Tool->>Validator: Check projectId != null
    alt projectId is null/undefined
        Validator-->>Client: Error: Missing projectId
    else projectId valid
        Validator->>Linear: GraphQL mutation projectDelete(id)
        Note over Linear: Uses projectDelete instead of<br/>deprecated projectArchive
        Linear-->>Tool: { success, entity: { id } }
        Tool-->>Client: { success, projectId }
    end

    Note over Client,Linear: Create/Update Operations Flow (Simplified Checks)
    Client->>Tool: Call create/update with params
    Tool->>Validator: Check optional fields != null
    Note over Validator: Simplified from:<br/>(x !== undefined && x !== null)<br/>to: (x != null)
    Validator->>Validator: Filter out null/undefined values
    Validator->>Validator: Validate empty strings separately
    Validator->>Linear: GraphQL mutation with filtered input
    Linear-->>Tool: Response with created/updated entity
    Tool-->>Client: Return formatted response
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.

31 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 deleted the improvement/linear branch November 20, 2025 19:19
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.

1 participant