Skip to content

feat(linear): register Linear in bootstrap and add DB lookup functions#1097

Merged
aaight merged 1 commit intodevfrom
feature/linear-bootstrap-db-lookups
Apr 14, 2026
Merged

feat(linear): register Linear in bootstrap and add DB lookup functions#1097
aaight merged 1 commit intodevfrom
feature/linear-bootstrap-db-lookups

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Apr 14, 2026

Summary

  • Registers LinearIntegration in both pmRegistry and integrationRegistry in src/integrations/bootstrap.ts (already done in prior work, verified idempotent with getOrNull guards)
  • Adds LinearIntegrationConfig interface and updates extractIntegrationConfigs(), MapProjectInput, and mapProjectRow() in src/db/repositories/configMapper.ts to handle linear config
  • Adds linearTeamIdWhereClause, findProjectByLinearTeamIdFromDb(), and findProjectWithConfigByLinearTeamId() in src/db/repositories/configRepository.ts
  • Adds projectByLinearTeamId cache in src/config/configCache.ts
  • Adds findProjectByLinearTeamId() and loadProjectConfigByLinearTeamId() with cache support in src/config/provider.ts
  • Exports LinearPMProvider from src/pm/index.ts (already present)
  • Ensures linear optional schema entry exists in ProjectConfigSchema in src/config/schema.ts (already present)

Trello card: https://trello.com/c/r38vn5My/594-as-a-developer-i-want-linear-registered-in-bootstrap-and-db-lookups-so-that-the-system-can-load-linear-project-configs

Test plan

  • TypeScript compiles cleanly (npm run typecheck passes)
  • All unit tests pass (npm test — 7323 tests across 372 files)
  • Lint passes (only pre-existing complexity warnings in unrelated files)
  • New unit tests added for:
    • configMapper: extractIntegrationConfigs extracts linear config, mapProjectRow sets pm.type to linear and builds linear config
    • configRepository: loads Linear integration, findProjectByLinearTeamIdFromDb returns project by team ID
    • provider: findProjectByLinearTeamId caches and delegates to DB lookup correctly

🤖 Generated with Claude Code

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 76.66667% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/config/configCache.ts 44.44% 5 Missing ⚠️
src/config/provider.ts 64.28% 5 Missing ⚠️
src/db/repositories/configRepository.ts 77.77% 4 Missing ⚠️

📢 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, well-structured addition that follows the existing Jira/Trello patterns precisely.

Summary

This PR adds Linear support to the config layer (DB lookups, caching, mapper) by replicating the exact patterns already established for Trello and Jira. All CI checks pass. The changes are consistent with the codebase conventions.

Verified:

  • LinearIntegrationConfig interface matches the Zod LinearConfigSchema in schema.ts (already present)
  • linearTeamIdWhereClause follows the same subquery pattern as boardIdWhereClause and jiraProjectKeyWhereClause
  • Cache layer (configCache.ts) follows the same get/set/clear pattern as other project lookup caches
  • Provider layer (provider.ts) follows the same cache-then-DB pattern as findProjectByJiraProjectKey and findProjectByBoardId
  • PM type derivation priority (jira > linear > trello) is a reasonable default — Jira takes precedence if both exist, Linear before Trello
  • Bootstrap registration (bootstrap.ts) and schema (schema.ts) already had Linear support from prior work
  • Tests cover cache hit, cache miss with DB lookup, and cache-undefined-on-not-found for the provider; mapper tests cover extraction, PM type derivation, and config building; repository tests cover the DB lookup path

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

@aaight aaight merged commit aa0c4f7 into dev Apr 14, 2026
8 of 9 checks passed
zbigniewsobiecki added a commit that referenced this pull request Apr 18, 2026
Task 4: src/integrations/entrypoint.ts centralises every PM/SCM/alerting
registration barrel. Router, worker, CLI bootstrap, and dashboard all
side-effect-import this single file — no per-surface list of imports that
can drift when a new provider is added. Previously dashboard.ts didn't
register any PM providers at all, which is also fixed here.

Task 5: tests/unit/integrations/entrypoint-usage.test.ts grep-asserts the
invariant that every process entry file imports src/integrations/entrypoint.js.
Missing this import was the root cause of #1097, #1118, #1131, #1134 —
the test references those bug numbers in its failure message.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
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