Skip to content

Fail ignition build when the same jar in moduleContent folder with multiple versions detected#68

Merged
brianeray merged 4 commits intoinductiveautomation:masterfrom
ia-vzhang:IGN-10168-new
Aug 27, 2025
Merged

Fail ignition build when the same jar in moduleContent folder with multiple versions detected#68
brianeray merged 4 commits intoinductiveautomation:masterfrom
ia-vzhang:IGN-10168-new

Conversation

@ia-vzhang
Copy link
Contributor

@ia-vzhang ia-vzhang commented Aug 22, 2025

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:

  1. 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 false

  2. Updated 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")
    }

  3. Run task ':Modules:opc-ua:zipModule' in the root project. And I'm getting the following error as expected:
    `

Task :Modules:opc-ua:zipModule FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':Modules:opc-ua:zipModule'.

Library 'netty-resolver' exits in multiple versions in /Users/vzhang/workspace/ignition/release/8.3.0/Modules/opc-ua/build/moduleContent
`

  1. Examined the moduleContent directory, and I'm getting the following as expected:
    vzhang@DV-vzhang-MBP 8.3.0 % ls Modules/opc-ua/build/moduleContent | grep netty
    netty-buffer-4.1.109.Final.jar
    netty-buffer-4.1.121.Final.jar
    netty-channel-fsm-1.0.1.jar
    netty-codec-4.1.109.Final.jar
    netty-codec-4.1.121.Final.jar
    netty-common-4.1.109.Final.jar
    netty-common-4.1.121.Final.jar
    netty-handler-4.1.109.Final.jar
    netty-handler-4.1.121.Final.jar
    netty-resolver-4.1.109.Final.jar
    netty-resolver-4.1.121.Final.jar
    netty-transport-4.1.109.Final.jar
    netty-transport-4.1.121.Final.jar
    netty-transport-native-unix-common-4.1.109.Final.jar
    netty-transport-native-unix-common-4.1.121.Final.jar

Fixes: IGN-10168

@brianeray
Copy link
Collaborator

Replaces #66 and #67. Same PR, more regular account.

@brianeray brianeray self-requested a review August 22, 2025 23:01
Copy link
Collaborator

@brianeray brianeray left a comment

Choose a reason for hiding this comment

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

First pass, mostly just looking at changes.

I will also try to integration test locally with some fake modules.

@ia-vzhang
Copy link
Contributor Author

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"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is nearly ready to merge. Just need to strip off the -SNAPSHOT.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @brianeray. How do I publish it to nexus? I run ./gradlew publish, but looks like io.ia.sdk.modl has not been pushed.

Copy link
Collaborator

@brianeray brianeray Aug 27, 2025

Choose a reason for hiding this comment

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

There's no Nexus publishing. The GitHub workflow pushes it to plugins.gradle.org.

@ia-vzhang ia-vzhang requested a review from brianeray August 27, 2025 16:26
brianeray
brianeray previously approved these changes Aug 27, 2025
@brianeray
Copy link
Collaborator

Oh wow. The GitHub workflow is doing Spotless checks.

Execution failed for task ':spotlessKotlinCheck'.
Watching 401 directories to track changes
> The following files had format violations:
      src/functionalTest/kotlin/io/ia/sdk/gradle/modl/task/ZipModuleTests.kt
          @@ -6,13 +6,13 @@
           import·org.gradle.api.Project
           import·org.gradle.api.internal.project.DefaultProject
           import·org.gradle.testfixtures.ProjectBuilder
              ... etc ...

@ia-vzhang
Copy link
Contributor Author

ia-vzhang commented Aug 27, 2025

@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?

@ia-vzhang ia-vzhang requested a review from brianeray August 27, 2025 18:54
@brianeray
Copy link
Collaborator

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.

@brianeray brianeray merged commit ab2f6b3 into inductiveautomation:master Aug 27, 2025
1 check passed
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.

4 participants

Comments