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

upgrade to the release plugin has left the plugin broken

      I cloned the release plugin repo from github to customize the plugin. The plugin when packaged on local machine it does a successful package but when the hpi package is uploaded to jenkins server the release button on the left panel is not showing up. When I checked out the older branch from the repository the plugin works perfectly fine. May be the recent changes is failing the plugin.

          [JENKINS-27722] upgrade to the release plugin has left the plugin broken

          Harsh Shah created issue -
          Harsh Shah made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]

          dan tran added a comment -

          dan tran added a comment - looks to me https://github.com/jenkinsci/release-plugin/commit/54a13e3f7af9035eb091a0f6880ccf677523899c the last commit breaks it

          Glen Ritchie added a comment - - edited

          Yup, that's my change. It works fine on my 1.574 version of Jenkins but not the latest 1.608.

          Error from log is:

          WARNING: Caught exception evaluating: h.filterDescriptors(it,attrs.descriptors) in /job/test/configure. Reason: java.lang.NullPointerException
          java.lang.NullPointerException
          	at hudson.model.DescriptorVisibilityFilter.apply(DescriptorVisibilityFilter.java:53)
          	at hudson.Functions.filterDescriptors(Functions.java:1726)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          

          I'll try to find out why and fix it.

          Edit:
          Ok, the reason it's failing is because in config.jelly I changed the h.xxxx methods to instance.xxxx calls. These fail because a newly added instance will always be null. I guess it must have worked for me because I already had the previous release plugin installed at some point, and to my shame I didn't test it on a completely new install.

          The reason it was changed to 'instance' was so that it could call the function getBuildSteps() that returns both publishers and builder descriptors in one list so they can both be used as build steps.

          Glen Ritchie added a comment - - edited Yup, that's my change. It works fine on my 1.574 version of Jenkins but not the latest 1.608. Error from log is: WARNING: Caught exception evaluating: h.filterDescriptors(it,attrs.descriptors) in /job/test/configure. Reason: java.lang.NullPointerException java.lang.NullPointerException at hudson.model.DescriptorVisibilityFilter.apply(DescriptorVisibilityFilter.java:53) at hudson.Functions.filterDescriptors(Functions.java:1726) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) I'll try to find out why and fix it. Edit: Ok, the reason it's failing is because in config.jelly I changed the h.xxxx methods to instance.xxxx calls. These fail because a newly added instance will always be null. I guess it must have worked for me because I already had the previous release plugin installed at some point, and to my shame I didn't test it on a completely new install. The reason it was changed to 'instance' was so that it could call the function getBuildSteps() that returns both publishers and builder descriptors in one list so they can both be used as build steps.

          dan tran added a comment -

          Thanks, looking forward to your fix.

          dan tran added a comment - Thanks, looking forward to your fix.

          Glen Ritchie added a comment -

          Here is a fix for the issue and I also added a unit test to check for the presence of the "Release" links in the job page when the release check-box is enabled.

          https://github.com/glenritchie/release-plugin/tree/JENKINS-27722

          Glen Ritchie added a comment - Here is a fix for the issue and I also added a unit test to check for the presence of the "Release" links in the job page when the release check-box is enabled. https://github.com/glenritchie/release-plugin/tree/JENKINS-27722

          Harsh Shah added a comment -

          Thanks Glen

          Harsh Shah added a comment - Thanks Glen

          dan tran added a comment -

          tested the latest jenkins-release-plugin from source and the 'release' does not show up at navigation bar. It works when I revert it. The log does not show any error

          dan tran added a comment - tested the latest jenkins-release-plugin from source and the 'release' does not show up at navigation bar. It works when I revert it. The log does not show any error

          Glen Ritchie added a comment -

          @dan tran, Was that from my fork or the official git repo? I haven't done a pull request yet to the official so it hasn't been merged.

          I'm having difficulty reproducing this issue, can you post more information about the environment you are using to test and maybe some steps to reproduce (including any and all versions that you are using) as well?

          In addition can you verify the "Configure release build" option is enabled in the job configuration?

          Glen Ritchie added a comment - @dan tran, Was that from my fork or the official git repo? I haven't done a pull request yet to the official so it hasn't been merged. I'm having difficulty reproducing this issue, can you post more information about the environment you are using to test and maybe some steps to reproduce (including any and all versions that you are using) as well? In addition can you verify the "Configure release build" option is enabled in the job configuration?

          dan tran added a comment -

          @Glen

          Yes It is from your fork. I am using Jenkins 1.596.2, suse 11.3 x64, jdk8. I can see the release configuration in my job, and when enable, configured and save the job config, the release option at navigation is not visible

          Not sure what more I can provide

          dan tran added a comment - @Glen Yes It is from your fork. I am using Jenkins 1.596.2, suse 11.3 x64, jdk8. I can see the release configuration in my job, and when enable, configured and save the job config, the release option at navigation is not visible Not sure what more I can provide

            petehayes Peter Hayes
            hshah Harsh Shah
            Votes:
            3 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: