Skip to content

Conversation

jgadbois
Copy link

@jgadbois jgadbois commented Feb 27, 2025

Fix multiple Linear API integration issues

  1. Fix bulk update issues functionality:

    • Update GraphQL mutation to use single 'id' parameter instead of 'ids' array
    • Modify client implementation to handle sequential updates for multiple issues
    • Update response types to reflect new API structure
  2. Add support for state names in bulk update issues:

    • Implement detection of state names vs. state IDs
    • Add functionality to fetch teams and find matching state IDs
    • Convert state names to state IDs before API calls
  3. Implement search by issue ID capability:

    • Add parsing of issue identifiers (e.g., ABC-5143)
    • Use team key and issue number filters for precise searches
  4. Fix API key authentication:

    • Improve authentication handling for API keys
    • Ensure proper validation of authentication credentials

1. Fix bulk update issues functionality:
   - Update GraphQL mutation to use single 'id' parameter instead of 'ids' array
   - Modify client implementation to handle sequential updates for multiple issues
   - Update response types to reflect new API structure

2. Add support for state names in bulk update issues:
   - Implement detection of state names vs. state IDs
   - Add functionality to fetch teams and find matching state IDs
   - Convert state names to state IDs before API calls

3. Implement search by issue ID capability:
   - Add parsing of issue identifiers (e.g., EXE-5143)
   - Use team key and issue number filters for precise searches

4. Fix API key authentication:
   - Improve authentication handling for API keys
   - Ensure proper validation of authentication credentials
@SvenMeyer
Copy link

@jgadbois You might want to have a look at and test #11

@ocasta181
Copy link
Contributor

Hey @jgadbois

Apologies for the delay in response. Had you run the test suite? It appears to fail:

andrin@Andrins-MacBook-Pro linear-mcp % npm test                                                          

> [email protected] test
> jest

 PASS  src/__tests__/auth.integration.test.ts
 PASS  src/__tests__/auth.test.ts
 FAIL  src/__tests__/graphql-client.test.ts
  ● LinearGraphQLClient › createIssue › should successfully create an issue

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    Expected: Any<String>, ObjectContaining {"input": [{"description": "Description", "teamId": "team-1", "title": "New Issue"}]}
    Received: "
      mutation CreateIssue($input: IssueCreateInput!) {
        issueCreate(input: $input) {
          success
          issue {
            id
            identifier
            title
            url
            team {
              id
              name
            }
            project {
              id
              name
            }
            parent {
              id
              identifier
              title
            }
          }
        }
      }
    ", {"input": {"description": "Description", "teamId": "team-1", "title": "New Issue"}}

    Number of calls: 1

      144 |
      145 |       // Verify single mutation call with array input
    > 146 |       expect(mockRawRequest).toHaveBeenCalledWith(
          |                              ^
      147 |         expect.any(String),
      148 |         expect.objectContaining({
      149 |           input: [input]

      at Object.<anonymous> (src/__tests__/graphql-client.test.ts:146:30)

Test Suites: 1 failed, 2 passed, 3 total
Tests:       1 failed, 3 skipped, 37 passed, 41 total
Snapshots:   0 total
Time:        1.395 s, estimated 2 s
Ran all test suites.

@ocasta181 ocasta181 marked this pull request as draft July 25, 2025 06:27
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.

3 participants