refactor: cleanup god-function duplication and dead code#633
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 7, 2026
Merged
Conversation
nhopeatall
approved these changes
Mar 6, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
web/src/components/projects/wizard-shared.tsxwithWizardStep,InlineCredentialCreator, andCredentialOptionshared across all three wizard files, eliminating ~250 lines of verbatim duplication acrosspm-wizard.tsx,email-wizard.tsx, andtwilio-wizard.tsx.upsertCredentialByEnvVarKeyandupsertGmailIntegrationWithCredentialstocredentialsRepository.ts, removing ~100 lines of duplicated find-or-create + update patterns fromintegrationsDiscovery.ts.src/backends/agent-profiles.tsandsrc/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.tsandsrc/agents/definitions/toolManifests.ts).IssueTransitionedSchema,IssueTransitionedConfig, andresolveIssueTransitionedEnabledfromtriggerConfig.ts; removed the corresponding deprecated-alias test suite.Card: https://trello.com/c/69ab5027594361a9f9273023
Test plan
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 pathbackends/toolManifests.test.ts— tests pass with canonical import path🤖 Generated with Claude Code