refactor(db): split settingsRepository god-module into 5 focused repositories#641
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 7, 2026
Merged
Conversation
nhopeatall
approved these changes
Mar 7, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
Clean refactoring that splits a 441-line god-module into 5 focused, single-responsibility repository modules with a barrel re-export for full backward compatibility. No issues found.
Verified:
- Code was extracted verbatim — no logic changes during the split
- All 25 exported functions have unique names across the 5 modules (no
export *collisions) - All 24 existing consumer files import from
settingsRepository.jsand continue to work unchanged via the barrel - 5 new domain-specific test files cover the new modules; original
settingsRepository.test.tsstill passes through the barrel - CI: lint, typecheck, unit tests, and integration tests all pass
- Module boundaries are well-chosen: Organizations, Cascade Defaults, Projects, Integrations+Credentials, Agent Configs
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
settingsRepository.ts(441 lines, 25 functions, 6 domains, 24 consumers) into 5 focused single-responsibility modulesWhat was refactored
organizationsRepository.tsgetOrganization,updateOrganization,listAllOrganizationscascadeDefaultsRepository.tsgetCascadeDefaults,upsertCascadeDefaultsprojectsRepository.tslistProjectsFull,getProjectFull,createProject,updateProject,deleteProjectintegrationsRepository.ts*ProjectIntegration*,getAllProjectIdsWith*Integration, plus*IntegrationCredential*agentConfigsRepository.tslistAgentConfigs,createAgentConfig,updateAgentConfig,deleteAgentConfig,getMaxConcurrency+maxConcurrencyCachesettingsRepository.tsis now a barrel re-export — all 24 existing consumer files continue to work unchanged.Test plan
npm run typecheck— zero errorsnpm run lint— zero errorsnpm test— 239 test files, 3988 tests, all passingorganizationsRepository.test.ts,cascadeDefaultsRepository.test.ts,projectsRepository.test.ts,integrationsRepository.test.ts,agentConfigsRepository.test.tssettingsRepository.test.tsstill passes unchanged (via barrel re-export)Card
https://trello.com/c/69abe1d42301a258bc6fa949
🤖 Generated with Claude Code