Skip to content

feat(dashboard): PM integration wizard with discovery API#508

Merged
zbigniewsobiecki merged 1 commit intodevfrom
feat/pm-wizard-integration-discovery
Feb 23, 2026
Merged

feat(dashboard): PM integration wizard with discovery API#508
zbigniewsobiecki merged 1 commit intodevfrom
feat/pm-wizard-integration-discovery

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • Replace the free-text PM integration form with a guided 6-step wizard that discovers Trello boards and JIRA projects via live API calls, letting users pick from dropdowns instead of manually entering IDs
  • Add integrationsDiscovery tRPC router (6 endpoints) for credential verification, board/project listing, and detail fetching — with DRY credential helpers, input validation (boardId/projectKey regex), and debug logging
  • Add 4 new Trello client methods (getBoards, getBoardLists, getBoardLabels, getBoardCustomFields) and 3 new JIRA client methods (searchProjects, getProjectStatuses, getFields)
  • Fix 7 frontend bugs: stale verifyError on credential change, verify race condition on provider switch, edit mode not loading board details, SearchableSelect hiding selected value on filter, ?? 0 credential fallbacks sending bad IDs, InlineCredentialCreator cache race, unused isEditing flag
  • Fix pre-existing progressMonitor.ts biome formatting issue, add progress model timeout + state file cleared detection
  • Bump squint to 1.10.2 in Dockerfile.worker

Test plan

  • npm run typecheck passes
  • npm run lint passes (0 errors, 0 warnings)
  • All 2786 tests pass (167 test files)
  • New integrationsDiscovery.test.ts — 27 tests covering auth, credential resolution, all 6 procedures, input validation
  • New Trello client tests — board discovery methods (getBoards, getBoardLists, getBoardLabels, getBoardCustomFields)
  • New JIRA client tests — searchProjects, getProjectStatuses, getFields
  • Updated router.test.ts — integrationsDiscovery sub-router registration
  • Manual: create new Trello integration from scratch (full wizard flow)
  • Manual: edit existing integration (verify dropdowns populated, mappings shown)
  • Manual: create credential inline (verify it appears in dropdown immediately)
  • Manual: switch provider during verification (verify no stale state)

🤖 Generated with Claude Code

Replace the free-text PM integration form with a guided 6-step wizard
that discovers Trello boards/JIRA projects via live API calls, letting
users pick from dropdowns instead of manually entering IDs.

Backend:
- Add integrationsDiscovery tRPC router with 6 procedures (verify,
  boards/projects, board/project details) for both Trello and JIRA
- Extract resolveTrelloCreds/resolveJiraCreds DRY helpers
- Add input validation (boardId regex, projectKey regex)
- Add new Trello client methods (getBoards, getBoardLists,
  getBoardLabels, getBoardCustomFields)
- Add new JIRA client methods (searchProjects, getProjectStatuses,
  getFields)

Frontend (pm-wizard.tsx):
- 6-step wizard: Provider → Credentials → Board/Project → Field
  Mapping → Webhooks → Save
- useReducer state management with verifyError in reducer (clears
  on credential change)
- Fix verify race condition: capture provider at mutation start
- Fix edit mode: auto-fetch board/project details when editing
- Fix SearchableSelect: always include selected value in filter
- Replace ?? 0 credential fallbacks with early throw
- Fix InlineCredentialCreator: await cache invalidation before
  selecting new credential
- Use isEditing flag: disable provider switch, show "Update" button

Other:
- Fix pre-existing progressMonitor.ts lint formatting
- Add progress model timeout + state file cleared detection
- Bump squint to 1.10.2 in Dockerfile.worker

Tests:
- Add integrationsDiscovery router tests (27 tests)
- Add Trello client tests for new board discovery methods
- Add JIRA client tests for searchProjects, getProjectStatuses,
  getFields
- Update router.test.ts for integrationsDiscovery sub-router

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aaight
Copy link
Copy Markdown
Collaborator

aaight commented Feb 23, 2026

✨ On it — checking the PM integration wizard

@aaight
Copy link
Copy Markdown
Collaborator

aaight commented Feb 23, 2026

🤔 Just a sec, looking into the PM integration wizard

@aaight
Copy link
Copy Markdown
Collaborator

aaight commented Feb 23, 2026

✅ Review Complete — All Checks Passing

I've reviewed the PM integration wizard implementation and everything looks great! Here's the summary:

🎯 PR Overview

This PR replaces the free-text PM integration form with a guided 6-step wizard that discovers Trello boards and JIRA projects via live API calls, letting users pick from dropdowns instead of manually entering IDs.

✨ Key Changes

  1. Backend API ():

    • 6 new tRPC endpoints for credential verification, board/project listing, and detail fetching
    • DRY credential resolution helpers with org-scoped validation
    • Input validation with regex patterns (boardId, projectKey)
    • Comprehensive error handling and debug logging
  2. Client Methods:

    • Trello: 4 new methods (getBoards, getBoardLists, getBoardLabels, getBoardCustomFields)
    • JIRA: 3 new methods (searchProjects, getProjectStatuses, getFields)
  3. Frontend Wizard ():

    • 1704-line React component with reducer-based state management
    • 6-step wizard: Provider → Credentials → Board/Project → Field Mapping → Webhooks → Save
    • Searchable dropdowns for boards/projects/fields
    • Inline credential creation
    • Edit mode support with auto-population
  4. Bug Fixes:

    • Stale verifyError on credential change
    • Verify race condition on provider switch
    • Edit mode not loading board details
    • SearchableSelect hiding selected value on filter
    • InlineCredentialCreator cache race
    • ?? 0 credential fallbacks sending bad IDs
  5. Infrastructure:

    • Updated progressMonitor.ts with timeout + state file detection
    • Bumped squint to 1.10.2 in Dockerfile.worker

✅ Verification Results

Type Safety: ✅ No TypeScript errors

> tsc --noEmit
Checked successfully with no errors

Linting: ✅ No Biome issues

> biome check .
Checked 599 files in 227ms. No fixes applied.

Tests: ✅ All 2786 tests passing (167 test files)

  • New integrationsDiscovery.test.ts — 27 tests covering auth, credential resolution, all 6 procedures, input validation
  • New Trello client tests — board discovery methods
  • New JIRA client tests — searchProjects, getProjectStatuses, getFields
  • Updated router.test.ts — integrationsDiscovery sub-router registration
  • Updated progress monitor tests — state file cleared detection

🎨 Code Quality Highlights

  1. Excellent separation of concerns: tRPC router → client methods → UI components
  2. Type-safe end-to-end: Zod schemas, TypeScript interfaces, React hooks
  3. Comprehensive test coverage: 27 new tests with edge cases, auth checks, error handling
  4. DRY principles: Credential resolution helpers, consistent error wrapping
  5. UX improvements: Inline credential creation, searchable selects, edit mode auto-population

📋 Remaining Manual Testing (from PR description)

  • Manual: create new Trello integration from scratch (full wizard flow)
  • Manual: edit existing integration (verify dropdowns populated, mappings shown)
  • Manual: create credential inline (verify it appears in dropdown immediately)
  • Manual: switch provider during verification (verify no stale state)

🚀 Recommendation

Ready to merge once manual testing is complete. All automated checks pass, code quality is excellent, and the implementation follows CASCADE's established patterns.

🤖 Generated with Claude Code

@zbigniewsobiecki zbigniewsobiecki merged commit eae032c into dev Feb 23, 2026
5 checks passed
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.

Summary

Well-structured PR that replaces a manual-entry PM integration form with a guided wizard backed by live API discovery. The backend router, client methods, and frontend component are all cleanly implemented with proper authorization, input validation, and test coverage.

Notes

Security: Credential resolution (resolveCredentialValue) correctly verifies org ownership before decrypting, preventing cross-org access. The boardId and projectKey inputs are regex-validated at the tRPC layer before being interpolated into URLs in the Trello/JIRA clients, blocking path injection.

Architecture: Using .mutation() for all discovery endpoints is the right call — these make external API calls with credentials and shouldn't be cached/retried by tRPC's query layer. The DRY credential resolution helpers (resolveTrelloCreds/resolveJiraCreds) are well-factored.

Progress monitor changes: The 20s timeout with Promise.race and Sentry exception capture are sensible additions. The state-file-cleared detection prevents overwriting final agent comments.

Test coverage: 27 tests for the new router covering auth, credential resolution, all 6 procedures, and input validation. Client tests cover the new Trello and JIRA methods with edge cases. Good.

Minor observations (not blocking):

  • searchProjects hardcodes maxResults: 100 — organizations with >100 JIRA projects would see truncated results. Pagination could be added later if needed.
  • The Promise.race timeout timer in progressMonitor.ts isn't cleared when the model call wins, but this is benign (the reject callback is a no-op on an already-settled promise).
  • The InlineCredentialCreator awaits invalidateQueries before calling onCreated, but invalidateQueries resolves when the invalidation is queued, not when data is re-fetched. There's a brief window where the credential ID is set but the credential isn't in the dropdown options yet. This resolves itself on the next render cycle.

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.

3 participants