MINOR - Migration validation list diff message (#16015)

* MINOR - Migration validation list diff message

* wording

* Trigger Build
This commit is contained in:
Pere Miquel Brull 2024-04-25 18:21:00 +02:00 committed by GitHub
parent 4ed87a4d08
commit 39dde222b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<String> missingVersions =
new ArrayList<>(migrationValidationClient.getExpectedMigrationList());
missingVersions.removeAll(currentVersions);
List<String> 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));
}
}