feat(api): add Linear tRPC discovery endpoints#1105
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
approved these changes
Apr 14, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM — Clean addition of 5 Linear discovery endpoints that faithfully follow the established Trello/JIRA pattern in this router.
What I verified:
- All 5 endpoints use
protectedProcedure(auth),wrapIntegrationCall(error handling), andwithLinearCredentials(credential scoping) — consistent with the Trello and JIRA counterparts. linearCredsInputvalidatesapiKeywithz.string().min(1), matching theLinearCredentialstype ({ apiKey: string }) insrc/linear/types.ts.- The
withLinearCredshelper follows the same shape aswithTrelloCredsandwithJiraCreds. ByProjectvariants correctly callverifyProjectOrgAccessbefore credential resolution, throwNOT_FOUNDon missing credentials, and wrap the Linear API call inwrapIntegrationCall.linearTeamDetailsandlinearTeamDetailsByProjectcorrectly usePromise.allfor parallel fetching of states and labels (same pattern astrelloBoardDetailsfetching lists/labels/customFields).verifyLinearcorrectly projects only{ id, name, displayName }from thegetMe()response, matching theLinearUserinterface.- Test coverage is comprehensive: auth (UNAUTHORIZED), success paths, error wrapping (BAD_REQUEST), input validation (empty strings), org access denial (FORBIDDEN), and missing credentials (NOT_FOUND).
- All CI checks pass.
🕵️ claude-code · claude-opus-4-6 · run details
5 tasks
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.
Summary
integrationsDiscoveryRouterfollowing the established Trello/JIRA patternverifyLinear,linearTeams,linearTeamsByProject,linearTeamDetails, andlinearTeamDetailsByProjectwithLinearCredshelper function consistent with the existingwithTrelloCreds/withJiraCredspatternwrapIntegrationCall, and covered by unit testsTrello card: https://trello.com/c/69deb08491c7cec4bca301fe
Endpoints Added
verifyLinear{ apiKey }linearClient.getMe(), returns{ id, name, displayName }linearTeams{ apiKey }linearClient.getTeams(), returns team arraylinearTeamsByProject{ projectId }linearTeamDetails{ apiKey, teamId }getTeamWorkflowStates + getTeamLabels, returns{ states, labels }linearTeamDetailsByProject{ projectId, teamId }{ states, labels }Test plan
verifyLinear— success path returnsid/name/displayName, API failure →BAD_REQUEST, emptyapiKey→ validation error, unauthenticated →UNAUTHORIZEDlinearTeams— success path returns team array, API failure →BAD_REQUEST, unauthenticated →UNAUTHORIZEDlinearTeamsByProject— success with stored creds, missing credential →NOT_FOUND, org access denied →FORBIDDEN, API failure →BAD_REQUEST, unauthenticated →UNAUTHORIZEDlinearTeamDetails— success returns{ states, labels }, API failure →BAD_REQUEST, emptyteamId→ validation error, unauthenticated →UNAUTHORIZEDlinearTeamDetailsByProject— success with stored creds, missing credential →NOT_FOUND, org access denied →FORBIDDEN, emptyteamId→ validation error, API failure →BAD_REQUEST, unauthenticated →UNAUTHORIZED🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details