Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-2785

Update POM to include micro version

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Story Points:
      1
    • Sprint:
      Winter 4 Feb 8 - Feb 19, Winter 5 Feb 22 - Mar 5, Winter 6 Mar 8 - Mar 19, Spring 1 2021 Mar 22 - Apr 2

      Description

      Modify the quickload app POM to specify micro versions in the MANIFEST.
      Please fork: https://bitbucket.org/lorainelab/quickload-saver.git to work on this.
      The app should be declared to depend on IGB packages versions 9.1.8 or higher, up to but not including version 10.
      I'm not sure how the App Store or the within-IGB App Manager will handle this, but I would like to investigate.

        Attachments

        1. App.PNG
          App.PNG
          205 kB
        2. change in pom.xml file.PNG
          change in pom.xml file.PNG
          28 kB
        3. Logs.PNG
          Logs.PNG
          70 kB
        4. New Manifest.PNG
          New Manifest.PNG
          48 kB
        5. Old Manifest.PNG
          Old Manifest.PNG
          48 kB
        6. Repository.PNG
          Repository.PNG
          102 kB

          Issue Links

            Activity

            Hide
            ann.loraine Ann Loraine added a comment -

            To achieve this, you will need to understand how the mvn bundle plugin works, how BND tool works, and how the mvn plugin interprets its configuration in the pom.xml file to add the correct OSGi-specific meta-data to the MANIFEST.mf file bundled with the jar file.

            Omkar Marne - Can you take over working on this for now while Irvin Naylor completes the OSGi on-boarding task?

            Maven bundle plugin is nothing but a wrapper for the BND tool, described here: https://bnd.bndtools.org/. It's main job is to translate the dependencies listed in the pom.xml file and the imports listed in the actual java code into new code that gets added to the MANIFEST.mf file in a jar file. When a jar file is loaded into the OSGi framework, the framework literally reads this MANIFEST.mf file and uses the information there to determine if the bundle can properly load and start, or not.

            Therefore you need to try different configurations in the pom.xml, build the jar, and then look at the manifest file in the jar to make sure it is correct.

            Show
            ann.loraine Ann Loraine added a comment - To achieve this, you will need to understand how the mvn bundle plugin works, how BND tool works, and how the mvn plugin interprets its configuration in the pom.xml file to add the correct OSGi-specific meta-data to the MANIFEST.mf file bundled with the jar file. Omkar Marne - Can you take over working on this for now while Irvin Naylor completes the OSGi on-boarding task? Maven bundle plugin is nothing but a wrapper for the BND tool, described here: https://bnd.bndtools.org/ . It's main job is to translate the dependencies listed in the pom.xml file and the imports listed in the actual java code into new code that gets added to the MANIFEST.mf file in a jar file. When a jar file is loaded into the OSGi framework, the framework literally reads this MANIFEST.mf file and uses the information there to determine if the bundle can properly load and start, or not. Therefore you need to try different configurations in the pom.xml, build the jar, and then look at the manifest file in the jar to make sure it is correct.
            Hide
            omarne Omkar Marne (Inactive) added a comment -

            Sure, assigned it to myself.

            Show
            omarne Omkar Marne (Inactive) added a comment - Sure, assigned it to myself.
            Hide
            omarne Omkar Marne (Inactive) added a comment -

            I tried adding the dependencies and modifying the existing dependencies in Pom.xml file with the version 9.1.10 specified in the manifest file but the build failed because there is no 9.1.10 version in the maven repository. I think somehow I need to add the 9.1.10 version in the maven repository first and then build the jar file.

            Show
            omarne Omkar Marne (Inactive) added a comment - I tried adding the dependencies and modifying the existing dependencies in Pom.xml file with the version 9.1.10 specified in the manifest file but the build failed because there is no 9.1.10 version in the maven repository. I think somehow I need to add the 9.1.10 version in the maven repository first and then build the jar file.
            Hide
            ann.loraine Ann Loraine added a comment - - edited

            Read this: https://semver.org/ and understand the meaning of "semantic versioning."
            Also review OSGi method for specifying dependencies. This is NOT the same thing as specifying dependencies in a pom.xml file.

            pom.xml: contains instructions for building an artifact, using external libraries, called "dependencies"

            manifest.mf: is a file that is packaged with a jar file that can contain OSGi-specific metadata

            The maven bundle plugins uses pom.xml to accept parameters and add OSGi-specific metadata to the manifest.mf file

            (Behind of the scenes, mvn's "compile" and maybe "package" plugins are creating the manifest.mf. The mvn bundle plugin adds to that process.)

            Show
            ann.loraine Ann Loraine added a comment - - edited Read this: https://semver.org/ and understand the meaning of "semantic versioning." Also review OSGi method for specifying dependencies. This is NOT the same thing as specifying dependencies in a pom.xml file. pom.xml: contains instructions for building an artifact, using external libraries, called "dependencies" manifest.mf: is a file that is packaged with a jar file that can contain OSGi-specific metadata The maven bundle plugins uses pom.xml to accept parameters and add OSGi-specific metadata to the manifest.mf file (Behind of the scenes, mvn's "compile" and maybe "package" plugins are creating the manifest.mf. The mvn bundle plugin adds to that process.)
            Hide
            cdias1 Chester Dias (Inactive) added a comment -

            My findings
            The version of packages needed for import are all generated in the manifest file by the apache felix plugin using the below code of the pom.xml

            <configuration>
                                 <instructions>
                                     <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                                     <Import-Package>*</Import-Package>
                                     <Export-Package/>
                                     <Bundle-Description>${bundleDescription}</Bundle-Description>
                                     <Service-Component>*</Service-Component>
                                 </instructions>
                             </configuration>
            

            The * in the Import packages indicate to use possible version range ditermined by the plugin. This can be overwritten by explicitly mentioning the version. I am currently in the process of finding the most valid macro expression which will pick the version from the dependency version and a hardcoded value as a higher micro version.

            Refrence: https://davidvaleri.wordpress.com/2011/04/07/secrets-of-the-felix-bundle-plug-in-macros-revealed/

            Show
            cdias1 Chester Dias (Inactive) added a comment - My findings The version of packages needed for import are all generated in the manifest file by the apache felix plugin using the below code of the pom.xml <configuration> <instructions> <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> <Import-Package>*</Import-Package> <Export-Package/> <Bundle-Description>${bundleDescription}</Bundle-Description> <Service-Component>*</Service-Component> </instructions> </configuration> The * in the Import packages indicate to use possible version range ditermined by the plugin. This can be overwritten by explicitly mentioning the version. I am currently in the process of finding the most valid macro expression which will pick the version from the dependency version and a hardcoded value as a higher micro version. Refrence: https://davidvaleri.wordpress.com/2011/04/07/secrets-of-the-felix-bundle-plug-in-macros-revealed/
            Hide
            cdias1 Chester Dias (Inactive) added a comment - - edited

            [~aloraine] There are 2 sets of packages listed in the import packages, one with package name org.lorainelab.igb and the other with com.affymetrix.* Do we need to change the versions of both to be [9.1.8, 10) in the manifest file?

            Show
            cdias1 Chester Dias (Inactive) added a comment - - edited [~aloraine] There are 2 sets of packages listed in the import packages, one with package name org.lorainelab.igb and the other with com.affymetrix.* Do we need to change the versions of both to be [9.1.8, 10) in the manifest file?
            Hide
            ann.loraine Ann Loraine added a comment -

            I would recommend changing the POM to specify the same version for all platform bundles. The version used should be the highest version of platform bundles listed.
            However, it would be useful to stick with the versions specified by the developer as this would expose any problems or incorrect assumptions baked in to the App Store or the App Manager component within IGB.

            Please note that "Import-Package" is meant to use a particular syntax for specifying versions and ranges of versions. So in this case, you can use the proper syntax to specify "version 9.1.8 and higher" those bundles that require it.

            You can also specify an upper limit. However, it is unclear if the upper limit can be specified because those higher versions do not exist yet. It is very possible that the App, as written, will work perfectly well with those versions.

            Show
            ann.loraine Ann Loraine added a comment - I would recommend changing the POM to specify the same version for all platform bundles. The version used should be the highest version of platform bundles listed. However, it would be useful to stick with the versions specified by the developer as this would expose any problems or incorrect assumptions baked in to the App Store or the App Manager component within IGB. Please note that "Import-Package" is meant to use a particular syntax for specifying versions and ranges of versions. So in this case, you can use the proper syntax to specify "version 9.1.8 and higher" those bundles that require it. You can also specify an upper limit. However, it is unclear if the upper limit can be specified because those higher versions do not exist yet. It is very possible that the App, as written, will work perfectly well with those versions.
            Hide
            cdias1 Chester Dias (Inactive) added a comment -

            The version of the app with the change now doesn't list as installable in the manager on 9.1.6 but appears in 9.1.8

            Please Review: https://bitbucket.org/chesterdias/quickload-saver-chester-local/branch/IGBF-2785#diff

            Show
            cdias1 Chester Dias (Inactive) added a comment - The version of the app with the change now doesn't list as installable in the manager on 9.1.6 but appears in 9.1.8 Please Review: https://bitbucket.org/chesterdias/quickload-saver-chester-local/branch/IGBF-2785#diff
            Hide
            ann.loraine Ann Loraine added a comment -

            Omkar Marne and Irvin Naylor: Please perform functional and code review.

            For functional review, confirm that the fix is working as follows:

            • Pull the branch from Chester (see above)
            • Push the branch to your fork
            • Build the branch in bitbucket pipelines
            • Confirm that the newly built App can be installed using App Manager GUI and used in 9.1.8
            • Check the functionality and watch the logs for any possible exceptions that may occur
            • Confirm that the App cannot be installed in 9.1.6
            • Download and unpack the jar file; check that MANIFEST file and confirm it contains the proper text in import packages fields

            For each of the above, describe what you observed. State whether the test has passed or failed.

            Please add additional tests as you see fit.

            Show
            ann.loraine Ann Loraine added a comment - Omkar Marne and Irvin Naylor : Please perform functional and code review. For functional review, confirm that the fix is working as follows: Pull the branch from Chester (see above) Push the branch to your fork Build the branch in bitbucket pipelines Confirm that the newly built App can be installed using App Manager GUI and used in 9.1.8 Check the functionality and watch the logs for any possible exceptions that may occur Confirm that the App cannot be installed in 9.1.6 Download and unpack the jar file; check that MANIFEST file and confirm it contains the proper text in import packages fields For each of the above, describe what you observed. State whether the test has passed or failed. Please add additional tests as you see fit.
            Hide
            omarne Omkar Marne (Inactive) added a comment -

            New manifest file.

            Show
            omarne Omkar Marne (Inactive) added a comment - New manifest file.
            Hide
            omarne Omkar Marne (Inactive) added a comment -

            Old manifest file.

            Show
            omarne Omkar Marne (Inactive) added a comment - Old manifest file.
            Hide
            omarne Omkar Marne (Inactive) added a comment -

            Change in the pom.xml

            Show
            omarne Omkar Marne (Inactive) added a comment - Change in the pom.xml
            Show
            omarne Omkar Marne (Inactive) added a comment - Code review Description. Please refer : https://docs.google.com/document/d/1Jkot1-5W5g6wvYTDhw7NcZIThic_8x47Wo0irX46zcc/edit#heading=h.3fq7y5jrjfrx
            Hide
            ann.loraine Ann Loraine added a comment -

            Google doc above observes that the MANIFESTs from jars built before and after the proposed change are identical, but the proper installation behavior is only observed for the jar build using the new code.

            I do not see how that is possible. Please investigate more carefully. Note that when you install or upgrade an App, the App's bundle is downloaded and saved to the user's local bundle cache. When you un-install an App, the bundle is deleted.

            Also, investigate other meta-data assets provided in the jar.

            Show
            ann.loraine Ann Loraine added a comment - Google doc above observes that the MANIFESTs from jars built before and after the proposed change are identical, but the proper installation behavior is only observed for the jar build using the new code. I do not see how that is possible. Please investigate more carefully. Note that when you install or upgrade an App, the App's bundle is downloaded and saved to the user's local bundle cache. When you un-install an App, the bundle is deleted. Also, investigate other meta-data assets provided in the jar.
            Hide
            omarne Omkar Marne (Inactive) added a comment - - edited

            Dr. Loraine you were right, we were comparing the same manifest files. I have attached the snapshots again. Micro versions in the manifest files have changed. After code change in pom.xml, manifest is taking the micro versions from pom.xml.

            The app bundle is getting added and deleted when we install and uninstall the app. Also the repository.xml file has got updated with the updated micro versions.

            Please check the code review and additional snapshots attached.

            https://docs.google.com/document/d/1Jkot1-5W5g6wvYTDhw7NcZIThic_8x47Wo0irX46zcc/edit#

            Ticket is ready for pull request and assigned to Chester Dias

            Show
            omarne Omkar Marne (Inactive) added a comment - - edited Dr. Loraine you were right, we were comparing the same manifest files. I have attached the snapshots again. Micro versions in the manifest files have changed. After code change in pom.xml, manifest is taking the micro versions from pom.xml. The app bundle is getting added and deleted when we install and uninstall the app. Also the repository.xml file has got updated with the updated micro versions. Please check the code review and additional snapshots attached. https://docs.google.com/document/d/1Jkot1-5W5g6wvYTDhw7NcZIThic_8x47Wo0irX46zcc/edit# Ticket is ready for pull request and assigned to Chester Dias
            Show
            cdias1 Chester Dias (Inactive) added a comment - - edited PR: https://bitbucket.org/lorainelab/quickload-saver/pull-requests/2/igbf-2785-added-manifest-versioning
            Hide
            ann.loraine Ann Loraine added a comment -

            PR is merged and App is ready for testing from Downloads folder of https://bitbucket.org/lorainelab/quickload-saver/downloads/.

            Show
            ann.loraine Ann Loraine added a comment - PR is merged and App is ready for testing from Downloads folder of https://bitbucket.org/lorainelab/quickload-saver/downloads/ .
            Hide
            inaylor Irvin Naylor (Inactive) added a comment -

            Can confirm, App does indeed work as intended on 9.1.8 master, output of Homosapeins 2013 is sent to correct contents.txt file

            Show
            inaylor Irvin Naylor (Inactive) added a comment - Can confirm, App does indeed work as intended on 9.1.8 master, output of Homosapeins 2013 is sent to correct contents.txt file

              People

              • Assignee:
                inaylor Irvin Naylor (Inactive)
                Reporter:
                ann.loraine Ann Loraine
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: