Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14638

Inconsistent library versions notice.

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

       
      Hi. I have implemented a tool to detect library version inconsistencies. Your project have 27 inconsistent libraries and 16 false consistent libraries.
       
      Take com.google.guava:guava for example, this library is declared as version 19.0 in components/camel-ignite, 28.0-jre in catalog/camel-main-maven-plugin, 14.0.1 in components/camel-hbase and etc... Such version inconsistencies may cause unnecessary maintenance effort in the long run. For example, if two modules become inter-dependent, library version conflict may happen. It has already become a common issue and hinders development progress. Thus a version harmonization is necessary.
       
      Provided we applied a version harmonization, I calculated the cost it may have to harmonize to all upper versions including an up-to-date one. The cost refers to POM config changes and API invocation changes. Take com.google.guava:guava for example, if we harmonize all the library versions into 28.2-android. The concern is, how much should the project code adapt to the newer library version. We list an effort table to quantify the harmonization cost.
       
      The effort table is listed below. It shows the overall harmonization effort by modules. The columns represents the number of library APIs and API calls(NA,NAC), deleted APIs and API calls(NDA,NDAC) as well as modified API and API calls(NMA,NMAC). Modified APIs refers to those APIs whose call graph is not the same as previous version. Take the first row for example, if upgrading the library into version 28.2-android. Given that 14 APIs is used in module components/camel-wordpress, 0 of them is deleted in a recommended version(which will throw a NoMethodFoundError unless re-compiling the project), 14 of them is regarded as modified which could break the former API contract.
       
       

      Index Module NA(NAC) NDA(NDAC) NMA(NMAC)
      1 components/camel-wordpress 14(21) 0(0) 14(21)
      2 components/camel-gora 1(3) 0(0) 1(3)
      3 components/camel-ignite 2(2) 0(0) 1(1)
      4 .. .. .. ..

       
       
      Also we provided another table to show the potential files that may be affected due to library API change, which could help to spot the concerned API usage and rerun the test cases. The table is listed below.

      Module File Type API
      components/camel-ignite components/camel-ignite/src/test/java/org/apache/camel/component/ignite/TestIgniteComputeResources.java modify com.google.common.collect.Lists.newArrayList()
      components/camel-gora components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConfiguration.java modify com.google.common.base.Strings.isNullOrEmpty(java.lang.String)
      components/camel-wordpress components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/api/model/User.java modify com.google.common.base.MoreObjects.ToStringHelper.addValue(java.lang.Object)
      4 .. .. ..

       
      As for false consistency, take org.apache.geronimo.specs geronimo-annotation_1.0_spec jar for example. The library is declared in version 1.1.1 in all modules. However they are declared differently. As components are developed in parallel, if one single library version is updated, which could become inconsistent as mentioned above, may cause above-mentioned inconsistency issues

      If you are interested, you can have a more complete and detailed report in the attached PDF file.

        Attachments

        1. apache camel.pdf
          973 kB
          Kaifeng Huang

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              calvinhkf Kaifeng Huang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: