Skip to content

feat(integrations): add unified IntegrationModule interface and IntegrationRegistry#1021

Merged
aaight merged 1 commit intodevfrom
feature/unified-integration-module
Mar 23, 2026
Merged

feat(integrations): add unified IntegrationModule interface and IntegrationRegistry#1021
aaight merged 1 commit intodevfrom
feature/unified-integration-module

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Mar 23, 2026

Summary

  • Introduces IntegrationModule interface in src/integrations/types.ts — the category-agnostic contract every integration (PM, SCM, Alerting) must implement
  • Adds IntegrationRegistry class in src/integrations/registry.ts with register(), get(), getOrNull(), getByCategory(), all(), and hasIntegration() methods
  • Exports singleton integrationRegistry from src/integrations/index.ts
  • Adds unit tests covering all registry operations including duplicate registration handling and unknown provider errors
  • Updates vitest.config.ts to include tests/unit/integrations/** in the unit-core test project

Details

The IntegrationModule interface defines four required members:

  • type: string — unique provider identifier
  • category: IntegrationCategory — imported from existing src/config/integrationRoles.ts
  • withCredentials<T>() — run a callback within the credential scope for a project
  • hasIntegration() — check if a project has this integration fully configured

Plus optional webhook methods: parseWebhookPayload(), isSelfAuthored(), lookupProject(), extractWorkItemId().

The IntegrationRegistry follows the same pattern as the existing PMIntegrationRegistry in src/pm/registry.ts, adding getByCategory() and hasIntegration(type, projectId) for cross-cutting queries.

This is a purely additive change — no existing files are modified except vitest.config.ts (to include new test directory).

Test plan

  • All 18 new tests in tests/unit/integrations/registry.test.ts pass
  • Full unit-core test suite passes (214 files, 3995 tests)
  • TypeScript type check passes with zero errors
  • Biome lint passes with zero errors

Closes https://trello.com/c/hs3cC1F9/543-as-a-developer-i-want-unified-integrationmodule-interfaces-and-integrationregistry-so-that-all-integration-types-share-a-common

🤖 Generated with Claude Code

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/integrations/index.ts 0.00% 1 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 foundational change that follows the existing PMIntegrationRegistry pattern faithfully. The IntegrationModule interface correctly generalizes the common contract from PMIntegration, the registry implementation is sound (with the nice improvement of throwing on duplicate registration rather than silently overwriting), tests are thorough, and CI is fully green. Purely additive with no risk to existing code.

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

@aaight aaight merged commit cd010ac into dev Mar 23, 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