Skip to content

feat(linear): add getTeams, getTeamWorkflowStates, getTeamLabels discovery methods#1104

Merged
aaight merged 1 commit intodevfrom
feature/linear-discovery-methods
Apr 14, 2026
Merged

feat(linear): add getTeams, getTeamWorkflowStates, getTeamLabels discovery methods#1104
aaight merged 1 commit intodevfrom
feature/linear-discovery-methods

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Apr 14, 2026

Summary

  • Add linearClient.getTeams() — returns all teams accessible by API key as LinearTeam[]
  • Add linearClient.getTeamWorkflowStates(teamId) — returns workflow states for a team as LinearWorkflowState[]
  • Add linearClient.getTeamLabels(teamId) — returns labels for a team as LinearLabel[]

These discovery methods are required by the dashboard PM wizard to let users select a team and map workflow states during Linear setup.

Implementation Details

  • Follows the existing GraphQL query + mapper pattern used by getIssue() / listIssues() and other methods
  • Reuses existing GraphQL field fragments (TEAM_FIELDS, STATE_FIELDS, LABEL_FIELDS) and existing mappers (mapTeam, mapState, mapLabel)
  • Imports LinearTeam and LinearWorkflowState types from src/linear/types.ts (types already existed)
  • No changes to src/linear/types.ts — all required types were already defined

Tests

  • 18 new unit tests in tests/unit/pm/linear/client.test.ts
  • Coverage for all 3 methods: success cases, empty results, missing field defaults, variable passing, GraphQL errors, and HTTP errors

Trello Card

https://trello.com/c/4vtxTX0F/601-as-a-developer-i-want-linear-discovery-methods-in-the-client-so-that-the-dashboard-can-list-teams-and-workflow-states

🕵️ claude-code · claude-sonnet-4-6 · run details

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — Clean, pattern-consistent addition of three discovery methods that reuse existing GraphQL fragments, mappers, and the linearGraphQL helper. Implementation follows the exact same conventions as getIssue()/listIssues() and other methods in the file. Types (LinearTeam, LinearWorkflowState) were already defined in types.ts, so no type changes were needed. Test coverage is thorough (18 tests covering success, empty results, missing field defaults, variable passing, GraphQL errors, and HTTP errors). All CI checks pass.

🕵️ claude-code · claude-opus-4-6 · run details

@aaight aaight merged commit e431f57 into dev Apr 14, 2026
9 checks passed
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.

2 participants