Splitties / refreshVersions

Life is too short to google for dependencies and versions
https://splitties.github.io/refreshVersions/
MIT License
1.66k stars 107 forks source link

Breaking changes in AndroidX and Kotest? #607

Open jmfayard opened 2 years ago

jmfayard commented 2 years ago

In #refreshVersions Dave A. reported breaking changes while updating to 0.50.0

Bad news

The newest update seems to have changed some dependency names... so Android Studio didn't load up the new definitions for some reasons, and code complete was still using the old version even after cleaning the build and .gradle folders a few times... so I had to guess what they were changed to :see_no_evil:...

Good news

it's a good thing there was the new list on the site... https://jmfayard.github.io/refreshVersions/dependencies-notations/

The breaking changes in question

-implementation(AndroidX.lifecycle.runtimeKtx)
+implementation(AndroidX.lifecycle.runtime.ktx)

// note he doesn't want to update yet
-testImplementation(Testing.kotestExtensions.wiremock)
+testImplementation(Testing.kotest.extensions.wiremock)

Work around: inline the mutation with a string instead of using the dependency notation

TODO @jmfayard: check what the migration mechanism was supposed to to avoida breaking change, and whether it works

LouisCAD commented 2 years ago

It got replaced because the underlying maven coordinates are the same, so there's no issue here.

jmfayard commented 2 years ago

I wonder if the issue is not that the version key changed from version.kotest to version.kotest.extension.wiremock

CleanShot 2022-09-13 at 22 50 21@2x

Later does not exist yet, so refreshVersions fetches the latest version, which is not the same version, and the build make fail if you aren't lucky.

Am I right?

LouisCAD commented 2 years ago

I don't know, we need Dave to comment here, not on Slack which is more informal.

jmfayard commented 2 years ago

Pinged him in slack https://kotlinlang.slack.com/archives/CP5659EL9/p1662980958842149

dave08 commented 2 years ago

It seems like certain deps got upgraded to 5.x whereas others stayed at 4.6.4 (which was the version I was at...), in the end, I just upgraded kotest, but in other projects I use more kotest features and there ARE breaking changes between 4.x and 5.x.

jmfayard commented 2 years ago

My guess is that the real issue is that the version keys were changed because those versions are not aligned anymore.

Thus I would try to downgrade the version like this in versions.properties

version.kotest.extension.xx=4.6.4

dave08 commented 2 years ago

I had this before: version.kotest.extensions.robolectric=0.3.0.7-SNAPSHOT... Does it ignore this in certain circumstances? Right now I'm in the middle of trying to close up a release -- so I can't really start testing things out right now.

jmfayard commented 2 years ago

No worry you can test later.

If a key is not used, there should be a comment ## unused above.

You can also use ./gradlew dependencies --scan and open the build scan to see what version is actually used.

LouisCAD commented 2 years ago

If there's actually a problem in refreshVersions, we'd need a reproducer that is using refreshVersions 0.40.2, where the bug triggers if we update to 0.50.1