Skip to content

Conversation

@Nava2
Copy link

@Nava2 Nava2 commented Apr 21, 2024

This updates the flyway gradle plugin to provide Property<> values on the extension rather than using bare types. This is incredibly important for working with Gradle such that properties remain lazy. This allows values to be configured from different locations rather than relying on being available immediately.

Drive-by: This bumps the version of Gradle from 6.1.1 (Jan 2020) to 6.9.4 (Feb 2023). The version in use is wildly out of date.

All changes within this PR are backwards compatible with Version 6.9.4.

Nava2 added 2 commits April 21, 2024 16:10
This updates the flyway gradle plugin to provide `Property<>` values on the extension rather than using bare types. This is incredibly important for working with Gradle such that properties remain lazy. This allows values to be configured from different locations rather than relying on being available immediately.
@CLAassistant
Copy link

CLAassistant commented Apr 21, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@WilliamL-RG WilliamL-RG left a comment

Choose a reason for hiding this comment

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

Apologies for the time since this PR was created. I have found some issues with the PR that are preventing Flyway working as expected with Gradle, so they will need to be addressed.

public Map<String, String> pluginConfiguration;
private final MapProperty<String, String> pluginConfiguration;

FlywayExtension(ObjectFactory objects) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be made public

*/
public class FlywayPlugin implements Plugin<Project> {
public void apply(Project project) {
project.getExtensions().create("flyway", FlywayExtension.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

This would need to be updated to match the new constructor

if (value instanceof Provider<?> && ((Provider<?>) value).isPresent()) {
config.put(key, ((Provider<?>) value).get().toString());
} else {
config.put(key, value.toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

This will need a null check to ensure configuration parameters are properly set to null and not an empty string

* The version to tag an existing schema with when executing baseline. (default: 1)
*/
public String baselineVersion;
private final Property<String> baselineVersion;
Copy link
Contributor

Choose a reason for hiding this comment

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

This can create conflicts with baseline versions that are not written as a string. For example this will not accept baselineVersion = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants