From 39dde222b264e59b6b580b2cba497ae70d07eca3 Mon Sep 17 00:00:00 2001 From: Pere Miquel Brull Date: Thu, 25 Apr 2024 18:21:00 +0200 Subject: [PATCH] MINOR - Migration validation list diff message (#16015) * MINOR - Migration validation list diff message * wording * Trigger Build --- .../openmetadata/service/jdbi3/SystemRepository.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/SystemRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/SystemRepository.java index 28f308d8dce..87b62cb78be 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/SystemRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/SystemRepository.java @@ -4,6 +4,7 @@ import static org.openmetadata.schema.type.EventType.ENTITY_CREATED; import static org.openmetadata.schema.type.EventType.ENTITY_DELETED; import static org.openmetadata.schema.type.EventType.ENTITY_UPDATED; +import java.util.ArrayList; import java.util.List; import javax.json.JsonPatch; import javax.json.JsonValue; @@ -324,12 +325,19 @@ public class SystemRepository { .withDescription(ValidationStepDescription.MIGRATION.key) .withPassed(Boolean.TRUE); } + List missingVersions = + new ArrayList<>(migrationValidationClient.getExpectedMigrationList()); + missingVersions.removeAll(currentVersions); + + List unexpectedVersions = new ArrayList<>(currentVersions); + unexpectedVersions.removeAll(migrationValidationClient.getExpectedMigrationList()); + return new StepValidation() .withDescription(ValidationStepDescription.MIGRATION.key) .withPassed(Boolean.FALSE) .withMessage( String.format( - "Found the versions [%s], but expected [%s]", - currentVersions, migrationValidationClient.getExpectedMigrationList())); + "Missing migrations that were not executed %s. Unexpected executed migrations %s", + missingVersions, unexpectedVersions)); } }