Skip to content

Provide configuration properties for Flyway's Vault and Conjur support #25456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Conversation

onobc
Copy link
Contributor

@onobc onobc commented Feb 27, 2021

Fixes gh-24969

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 27, 2021
Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR Chris. I've added a few notes, can you please have look?

@@ -328,6 +329,33 @@
*/
private Boolean skipExecutingMigrations;

/**
* The REST API URL of the Conjur server. Requires Flyway teams.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuration properties documentation don't start with "The" or "A". Please look at other description in this file (and others) for inspiration and this section of the reference guide.

* path must start with the name of the engine and end with the name of the secret
* such 'kv/test/1/config'. Requires Flyway teams.
*/
private String vaultSecrets;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's a comma separated list, it can't be a String. We should offer a way for users to also use yaml list if they want to.

"vaultSecrets");
}

@Test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be flagged with @Test.

}

@Test
private void assertThatPropertyResultsInFlywayTeamsUpgradeRequiredException(String propertyKeyAndValue,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer that the setup remains in each test and that the thing that's shared is the real assertion in the form of a ContextConsumer.

A good example of what I am trying to convey is in EnvironmentEndpointAutoConfigurationTests.

@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 27, 2021
@snicoll snicoll added this to the 2.5.x milestone Feb 27, 2021
@onobc
Copy link
Contributor Author

onobc commented Feb 27, 2021

@snicoll all comments addressed.


@Test
void vaultSecretsIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snicoll thx for the suggestion. Keeping the setup in each test makes it easy to see what the test is doing from first glance. Sharing only the common validation reduces the duplicated lines (and that was the main goal of the first attempt). 👍🏻

@@ -108,9 +109,7 @@ void expectedPropertiesAreManaged() {
// Handled by the conversion service
ignoreProperties(configuration, "baselineVersionAsString", "encodingAsString", "locationsAsStrings",
"targetAsString");
// Teams-only properties that we cannot detect as no exception is thrown and
// getters return null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be deleted as well please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good catch @wilkinsona .

@onobc onobc requested a review from snicoll February 28, 2021 04:26
@snicoll snicoll changed the title Add configuration properties for Flyway Vault and Conjur support Provide configuration properties for Flyway's Vault and Conjur support Mar 1, 2021
@snicoll snicoll modified the milestones: 2.5.x, 2.5.0-M3 Mar 1, 2021
@snicoll snicoll self-assigned this Mar 1, 2021
snicoll added a commit that referenced this pull request Mar 1, 2021
@snicoll snicoll closed this in d1b229e Mar 1, 2021
@snicoll
Copy link
Member

snicoll commented Mar 1, 2021

Thanks for the follow-up and for yet another great contribution Chris.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide configuration properties for Flyway's Vault and Conjur support
5 participants