feat: implement dynamic driver configuration + fix integration test log pollution (#12104)
### Primary Changes: Dynamic Driver Configuration Refactors FileStorageService and EmailSenderService to support dynamic driver configuration changes at runtime without requiring application restarts. **Key Architectural Change**: Instead of conditionally registering drivers at build time based on configuration, we now **register all possible drivers eagerly** and select the appropriate one at runtime. ### What Changed: - **Before**: Modules conditionally registered only the configured driver (e.g., only S3Driver if STORAGE_TYPE=S3) - **After**: All drivers (LocalDriver, S3Driver, SmtpDriver, LoggerDriver) are registered at startup - **Runtime Selection**: Services dynamically choose and instantiate the correct driver based on current configuration ### Secondary Fix: Integration Test Log Cleanup Addresses ConfigStorageService error logs appearing in integration test output by using injected LoggerService for consistent log handling.
This commit is contained in:
@ -18,16 +18,15 @@ if (packageChanged && !lockfileChanged) {
|
||||
warn(`${message} - <i>${idea}</i>`);
|
||||
}
|
||||
|
||||
// Check if .env.example was changed, but not config variable documentation
|
||||
const envChanged =
|
||||
danger.git.modified_files.find((x) => x.includes('.env.example')) ||
|
||||
danger.git.modified_files.find((x) => x.includes('twenty-config.service.ts'));
|
||||
const envDocsChanged = danger.git.modified_files.includes('self-hosting.mdx');
|
||||
if (envChanged && !envDocsChanged) {
|
||||
const message =
|
||||
'Changes were made to the config variables, but not to the documentation';
|
||||
const idea =
|
||||
'Please review your changes and check if a change needs to be documented!';
|
||||
// Check environment configuration changes
|
||||
const envExampleChanged = danger.git.modified_files.find((x) =>
|
||||
x.includes('.env.example')
|
||||
);
|
||||
|
||||
// Check if .env.example was changed
|
||||
if (envExampleChanged) {
|
||||
const message = 'Changes were made to .env.example';
|
||||
const idea = 'Please make sure any new environment variables are properly documented with metadata in config-variables.ts';
|
||||
warn(`${message} - <i>${idea}</i>`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user