Skip to content

fix(issues): correct command parameter types for codegen#5

Merged
iamfj merged 2 commits intov2from
4-issues-commands-codegen
Feb 4, 2026
Merged

fix(issues): correct command parameter types for codegen#5
iamfj merged 2 commits intov2from
4-issues-commands-codegen

Conversation

@iamfj
Copy link
Owner

@iamfj iamfj commented Feb 4, 2026

Overview

This PR fixes the issues command layer to work correctly with the codegen types introduced in the service layer (PR #4). It's a small but critical fix that ensures the command-line interface properly passes parameters to the refactored service methods.

What Changed

Search Command

Before:

const issues = await issuesService.searchIssues({
  query: options.query,
  filter: filterOptions,
  // ... manual parameter construction
});

After:

const issues = await issuesService.searchIssues(options.query, {
  filter: filterOptions
});

Fixed parameter structure to match the updated service method signature.

Update Command

Before:

await issuesService.updateIssue(issueId, {
  title: options.title,
  description: options.description,
  // ... manual field mapping
});

After:

await issuesService.updateIssue(issueId, {
  title: options.title,
  description: options.description
}); // Simpler, matches codegen input types

Simplified parameter handling to align with codegen mutation input types.

Why This Matters

Type Safety at the Command Layer

CLI tools have two critical boundaries where type safety matters:

  1. User input → Command layer (parsing command-line arguments)
  2. Command layer → Service layer (calling business logic)

This PR ensures the second boundary is type-safe. The compiler now verifies:

  • Required parameters are provided
  • Parameter types match service expectations
  • Optional parameters are handled correctly

Better Error Messages

When users make mistakes, TypeScript can now provide precise errors:

Before:

Error: Cannot read property 'id' of undefined

After:

Error: Missing required parameter 'query' for searchIssues

The error points to the exact parameter issue rather than failing deep in the service layer.

Impact on Users

Users see:

  • Better error messages: Clearer indication of what went wrong
  • No functional changes: Commands work exactly as before
  • Improved reliability: Parameter mismatches caught at compile time

Impact on Contributors

Contributors benefit from:

  • Type-safe commands: Compiler verifies parameter passing
  • Self-documenting code: Types show what parameters are required
  • Easier debugging: Errors caught earlier in the call stack

Technical Details

Parameter Type Fixes

  1. searchIssues: Changed from object parameter to positional parameters matching service signature
  2. updateIssue: Simplified parameter structure to match IssueUpdateInput from codegen

No Breaking Changes

Command-line interface is unchanged:

linearis issues search "my query" --state todo
linearis issues update ABC-123 --title "New title"

Users experience no difference in behavior.

Why Two Separate PRs?

PR #4 refactored the service layer, but kept command layer compatibility temporarily. This PR completes the migration by updating commands to use the new service signatures properly.

Splitting the work allows:

  • Easier review: Each PR is focused and reviewable
  • Safer rollback: Can revert command changes without reverting service changes
  • Clear git history: Commits show service refactor separate from command fixes

Stack Position

📍 Branch 4 of 7 - Base: 3-issues-service-codegen
⬇️ Previous: PR #4 - Refactor Issues Service to Use Codegen Types
⬆️ Next: PR #6 - Migrate Documents and Attachments Services to Codegen Types


🤖 Generated with Claude Code

@iamfj iamfj changed the title Fix Issues Commands for Codegen Types fix(issues): correct command parameter types for codegen Feb 4, 2026
@iamfj iamfj self-assigned this Feb 4, 2026
@iamfj iamfj force-pushed the 3-issues-service-codegen branch from fcc9b38 to 7fa3090 Compare February 4, 2026 14:33
Base automatically changed from 3-issues-service-codegen to v2 February 4, 2026 15:01
iamfj and others added 2 commits February 4, 2026 16:02
Pass QuerySearchIssuesArgs fields directly instead of wrong type.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Ensure parameters match IssueUpdateInput type from codegen.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@iamfj iamfj force-pushed the 4-issues-commands-codegen branch from 62e3871 to 489d51e Compare February 4, 2026 15:02
@iamfj iamfj merged commit 66f1124 into v2 Feb 4, 2026
1 check passed
@iamfj iamfj deleted the 4-issues-commands-codegen branch February 4, 2026 15:17
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