fix(commands): resolve --assignee to UUID in issues create/update#50
Merged
fix(commands): resolve --assignee to UUID in issues create/update#50
Conversation
Resolves user identifiers (display name, email, or UUID) to UUIDs via the Linear SDK, following the same pattern as existing resolvers. Lookup order: UUID passthrough → display name (case-insensitive) → email (case-insensitive). Throws multipleMatchesError when name is ambiguous, notFoundError when no match exists. Closes #47 Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
The --assignee option was passed directly to assigneeId without resolution, causing GraphQL validation errors when given a name or email instead of a UUID. Wire both create and update through the new resolveUserId resolver. Closes #47 Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
Add command-level tests that drive the CLI through Commander and verify resolveUserId is called with the correct input and its result flows into the service layer. Covers create with name, create with email, update with name, and omitted-assignee cases. Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix for
--assigneeoption onissues createandissues updatefailing with a GraphQL validation error when given a human-friendly name or email instead of a UUID.Problem
The
--assigneevalue was passed directly toinput.assigneeIdwithout resolution. Every other identifier option (--team,--project,--labels,--cycle,--status,--parent-ticket,--project-milestone) goes through a dedicated resolver, but--assigneewas missing one, causing:{"error": "GraphQL request failed: Argument Validation Error - assigneeId must be a UUID."}Solution
resolveUserId()resolver (src/resolvers/user-resolver.ts) usingLinearSdkClient, following the established resolver patternmultipleMatchesErrorwhen name is ambiguous,notFoundErrorwhen no match existsissues createandissues updatecommandsTesting
resolveUserIdis called with correct args and its UUID flows intocreateIssue/updateIssuefor both name and email inputs, plus omitted-assignee casesChecklist
Closes #47