Skip to content

fix(cli): add email category support to integration-credential commands#569

Merged
zbigniewsobiecki merged 1 commit intodevfrom
fix/email-category-integration-credential-cli
Feb 27, 2026
Merged

fix(cli): add email category support to integration-credential commands#569
zbigniewsobiecki merged 1 commit intodevfrom
fix/email-category-integration-credential-cli

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • CLI gap fixed: The three integration-credential CLI commands (list, set, remove) hardcoded options: ['pm', 'scm'], actively rejecting --category email even though the tRPC API already accepts z.enum(['pm', 'scm', 'email']). Users with email integrations had no CLI path to inspect or manage linked credentials.
  • IMAP guidance corrected: cascade email integration-set --provider imap told users to run cascade projects integration-credential-set without --category email, causing an immediate validation error.
  • Lint warning resolved: Pre-existing noExcessiveCognitiveComplexity warning in agent-execution.ts fixed by extracting the validation failure handling block into a notifyValidationFailure helper.

Changes

File Change
src/cli/dashboard/projects/overrides.ts Add 'email' to category options; default sweep now includes pm + scm + email
src/cli/dashboard/projects/override-set.ts Add 'email' to category options and type cast
src/cli/dashboard/projects/override-rm.ts Add 'email' to category options and type cast
src/cli/dashboard/email/integration-set.ts Fix IMAP guidance note to include --category email
src/triggers/shared/agent-execution.ts Extract notifyValidationFailure helper; complexity 17 → 12

Tests

  • New tests/unit/cli/dashboard/projects/integration-credentials.test.ts — covers all three categories for list/set/remove, rejection of unknown values, and JSON output
  • New tests/unit/cli/dashboard/email/integration-set.test.ts — covers gmail/imap upsert, custom config JSON, and the corrected IMAP credential guidance
  • Extended tests/unit/api/routers/projects.test.ts — email category cases for all three integrationCredentials router procedures

Test plan

  • All 3400 unit tests pass locally (npm test)
  • No lint warnings (npm run lint)
  • No typecheck errors (npm run typecheck)
  • --category email accepted by all three commands
  • --category billing rejected by all three commands
  • Default sweep includes pm + scm + email
  • IMAP guidance includes --category email

🤖 Generated with Claude Code

The three CLI integration-credential commands (list, set, remove)
hardcoded `options: ['pm', 'scm']`, actively rejecting `--category email`
even though the tRPC API already accepts all three categories. Users
with email integrations had no CLI path to inspect or manage linked
credentials.

Changes:
- `projects/overrides.ts`: add 'email' to category options; default
  sweep now includes pm + scm + email
- `projects/override-set.ts`: add 'email' to category options and type cast
- `projects/override-rm.ts`: add 'email' to category options and type cast
- `email/integration-set.ts`: fix IMAP guidance note to include
  `--category email` so users land on the right command

Also fix pre-existing `noExcessiveCognitiveComplexity` lint warning in
`agent-execution.ts` by extracting the validation failure handling block
into a `notifyValidationFailure` helper (complexity 17 → 12).

Tests:
- New `tests/unit/cli/dashboard/projects/integration-credentials.test.ts`
  covers all three categories for list/set/remove, plus rejection of
  unknown values and JSON output
- New `tests/unit/cli/dashboard/email/integration-set.test.ts` covers
  gmail/imap upsert, custom config JSON, and the IMAP credential guidance
- Extended `tests/unit/api/routers/projects.test.ts` with email category
  cases for all three integrationCredentials router procedures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 1a97177 into dev Feb 27, 2026
6 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the fix/email-category-integration-credential-cli branch February 27, 2026 14:15
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