Skip to content
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

fix: input property fingerprinting #140

Conversation

nbrugger-tgm
Copy link

@nbrugger-tgm nbrugger-tgm commented Feb 20, 2024

replace a "hardcoded/real" property with a gradle style one so gradle can actually use the input as such

Closes: #120

@nbrugger-tgm nbrugger-tgm force-pushed the fix/120-input-property-fingerprint branch from 5c5d0f1 to fb7eb08 Compare February 20, 2024 15:34
While I can confirm this fixes the issue, I cannot add a test since there is no infrastructure to execute the tasks.

ref: liquibase#120
@nbrugger-tgm nbrugger-tgm force-pushed the fix/120-input-property-fingerprint branch from acd6e6f to 6913e71 Compare February 21, 2024 15:47
@nbrugger-tgm
Copy link
Author

@stevesaliman

@nbrugger-tgm
Copy link
Author

@MalloD12

@stevesaliman
Copy link
Collaborator

The next release of the plugin is going to use the Liquibase Command API instead of a JavaExec, so this PR may not be needed anymore.

I'm just waiting on a fix in Liquibase, which will hopefully be in the next LB release.

@kevin-atx
Copy link

@stevesaliman - the command API fix will be released with Liquibase 4.28.0 on 5/21/2024 (today). Starting with this release, you should be able to re-implement the Gradle plugin to take advantage of the command API.

@kevin-atx
Copy link

@stevesaliman - were you able to test with the 4.28.0 release of Liquibase to see if this PR is still needed?

@stevesaliman
Copy link
Collaborator

stevesaliman commented Jun 5, 2024

Unfortunately, version 4.28.0 still has an issue with changelog parameters and the Command API, so I can't finish my testing.

@MalloD12
Copy link

Hey @stevesaliman, could you please point us to the changelog parameters issue you are seeing?

Thanks,
Daniel.

@stevesaliman
Copy link
Collaborator

The issue is in how the Gradle plugin interacts with the new CommandScope API. When a task executes, it creates a new ChangelogParameters object to store any parameters given to it by Gradle before calling CommandScope.execute. Since there is no database connection at this point, the database is null, so the database filters are also null.

I set a breakpoint in the ChangeLogParameters constructor and in Liquibase 4.20.0, the constructor would be called by the Gradle plugin before calling execute, but it would be called again after calling execute, this time with a database. The Groovy DSL's parse method would then be given parameters with all the parameters and databaseFilters.

But in 4.21.0, the constructor is only called once, and the the parameters made by the plugin are the parameters given to the parse method. Since the database is null, it isn't properly handling ChangeLogParameters that had the dbms attribute set.

I'm not sure what changed from 4.20 to 4.21, but something change that gets in the way of the changelog parameters working, and I haven't figured out how to work around it yet.

@stevesaliman
Copy link
Collaborator

The next version of the plugin will not be able to use the command API, because the changelog parameter issue remains. So LiquibaseTasks will continue to be JavaExec tasks, and your fix will likely need to be implemented in the new code.

I pushed the cli-api branch with the new code if you want to take a look. It shouldn't be too hard to make the required changes to that branch before it gets released.

@stevesaliman
Copy link
Collaborator

stevesaliman commented Aug 4, 2024

The LiquibaseCommand class is no longer part of the plugin, as of version 3.0.0, so this PR is no longer needed.

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

Successfully merging this pull request may close these issues.

Cannot fingerprint input property
4 participants