Skip to content

refactor: cleanup god-function duplication and dead code#633

Merged
zbigniewsobiecki merged 1 commit intodevfrom
refactor/cleanup-god-function-duplication-dead-code
Mar 7, 2026
Merged

refactor: cleanup god-function duplication and dead code#633
zbigniewsobiecki merged 1 commit intodevfrom
refactor/cleanup-god-function-duplication-dead-code

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Mar 6, 2026

Summary

  • Extract shared wizard components — Created web/src/components/projects/wizard-shared.tsx with WizardStep, InlineCredentialCreator, and CredentialOption shared across all three wizard files, eliminating ~250 lines of verbatim duplication across pm-wizard.tsx, email-wizard.tsx, and twilio-wizard.tsx.
  • Extract Gmail OAuth DB logic into repository layer — Added upsertCredentialByEnvVarKey and upsertGmailIntegrationWithCredentials to credentialsRepository.ts, removing ~100 lines of duplicated find-or-create + update patterns from integrationsDiscovery.ts.
  • Delete deprecated backend shims — Removed src/backends/agent-profiles.ts and src/backends/toolManifests.ts (both were pure re-export shims), updated all consumers (source files and tests) to import directly from canonical locations (src/agents/definitions/profiles.ts and src/agents/definitions/toolManifests.ts).
  • Remove deprecated trigger config aliases — Deleted IssueTransitionedSchema, IssueTransitionedConfig, and resolveIssueTransitionedEnabled from triggerConfig.ts; removed the corresponding deprecated-alias test suite.

Card: https://trello.com/c/69ab5027594361a9f9273023

Test plan

  • All 3,841 unit tests pass
  • TypeScript type checking passes (no errors)
  • Biome lint passes (no errors)
  • triggerConfig.test.ts — 112 tests pass (deprecation alias suite removed)
  • backends/adapter.test.ts — 34 tests pass (mock updated for canonical import)
  • backends/agent-profiles.test.ts — tests pass with canonical import path
  • backends/toolManifests.test.ts — tests pass with canonical import path

🤖 Generated with Claude Code

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

Clean refactoring PR that eliminates real duplication without changing behavior. All four changes are straightforward and correct — shared wizard components unify three near-identical implementations, the Gmail credential logic moves to the right layer (repository), and the deprecated shims/aliases are safe to remove with no remaining consumers.

All CI checks pass (lint, type-check, 3,841 unit tests, integration tests).

@zbigniewsobiecki zbigniewsobiecki merged commit 7aec301 into dev Mar 7, 2026
6 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the refactor/cleanup-god-function-duplication-dead-code branch March 16, 2026 16:43
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