Skip to content

feat(006/2): trello migrated onto PM provider manifest#1126

Merged
zbigniewsobiecki merged 4 commits intodevfrom
feat/006-migrate-trello
Apr 16, 2026
Merged

feat(006/2): trello migrated onto PM provider manifest#1126
zbigniewsobiecki merged 4 commits intodevfrom
feat/006-migrate-trello

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

Plan 006/2 of spec 006: Trello is the first real provider migrated onto the manifest pattern landed in #1125.

No operator-visible changes. Trello wizard UX, webhook flow, trigger dispatch, and ack-comment behavior are byte-for-byte identical to dev.

Mechanics

Backend

  • src/integrations/pm/trello/manifest.ts — wires TrelloIntegration, TrelloRouterAdapter, all 7 Trello trigger handlers, TrelloPlatformClient. verifyWebhookSignature wraps the existing verifyTrelloSignature helper (HMAC-SHA1 of body + callbackUrl) with header-based URL reconstruction — Trello's signing scheme is distinct from the shared HMAC-SHA256 factory.
  • src/integrations/pm/index.ts + trello/index.ts — side-effect registration barrels imported from router + worker entries.
  • src/triggers/builtins.ts — iterates listPMProviders() to register Trello triggers via the manifest; the legacy registerTrelloTriggers call is removed.
  • src/router/worker-env.ts::extractProjectIdFromJob — Trello branch removed; the registry path handles it via manifest.extractProjectIdFromJob.

Frontend

  • web/src/components/projects/pm-providers/types.ts — extended ProviderWizardDefinition with an optional useProviderHooks field. The context (state, dispatch, projectId, advanceToStep) flows into the provider's hook composer so provider-specific React hooks (useTrelloDiscovery, useTrelloLabelCreation, useTrelloCustomFieldCreation) run inside the provider module, not at the wizard root.
  • web/src/components/projects/pm-providers/manifest-section.tsx — new ManifestProviderWizardSection shell component. Only mounted when a manifest is registered for the active provider, so the unconditional useProviderHooks call inside the shell satisfies React's rules-of-hooks.
  • web/src/components/projects/pm-providers/trello/wizard.tstrelloProviderWizard composes the three existing hooks and exposes combined providerHooks (onBoardSelect, boardsMutation, boardDetailsMutation, onCreateLabel, onCreateAllMissingLabels, onCreateCostField, creatingSlot, creatingCostField).
  • web/src/components/projects/pm-providers/trello/adapters.tsx — three thin adapters that destructure providerHooks into the existing TrelloCredentialsStep / TrelloBoardStep / TrelloFieldMappingStep prop shape. The existing step implementations stay unchanged.
  • web/src/components/projects/pm-wizard.tsx — removed Trello-specific hook instantiations and three per-step state.provider === 'trello' branches. Top of the component: manifestDef = getProviderWizard(state.provider). When truthy, <ManifestProviderWizardSection /> renders; otherwise the legacy JIRA/Linear branches fire.

Contract adjustments surfaced during TDD

  • Dropped the redundant parseWebhookPayload field from PMProviderManifest (had the wrong return type in 006/1; duplicated routerAdapter.parseWebhook).
  • Relaxed the conformance harness's platform-client assertion to the actual PlatformCommentClient contract — postComment + deleteComment only; updateComment / postReaction are provider extensions.
  • registerTestProvider is additive now (no longer resets the registry), so the conformance harness runs against both TestProvider and every real provider side-by-side — satisfying spec AC chore: add .nvmrc for Node.js 22 #2.
  • Six existing test files gain a side-effect import '../../../src/integrations/pm/trello/index.js' so the Trello manifest is registered before they exercise Trello-dependent code.

Deferred to plan 006/5 (documented in the .done plan)

  • Removing Trello from src/integrations/bootstrap.ts. Nine-plus call sites of pmRegistry.get('trello') still rely on the legacy registration (webhook-handlers, manual runners, lifecycle, credential scoping, github adapter). Plan 006/5 migrates those callers and deletes both registrations together.
  • Consolidating createTrelloLabel / createTrelloLabels tRPC endpoints into pm.discovery.createLabel. Additive cleanup only — useTrelloLabelCreation still works via the legacy endpoints.

Tests

  • 7755 / 7755 tests pass
  • 15 new Trello manifest tests (identity, credentialRoles, HMAC-SHA1 happy/tamper/missing-header/opt-out paths, extractProjectIdFromJob, platform client, routerAdapter/pmIntegration wiring, triggerHandlers list)
  • Conformance harness now runs 22 tests (11 × TestProvider + Trello)
  • All existing Trello unit, integration, and wizard SSR tests pass unchanged

Lint + typecheck + build clean.

Post-merge verification

  • Local: full npm test green (7755/7755); lint + typecheck + build clean
  • After deploy-dev: exercise the Trello wizard end-to-end — selecting a board, mapping labels, creating missing labels, saving. Must behave identically to pre-merge.
  • Trigger a Trello webhook (e.g. card move) and confirm agent dispatch fires via the manifest path (router log shows trigger match; worker spawns; ack comment posts).

🤖 Generated with Claude Code

zbigniewsobiecki and others added 4 commits April 16, 2026 08:42
Adds src/integrations/pm/trello/ with:
- manifest.ts: PMProviderManifest wiring TrelloIntegration, TrelloRouterAdapter,
  all 7 Trello trigger handlers, and TrelloPlatformClient. verifyWebhookSignature
  wraps the existing verifyTrelloSignature (HMAC-SHA1 of body+callbackUrl) with
  Host/X-Forwarded-Proto header reconstruction — no shared factory because
  Trello's signing scheme is unique among providers.
- index.ts: side-effect module that calls registerPMProvider(trelloManifest).

src/integrations/pm/index.ts: new barrel importing ./trello/index.js for
the side effect. Plans 006/3 and 006/4 append jira + linear.

Contract adjustments surfaced during TDD:
- Dropped parseWebhookPayload field from PMProviderManifest (redundant with
  routerAdapter.parseWebhook; had wrong return type in 006/1). Each caller
  uses the appropriate one: router uses routerAdapter, PM-domain code uses
  pmIntegration.parseWebhookPayload.
- Relaxed conformance harness's platform-client assertion from 3 methods to
  2 (postComment + deleteComment). updateComment/postReaction are provider
  extensions, not contract.
- registerTestProvider is now additive (no longer resets the registry), so
  the conformance harness iterates TestProvider AND every real provider
  side-by-side — validating AC #2 of the spec.

Tests: 15 new Trello manifest tests + conformance now 22 (11 per provider x 2).

Trello's legacy registrations (bootstrap.ts, builtins.ts, worker-env extractor
branch, pm-wizard.tsx branch) still fire — removed in task 3 of this plan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Completes plan 006/2. Trello is the first real provider on the manifest
pattern landed in 006/1.

Backend:
- src/integrations/pm/trello/manifest.ts — wires TrelloIntegration,
  TrelloRouterAdapter, all 7 Trello trigger handlers, TrelloPlatformClient.
  verifyWebhookSignature wraps the existing verifyTrelloSignature helper
  (HMAC-SHA1 of body+callbackUrl) with header-based URL reconstruction.
- src/integrations/pm/trello/index.ts + src/integrations/pm/index.ts —
  side-effect registration barrel imported by router and worker entries.
- src/triggers/builtins.ts — iterates listPMProviders() to register
  Trello triggers via the manifest; removed registerTrelloTriggers call.
- src/router/worker-env.ts — Trello branch of extractProjectIdFromJob
  deleted; registry path handles it via the manifest's extractor hook.

Frontend:
- web/src/components/projects/pm-providers/types.ts — extended
  ProviderWizardDefinition with optional useProviderHooks field. Context
  (state, dispatch, projectId, advanceToStep) flows into the provider
  hook composer.
- web/src/components/projects/pm-providers/manifest-section.tsx — new
  ManifestProviderWizardSection shell component. Only mounted when a
  manifest is registered, so the unconditional useProviderHooks call
  inside satisfies React's rules-of-hooks.
- web/src/components/projects/pm-providers/trello/wizard.ts —
  trelloProviderWizard composes useTrelloDiscovery +
  useTrelloLabelCreation + useTrelloCustomFieldCreation inside
  useProviderHooks. Three step adapters in adapters.tsx destructure
  providerHooks into the existing TrelloCredentialsStep /
  TrelloBoardStep / TrelloFieldMappingStep prop shape — step
  implementations stay unchanged.
- web/src/components/projects/pm-wizard.tsx — removed Trello-specific
  hook instantiations and three per-step `provider === 'trello'`
  branches. The top of the component looks up manifestDef = getProviderWizard(state.provider);
  when truthy it renders <ManifestProviderWizardSection .../>, else falls
  through to the legacy JIRA/Linear branches (they migrate in 006/3/4).

Contract adjustments surfaced during TDD:
- Dropped the redundant parseWebhookPayload field from PMProviderManifest
  (had wrong return type in 006/1; duplicated routerAdapter.parseWebhook).
- Relaxed conformance harness's platform-client assertion to the actual
  PlatformCommentClient contract (postComment + deleteComment only;
  updateComment / postReaction are provider extensions).
- registerTestProvider is additive (no longer resets), so the conformance
  harness iterates TestProvider AND every real provider side-by-side.
- Six existing test files gain a side-effect import of
  src/integrations/pm/trello/index.js so the Trello manifest is
  registered before they exercise Trello-dependent code.

Deferred to plan 006/5 (all documented in the .done plan):
- Removing Trello's registration from src/integrations/bootstrap.ts —
  nine-plus call sites of pmRegistry.get('trello') still rely on the
  legacy registration.
- Consolidating createTrelloLabel/createTrelloLabels tRPC endpoints into
  pm.discovery.createLabel — additive cleanup, not behavior-changing.

Tests: 7755/7755 pass. 15 new Trello manifest tests; conformance harness
now runs 22 assertions (11 × TestProvider + Trello).

Docs: src/integrations/README.md's migration status note updated.
CHANGELOG entry added.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…fig export

CI's build:web step failed because web/tsconfig's stricter resolution
caught an import of a function that doesn't exist. The legacy path at
`useSaveMutation` builds Trello's integration config inline (unlike the
already-extracted `buildLinearIntegrationConfig`). Mirroring that inline
shape inside `trelloProviderWizard.buildIntegrationConfig` keeps plan
006/2 compatible with the existing save path; plan 006/5 will consolidate
`saveMutation` onto `def.buildIntegrationConfig` and extract one shared
builder.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 97.14286% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/integrations/pm/trello/manifest.ts 98.18% 1 Missing ⚠️
src/router/index.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@zbigniewsobiecki zbigniewsobiecki merged commit ece9143 into dev Apr 16, 2026
9 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the feat/006-migrate-trello branch April 16, 2026 09:16
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