<https://github.com/liquibase/liquibase-gradle-plu...
# gsoc-2025-improving-cc
n
https://github.com/liquibase/liquibase-gradle-plugin/pull/176 Here's a PR for Liquibase. I think this is the liquibase 's active maintainer : https://github.com/stevesaliman
o
I tried contacting Steve but was not successful so far. FWIW Liquibase has their own community Slack and it can be used if there is no response to the PR in a few weeks.
n
Steve commented on the PR asking about some technical changes , I will reply ASAP
🙌 1
o
Both comments are relevant ones IMHO
n
@Rafael Chaves there is no way to keep it compileOnly and keep the test working or should we give up on it?
r
@Rodrigo Oliveira - do you know a way we can avoid this?
1. The liquibase core dependency changed from
compileOnly
to
implementation
. What was the reason for this change? We originally used compileOnly so the plugin wouldn't be tied to any specific version of Liquibase.
https://github.com/liquibase/liquibase-gradle-plugin/pull/176#issuecomment-3198592070 Basically, we want the TestKit test to be able to have liquibase-core in its classpath.
r
Hm... Isn't the
testImplementation
dependency enough?
r
I tried that, and still got a
NoClassDefFoundError
(or
CNFE
, unsure now)
NCDFE
, confirmed
Tried having both:
Copy code
compileOnly "org.liquibase:liquibase-core:${liquibaseCoreVersion}"  
    testImplementation "org.liquibase:liquibase-core:${liquibaseCoreVersion}"
Still get a NCDFE
Having only
testImplementation
leads to compilation errors of the base code
r
Right,
compileOnly
was there before so it's needed
Some quirk of
withPluginClasspath
🤔 What about
testRuntime
?
r
let me try
This is Gradle 7.6... 🤦‍♂️ It seems there was no
testRuntime
then. EDIT: wait, you meant
testRuntimeOnly
? That does exist in 7.6, but is not sufficient to compile the test code.
Can we retrieve the
testRuntimeOnly
dependency as a file collection and pass to
GradleRunner.withPluginClasspath(...)
?
Or maybe we need different classpath for this specific (integration) test (as opposed to using the same as other (unit) tests?
Hm, but I guess that may not be honored by
GradleRunner.withPluginClasspath()
n
sorry , I can't understand it , first they want to change this spock test to juint test
second thing , I need to change their tests to not take project as parameter as it is going to fail
r
Yeah, people tend to use one framework across all tests
So, we need to remove the spock dependency, and change the test to use
@Test
annotation, and drop the spock special blocks
Their other tests are not integration tests, are they?
n
they are not directly integration tests , but they are trying to make it integration
r
If they don't fail, don't worry about that yet
actually they are failing
I made changes to Argument builder to use projectInfo and not take project , so the whole test need to be refactored
r
Not necessarily
n
Why?
r
We may be able to make minimal changes that allow it to work almost as is
Once the integration test is moved to JUnit, we can look into that
n
okay
Should I explain my changes in the PR ? , I thing he can't understand them
r
There should be an overview of the approach as the PR summary. You can then add comments to specific spots as needed
👍 1
Still looking into the argument builder test changes, should have a patch for you in the next hour
@Nouran I will share my local changes. They unbreak the unit test for
ArgumentBuilder
, however it shows a bug in the way we handle
liquibaseChangelogParameters
- they are effectively being lost. Here is the place we are filtering out that property: https://github.com/Nouran-11/liquibase-gradle-plugin/commit/a373da7b511d19d72c2d2c57fee66ed8e4336923#diff-4b107d242c438a018[…]fa2d08f6fb363b7R10-R31
I will let give it a try. It seems when you changed the place where we process properties, the validation check ended up at the wrong place.
n
I noticed this part in
liquibaseChangelogParameters
, I was waiting to confirm from the author about it , as I am not sure If I am handling the cases properly or they are doing it in different way
r
If you run the tests, you will see which tests are failing (liquibaseChangelogParameters are no longer being honored)
because we are now ignoring them
n
okay , I will have a deeper look at the test again
r
Basically, the changes we made do not preserve the behavior that was in place before
Because we loop/filter stuff in different places
It will be easier to get right if we kept the code together, IMO
(btw, I pushed to
master
- was that the right branch?
n
yes it is the right branch , by mistake I opened PR from the fix-cc branch , I should do it with master
r
Cool, let me know if you need any help. If you compare your master branch with the code in Liquibase's master you should be able to figure out that the way we are doing it breaks the behavior that was in place. In a gist, Liquibase allows the same options to be provided at different levels, and they have different priorities/may override others, and it seems we broke one way to override them. The tests now show which cases we broke, and which cases still work.
👍 1
we shouldn't pass project to ArgumentBuilder
did you keep this for a reason?
Ah okay the my project wasn't updated
okay what I understand that we don't want to add changelog-parameters
we want to change it to -Dparam
so we need to filter it
ah so before we were losing liquibaseChangelogParameter always , so we need to get it included and being processed later in
createChangelogParamMap()
If it is solved let me know to start commenting on my commits to help the author understand it
r
Do all tests pass now?
n
yes
@Rafael Chaves https://github.com/JLLeitschuh/ktlint-gradle/issues/936 what do you think about starting in this issue?