Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51264

Add ability to override the Plugin-Version manifest entry of -SNAPSHOT plugins

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Background

      I have some code that takes a list of .hpi files on disk and builds a temporary throw-away update centre in a docker image providing those plugins. In order to ensure interoperability with other update centres, it needs to parse versions the same way that Jenkins does, namely by reading the Plugin-Version manifest entry.

      I then have some acceptance tests for my plugins that fire up a clean Jenkins instance, configure this update centre and download and install the plugin, thereby verifying the installation experience for new users.

      I am following Continuous Delivery using the model where the Maven Release Plugin creates the release but I do not push changes back to master, instead I push the tags *after* the acceptance tests pass (thus the tags only reflect actual releases) and furthermore, I drop the Nexus Staging repo if the acceptance tests fail.

      Because the release poms are never pushed back to master, the version in the pom.xml on master is *always* 1.x-SNAPSHOT

      I now want to write acceptance tests to verify upgrades from specific known versions. Additionally when testing locally, I have a need to update the development builds of the plugin.

      While I could just manually upload the plugins, this would not reflect the real user experience.

      I need a way to modify the plugin's generated manifest and substitute the Plugin-Version for my own plugin version.

      Proposed solution

      Add a snapshotPluginVersionOverride configuration option to the hpi goal. This would be the version to set in the Plugin-Version manifest entry *but only in the case where the project.version is actually a -SNAPSHOT version*

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/it/snapshot-version-override/invoker.properties
            src/it/snapshot-version-override/pom.xml
            src/it/snapshot-version-override/src/main/java/org/jenkinsci/tools/hpi/its/HelloWorldBuilder.java
            src/it/snapshot-version-override/src/main/resources/index.jelly
            src/it/snapshot-version-override/src/main/resources/org/jenkinsci/tools/hpi/its/HelloWorldBuilder/config.jelly
            src/it/snapshot-version-override/src/main/resources/org/jenkinsci/tools/hpi/its/HelloWorldBuilder/global.jelly
            src/it/snapshot-version-override/src/main/resources/org/jenkinsci/tools/hpi/its/HelloWorldBuilder/help-name.html
            src/it/snapshot-version-override/src/main/resources/org/jenkinsci/tools/hpi/its/Messages.properties
            src/it/snapshot-version-override/src/main/webapp/help-globalConfig.html
            src/it/snapshot-version-override/verify.groovy
            src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java
            http://jenkins-ci.org/commit/maven-hpi-plugin/8ee9605c12b9d31568fcf856356b94eb3d69c7f4
            Log:
            [FIXED JENKINS-51264] Add a snapshotPluginVersionOverride configuration option to hpi and hpl goals

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/it/snapshot-version-override/invoker.properties src/it/snapshot-version-override/pom.xml src/it/snapshot-version-override/src/main/java/org/jenkinsci/tools/hpi/its/HelloWorldBuilder.java src/it/snapshot-version-override/src/main/resources/index.jelly src/it/snapshot-version-override/src/main/resources/org/jenkinsci/tools/hpi/its/HelloWorldBuilder/config.jelly src/it/snapshot-version-override/src/main/resources/org/jenkinsci/tools/hpi/its/HelloWorldBuilder/global.jelly src/it/snapshot-version-override/src/main/resources/org/jenkinsci/tools/hpi/its/HelloWorldBuilder/help-name.html src/it/snapshot-version-override/src/main/resources/org/jenkinsci/tools/hpi/its/Messages.properties src/it/snapshot-version-override/src/main/webapp/help-globalConfig.html src/it/snapshot-version-override/verify.groovy src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java http://jenkins-ci.org/commit/maven-hpi-plugin/8ee9605c12b9d31568fcf856356b94eb3d69c7f4 Log: [FIXED JENKINS-51264] Add a snapshotPluginVersionOverride configuration option to hpi and hpl goals
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java
            http://jenkins-ci.org/commit/maven-hpi-plugin/43cf45163756bbf51af0011cde82829fe23326b0
            Log:
            JENKINS-51264 Noting @since tags

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractHpiMojo.java http://jenkins-ci.org/commit/maven-hpi-plugin/43cf45163756bbf51af0011cde82829fe23326b0 Log: JENKINS-51264 Noting @since tags
            Hide
            stephenconnolly Stephen Connolly added a comment -

            Released as 2.4 (but that version was a partial release, so you really want 2.5 to get this feature)

            Show
            stephenconnolly Stephen Connolly added a comment - Released as 2.4 (but that version was a partial release, so you really want 2.5 to get this feature)

              People

              Assignee:
              stephenconnolly Stephen Connolly
              Reporter:
              stephenconnolly Stephen Connolly
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: