Skip to content

feat(006/4): linear migrated — all PM providers now on manifest#1128

Merged
zbigniewsobiecki merged 2 commits intodevfrom
feat/006-migrate-linear
Apr 16, 2026
Merged

feat(006/4): linear migrated — all PM providers now on manifest#1128
zbigniewsobiecki merged 2 commits intodevfrom
feat/006-migrate-linear

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

Plan 006/4 of spec 006: Linear is the third and final PM provider migrated onto the manifest pattern. All three providers (Trello, JIRA, Linear) are now on the manifest.

No operator-visible changes. Every PM wizard, webhook flow, trigger dispatch, and ack-comment path is byte-for-byte identical to dev.

What's landed

Backend

  • src/integrations/pm/linear/manifest.ts — wires LinearIntegration, LinearRouterAdapter, 3 Linear trigger handlers, LinearPlatformClient. Uses the shared makeHmacSha256Verifier({ headerName: 'linear-signature' }) factory — no prefix.
  • src/integrations/pm/index.ts — appends the Linear barrel import.
  • src/triggers/builtins.tsregisterLinearTriggers call gone. Every PM provider contributes triggers via manifest iteration. SCM (GitHub) + alerting (Sentry) stay on legacy per spec scope.
  • src/router/worker-env.ts::extractProjectIdFromJob — Linear branch removed. The function now has zero PM-specific branches — everything flows through extractProjectIdFromJobViaRegistry.

Shared-helper adoption (collapses the divergent copies that shipped production incidents)

  • src/router/platformClients/linear.ts — switched to linearAuthHeader from _shared/auth-headers. In-file Authorization construction deleted.
  • src/router/bot-identity-resolvers.ts — same adoption. Both call sites now impossible to diverge from the canonical helper.
  • src/pm/linear/adapter.ts::resolveLabelId — delegates to _shared/label-id-resolver.resolveLabelId. Private helper + UUID_PATTERN constant deleted. Single source of truth for the UUID-validation rule that lost cascade-processing labels.

Frontend

  • web/src/components/projects/pm-providers/linear/wizard.tslinearProviderWizard composes useLinearDiscovery + useLinearLabelCreation inside useProviderHooks, plus the creatingSlot state + onCreateLabel / onCreateAllMissingLabels handlers using LINEAR_LABEL_DEFAULTS.
  • web/src/components/projects/pm-wizard.tsxWith all 3 providers on the manifest, the non-manifest fallback path is deleted entirely. Every PM provider renders via <ManifestProviderWizardSection>. The parent wizard no longer owns any provider-specific React hooks, ephemeral state, or handlers. Three state.provider === '...' branches collapse to clean single-path renders.

Tests

  • 7808 / 7808 tests pass
  • 15 new Linear manifest tests
  • Conformance harness now runs 44 assertions (11 × TestProvider + Trello + JIRA + Linear) — the entire spec AC chore: add .nvmrc for Node.js 22 #2 ("harness exercises every registered provider") is now fully delivered
  • Existing Linear unit + integration tests all green unchanged

Lint + typecheck + backend build + web build all clean.

Deferred to plan 006/5 (same pattern as 006/2, 006/3)

  • Removing every PM provider from src/integrations/bootstrap.ts. The ~dozen pmRegistry.get('trello' | 'jira' | 'linear') call sites (webhook handlers, manual runners, credential scoping, lifecycle) need migration to pmProviderRegistry.get(id)?.pmIntegration. Plan 006/5 does this atomically.
  • Consolidating createLinearLabel / createLinearLabels (and Trello/JIRA equivalents) into pm.discovery.createLabel. Additive, not behavior-changing.

After this PR merges

Spec AC coverage:

Post-merge verification

  • Local: full npm test green; lint + typecheck + backend build + web build all clean
  • After deploy-dev: exercise the Linear wizard end-to-end — team selection, status mappings, label creation via "Create All Missing", save. Byte-for-byte identical expected.
  • Trigger a Linear webhook (status change, comment mention, label added) and confirm agent dispatch fires via the manifest path.

🤖 Generated with Claude Code

zbigniewsobiecki and others added 2 commits April 16, 2026 13:29
Completes the third and final PM-provider migration of spec 006. All
three providers (Trello, JIRA, Linear) are now on the manifest pattern.

Backend:
- src/integrations/pm/linear/manifest.ts — wires LinearIntegration,
  LinearRouterAdapter, 3 Linear trigger handlers, LinearPlatformClient.
  verifyWebhookSignature uses the shared makeHmacSha256Verifier factory
  with header 'linear-signature' (no prefix).
- src/integrations/pm/linear/index.ts — side-effect registration.
- src/integrations/pm/index.ts — appends the linear barrel import.
- src/triggers/builtins.ts — registerLinearTriggers call gone; every
  PM provider now contributes triggers via the manifest registry. SCM +
  alerting stay on legacy per spec scope.
- src/router/worker-env.ts — Linear branch of extractProjectIdFromJob
  removed; the function now has zero PM-specific branches.

Shared-helper adoption (collapses divergent copies that caused the
session's production incidents):
- src/router/platformClients/linear.ts — switched to linearAuthHeader
  from _shared/auth-headers. In-file Authorization construction
  deleted.
- src/router/bot-identity-resolvers.ts — same adoption.
- src/pm/linear/adapter.ts::resolveLabelId — delegates to
  _shared/label-id-resolver. Private helper + UUID_PATTERN constant
  deleted. Single source of truth for the UUID-validation rule.

Frontend:
- web/src/components/projects/pm-providers/linear/wizard.ts —
  linearProviderWizard composes useLinearDiscovery +
  useLinearLabelCreation inside useProviderHooks, plus the creatingSlot
  state + onCreateLabel / onCreateAllMissingLabels handlers using
  LINEAR_LABEL_DEFAULTS.
- web/src/components/projects/pm-wizard.tsx — with all 3 providers on
  the manifest, the non-manifest fallback path is deleted entirely.
  Every PM provider renders via ManifestProviderWizardSection. The
  parent wizard no longer owns provider-specific hooks, state, or
  handlers.

Tests: 7808/7808 pass. 15 new Linear manifest tests. Conformance
harness runs 44 assertions (11 × TestProvider + Trello + JIRA + Linear).
Build (backend + web), typecheck, lint all clean.

Same deferrals as 006/2 and 006/3 (documented in .done plan):
- bootstrap.ts Linear block stays until plan 006/5 migrates the
  ~dozen pmRegistry.get(...) callers.
- createLinearLabel / createLinearLabels tRPC endpoints kept (additive
  consolidation only, not behavior-changing).

Docs: README migration status updated. CHANGELOG entry added.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit aae4d45 into dev Apr 16, 2026
8 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the feat/006-migrate-linear branch April 16, 2026 13:44
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

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

Files with missing lines Patch % Lines
src/router/bot-identity-resolvers.ts 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

1 participant