Skip to content

Add formatIssueId to IssueTracker interface and IssueTrackerFactory #596

@NoahCardoza

Description

@NoahCardoza

Summary

Add the core formatting infrastructure: a formatIssueId method on the IssueTracker interface and a static utility on IssueTrackerFactory.

Context

This is the foundation for provider-aware issue ID formatting (Epic #595). All other issues depend on this one.

Files to Modify

  • src/lib/IssueTracker.ts — Add formatIssueId(identifier: string | number): string to interface
  • src/lib/GitHubService.ts — Implement: return `#${identifier}`
  • src/lib/LinearService.ts — Implement: return this.normalizeIdentifier(identifier)
  • src/lib/providers/jira/JiraIssueTracker.ts — Implement: return this.normalizeIdentifier(identifier)
  • src/lib/IssueTrackerFactory.ts — Add static formatIssueId(providerType: IssueTrackerProviderType, identifier: string | number): string:
    • 'github'`#${id}`
    • 'linear' / 'jira'String(id) (no prefix)
    • default → `#${id}`

Acceptance Criteria

  • formatIssueId method added to IssueTracker interface
  • All three providers implement formatIssueId correctly
  • IssueTrackerFactory.formatIssueId static method works without a provider instance
  • Unit tests cover each implementation:
    • GitHub: formatIssueId(123)"#123", formatIssueId("456")"#456"
    • Linear: formatIssueId("eng-123")"ENG-123"
    • Jira: formatIssueId("qlh-4404")"QLH-4404"
    • Factory: same expected behavior per provider type
  • pnpm build passes
  • pnpm test passes

Dependencies

None — this is the foundation issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions