Upgrade to Flyway 7.13.0

Closes gh-27644
This commit is contained in:
Andy Wilkinson
2021-08-12 13:08:21 +01:00
parent 1966d1650b
commit 42fb40b202
7 changed files with 64 additions and 72 deletions

View File

@@ -248,12 +248,6 @@ public class FlywayAutoConfiguration {
// No method reference for compatibility with Flyway 6.x
map.from(properties.getSkipExecutingMigrations())
.to((skipExecutingMigrations) -> configuration.skipExecutingMigrations(skipExecutingMigrations));
// Teams secrets management properties (all non-method reference for
// compatibility with Flyway 6.x)
map.from(properties.getVaultUrl()).to((vaultUrl) -> configuration.vaultUrl(vaultUrl));
map.from(properties.getVaultToken()).to((vaultToken) -> configuration.vaultToken(vaultToken));
map.from(properties.getVaultSecrets()).whenNot(List::isEmpty)
.to((vaultSecrets) -> configuration.vaultSecrets(vaultSecrets.toArray(new String[0])));
// No method reference for compatibility with Flyway < 7.8
map.from(properties.getIgnoreMigrationPatterns()).whenNot(List::isEmpty)
.to((ignoreMigrationPatterns) -> configuration

View File

@@ -330,6 +330,12 @@ public class FlywayProperties {
*/
private String oracleKerberosConfigFile;
/**
* Location of the Oracle Wallet, used to sign-in to the database automatically.
* Requires Flyway Teams.
*/
private String oracleWalletLocation;
/**
* Whether Flyway should output a table with the results of queries when executing
* migrations. Requires Flyway Teams.
@@ -342,24 +348,6 @@ public class FlywayProperties {
*/
private Boolean skipExecutingMigrations;
/**
* REST API URL of the Vault server. Requires Flyway teams.
*/
private String vaultUrl;
/**
* Vault token required to access secrets. Requires Flyway teams.
*/
private String vaultToken;
/**
* Comma-separated list of paths to secrets that contain Flyway configurations. This
* must start with the name of the engine followed by '/data/' and end with the name
* of the secret. The resulting form is '{engine}/data/{path}/{to}/{secret_name}'.
* Requires Flyway teams.
*/
private List<String> vaultSecrets;
/**
* Ignore migrations that match this comma-separated list of patterns when validating
* migrations. Requires Flyway Teams.
@@ -372,6 +360,11 @@ public class FlywayProperties {
*/
private Boolean detectEncoding;
/**
* Filename prefix of state scripts. Requires Flyway Teams.
*/
private String stateScriptPrefix;
public boolean isEnabled() {
return this.enabled;
}
@@ -779,6 +772,14 @@ public class FlywayProperties {
this.oracleSqlplusWarn = oracleSqlplusWarn;
}
public String getOracleWalletLocation() {
return this.oracleWalletLocation;
}
public void setOracleWalletLocation(String oracleWalletLocation) {
this.oracleWalletLocation = oracleWalletLocation;
}
public Boolean getStream() {
return this.stream;
}
@@ -843,30 +844,6 @@ public class FlywayProperties {
this.skipExecutingMigrations = skipExecutingMigrations;
}
public String getVaultUrl() {
return this.vaultUrl;
}
public void setVaultUrl(String vaultUrl) {
this.vaultUrl = vaultUrl;
}
public String getVaultToken() {
return this.vaultToken;
}
public void setVaultToken(String vaultToken) {
this.vaultToken = vaultToken;
}
public List<String> getVaultSecrets() {
return this.vaultSecrets;
}
public void setVaultSecrets(List<String> vaultSecrets) {
this.vaultSecrets = vaultSecrets;
}
public List<String> getIgnoreMigrationPatterns() {
return this.ignoreMigrationPatterns;
}
@@ -883,4 +860,12 @@ public class FlywayProperties {
this.detectEncoding = detectEncoding;
}
public String getStateScriptPrefix() {
return this.stateScriptPrefix;
}
public void setStateScriptPrefix(String stateScriptPrefix) {
this.stateScriptPrefix = stateScriptPrefix;
}
}

View File

@@ -910,6 +910,30 @@
"reason": "Flyway pro edition only."
}
},
{
"name": "spring.flyway.vault-secrets",
"type": "java.util.List<java.lang.String>",
"deprecation": {
"level": "error",
"reason": "Removed in the open source release of Flyway 7.12."
}
},
{
"name": "spring.flyway.vault-token",
"type": "java.lang.String",
"deprecation": {
"level": "error",
"reason": "Removed in the open source release of Flyway 7.12."
}
},
{
"name": "spring.flyway.vault-url",
"type": "java.lang.String",
"deprecation": {
"level": "error",
"reason": "Removed in the open source release of Flyway 7.12."
}
},
{
"name": "spring.freemarker.prefix",
"defaultValue": ""

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -116,6 +116,11 @@ class Flyway5xAutoConfigurationTests {
}
@Override
public boolean isStateScript() {
return false;
}
}
}

View File

@@ -629,27 +629,6 @@ class FlywayAutoConfigurationTests {
.run(validateFlywayTeamsPropertyOnly("skipExecutingMigrations"));
}
@Test
void vaultUrlIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.flyway.vault-url=https://example.com/secrets")
.run(validateFlywayTeamsPropertyOnly("vaultUrl"));
}
@Test
void vaultTokenIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.flyway.vault-token=5150")
.run(validateFlywayTeamsPropertyOnly("vaultToken"));
}
@Test
void vaultSecretsIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.flyway.vault-secrets=kv/data/test/1/config,kv/data/test/2/config")
.run(validateFlywayTeamsPropertyOnly("vaultSecrets"));
}
@Test
void whenFlywayIsAutoConfiguredThenJooqDslContextDependsOnFlywayBeans() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class, JooqConfiguration.class)
@@ -1028,6 +1007,11 @@ class FlywayAutoConfigurationTests {
}
@Override
public boolean isStateScript() {
return false;
}
}
}

View File

@@ -108,7 +108,7 @@ class FlywayPropertiesTests {
ignoreProperties(configuration, "callbacks", "classLoader", "dataSource", "javaMigrations",
"javaMigrationClassProvider", "resourceProvider", "resolvers");
// Properties we don't want to expose
ignoreProperties(configuration, "resolversAsClassNames", "callbacksAsClassNames");
ignoreProperties(configuration, "resolversAsClassNames", "callbacksAsClassNames", "apiExtensions");
// Handled by the conversion service
ignoreProperties(configuration, "baselineVersionAsString", "encodingAsString", "locationsAsStrings",
"targetAsString");

View File

@@ -309,7 +309,7 @@ bom {
]
}
}
library("Flyway", "7.11.2") {
library("Flyway", "7.13.0") {
group("org.flywaydb") {
modules = [
"flyway-core"