From 3b512164d1ea116baa7188eab7224b36f7581b6e Mon Sep 17 00:00:00 2001 From: Paul Rastoin <45004772+prastoin@users.noreply.github.com> Date: Sun, 25 Jan 2026 12:10:37 +0100 Subject: [PATCH] `[Debug log level]` Print validation build result failure (#17423) # Introduction As per title, in order to ease debug Motivation https://github.com/twentyhq/twenty/issues/17413#issuecomment-3796168946 --- ...pace-migration-validate-build-and-run-service.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service.ts index a6f61bbdd5..886c0bc841 100644 --- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service.ts +++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service.ts @@ -6,6 +6,7 @@ import { } from 'twenty-shared/metadata'; import { isDefined } from 'twenty-shared/utils'; +import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service'; import { ALL_METADATA_REQUIRED_METADATA_FOR_VALIDATION } from 'src/engine/metadata-modules/flat-entity/constant/all-metadata-required-metadata-for-validation.constant'; import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant'; import { AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type'; @@ -38,12 +39,18 @@ export class WorkspaceMigrationValidateBuildAndRunService { private readonly logger = new Logger( WorkspaceMigrationValidateBuildAndRunService.name, ); + private readonly isDebugEnabled: boolean; constructor( private readonly workspaceMigrationRunnerService: WorkspaceMigrationRunnerService, private readonly workspaceMigrationBuildOrchestratorService: WorkspaceMigrationBuildOrchestratorService, private readonly workspaceCacheService: WorkspaceCacheService, - ) {} + twentyConfigService: TwentyConfigService, + ) { + const logLevels = twentyConfigService.get('LOG_LEVELS'); + + this.isDebugEnabled = logLevels.includes('debug'); + } private async computeAllRelatedFlatEntityMaps({ allFlatEntityOperationByMetadataName, @@ -186,6 +193,10 @@ export class WorkspaceMigrationValidateBuildAndRunService { }); if (validateAndBuildResult.status === 'fail') { + if (this.isDebugEnabled) { + this.logger.debug(JSON.stringify(validateAndBuildResult, null, 2)); + } + return validateAndBuildResult; }