Fail ignition build when the same jar in moduleContent folder with multiple versions detected#68
Conversation
…ltiple versions detected Fixes: IGN-10168
brianeray
left a comment
There was a problem hiding this comment.
First pass, mostly just looking at changes.
I will also try to integration test locally with some fake modules.
gradle-module-plugin/src/functionalTest/kotlin/io/ia/sdk/gradle/modl/task/ZipModuleTests.kt
Show resolved
Hide resolved
gradle-module-plugin/src/main/kotlin/io/ia/sdk/gradle/modl/task/ZipModule.kt
Outdated
Show resolved
Hide resolved
gradle-module-plugin/src/functionalTest/kotlin/io/ia/sdk/gradle/modl/task/ZipModuleTests.kt
Show resolved
Hide resolved
gradle-module-plugin/src/main/kotlin/io/ia/sdk/gradle/modl/task/ZipModule.kt
Outdated
Show resolved
Hide resolved
gradle-module-plugin/src/main/kotlin/io/ia/sdk/gradle/modl/task/ZipModule.kt
Outdated
Show resolved
Hide resolved
gradle-module-plugin/src/main/kotlin/io/ia/sdk/gradle/modl/task/ZipModule.kt
Show resolved
Hide resolved
gradle-module-plugin/src/main/kotlin/io/ia/sdk/gradle/modl/task/ZipModule.kt
Outdated
Show resolved
Hide resolved
gradle-module-plugin/src/main/kotlin/io/ia/sdk/gradle/modl/task/ZipModule.kt
Show resolved
Hide resolved
|
I updated my test setup and results in the QA test section above. |
|
|
||
| group = "io.ia.sdk" | ||
| version = "0.4.1" | ||
| version = "0.5.0-SNAPSHOT" |
There was a problem hiding this comment.
I think this is nearly ready to merge. Just need to strip off the -SNAPSHOT.
There was a problem hiding this comment.
Thanks @brianeray. How do I publish it to nexus? I run ./gradlew publish, but looks like io.ia.sdk.modl has not been pushed.
There was a problem hiding this comment.
There's no Nexus publishing. The GitHub workflow pushes it to plugins.gradle.org.
|
Oh wow. The GitHub workflow is doing Spotless checks. |
|
@brianeray I'm not seeing a merge button, am I still not having the right permission? Can you help me merge this pr? Also why am I not seeing the new version published if the build was successful? |
|
Hmm, that is strange. It is possible that you don't have privileges to merge, but I don't have enough privileges to see your privileges. 😕 Either way though I can merge this. |
Background
Same jar name with more than one version were found in the module build result of some project. Although I was not able to reproduce the problem, in theory this could happen due to the way we collect all dependencies for each module. Please refer to the Updated Analysis section in the ticket below for more detailed investigations.
Changes
Added the checking of the moduleContent before it gets zipped into the '.modl' file. Fail the ignition build if the same jar with multiple versions presented in the same place.
QA test
Added some unit tests to verify the logic. Inspired by Brian's testing, I have made following set up and did my due-diligence:
In ignition repo:
Updated root build.gradle.kts with the following (Have published io.ia.sdk.modl.0.5.0-SNAPSHOT to my local maven):
id("io.ia.sdk.modl") version "0.5.0-SNAPSHOT" apply falseUpdated opc-ua-client/build.gradle.kts with the following (The netty version specified in lib.tooling.toml is 4.1.121.Final):
dependencies {...modlApi("io.netty:netty-buffer:4.1.109.Final")modlApi("io.netty:netty-codec:4.1.109.Final")modlApi("io.netty:netty-handler:4.1.109.Final")}Run task ':Modules:opc-ua:zipModule' in the root project. And I'm getting the following error as expected:
`
FAILURE: Build failed with an exception.
Execution failed for task ':Modules:opc-ua:zipModule'.
vzhang@DV-vzhang-MBP 8.3.0 % ls Modules/opc-ua/build/moduleContent | grep nettynetty-buffer-4.1.109.Final.jarnetty-buffer-4.1.121.Final.jarnetty-channel-fsm-1.0.1.jarnetty-codec-4.1.109.Final.jarnetty-codec-4.1.121.Final.jarnetty-common-4.1.109.Final.jarnetty-common-4.1.121.Final.jarnetty-handler-4.1.109.Final.jarnetty-handler-4.1.121.Final.jarnetty-resolver-4.1.109.Final.jarnetty-resolver-4.1.121.Final.jarnetty-transport-4.1.109.Final.jarnetty-transport-4.1.121.Final.jarnetty-transport-native-unix-common-4.1.109.Final.jarnetty-transport-native-unix-common-4.1.121.Final.jarFixes: IGN-10168