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

specifying a cli parameter causes unspecified parameters to be blank

      If you have a parameterized job with multiple parameters, all with default values, you can trigger it via an upstream build and all parameters have the default value as expected. This also works when building it via the CLI if you don't specify parameters.

      However as soon as you specify one parameter like "-p PARAM1=foo" then all the other parameters lose their default value and are blank for the build.

      I would expect that specifying one parameter should still allow others to get the default, otherwise in our scripts that invoke CLI builds, we have to put in every parameter and duplicate the default value which is error-prone and is easy to forget when changing one. Confirmed with a fresh and clean 1.370 Hudson.

          [JENKINS-7162] specifying a cli parameter causes unspecified parameters to be blank

          mcrooney created issue -
          mcrooney made changes -
          Description Original: If you have a parameterized job with multiple parameters, all with default values, you can trigger it via an upstream build an all parameters have the default value as expected. This also works when building it via the CLI if you don't specify parameters.

          However as soon as you specify one parameter like "-p PARAM1=foo" then all the other parameters lose their default value and are blank for the build.

          I would expect that specifying one parameter should still allow others to get the default, otherwise in our scripts that invoke CLI builds, we have to put in every parameter and duplicate the default value which is error-prone and is easy to forget when changing one. Confirmed with a fresh and clean 1.370 Hudson.
          New: If you have a parameterized job with multiple parameters, all with default values, you can trigger it via an upstream build and all parameters have the default value as expected. This also works when building it via the CLI if you don't specify parameters.

          However as soon as you specify one parameter like "-p PARAM1=foo" then all the other parameters lose their default value and are blank for the build.

          I would expect that specifying one parameter should still allow others to get the default, otherwise in our scripts that invoke CLI builds, we have to put in every parameter and duplicate the default value which is error-prone and is easy to forget when changing one. Confirmed with a fresh and clean 1.370 Hudson.

          mcrooney added a comment -

          I did some poking around, and it appears that the culprit is AbstractProject.scheduleBuild2. It takes a list of Actions and if it gets any parameters, only uses those, and if it doesn't get ANY, it gets all the defaults. So in there it should probably get all the defaults, then merge into that any parameters specified.

          mcrooney added a comment - I did some poking around, and it appears that the culprit is AbstractProject.scheduleBuild2. It takes a list of Actions and if it gets any parameters, only uses those, and if it doesn't get ANY, it gets all the defaults. So in there it should probably get all the defaults, then merge into that any parameters specified.

          mcrooney added a comment -

          Here is my attempt at a patch for as much as I could understand, though it still isn't doing the actual merging.

          mcrooney added a comment - Here is my attempt at a patch for as much as I could understand, though it still isn't doing the actual merging.
          mcrooney made changes -
          Attachment New: hudson-cli-params.patch [ 19643 ]

          mcrooney added a comment -

          Unfortunately the half-written patch is as much as I can understand about the build/parameter process, so if anyone is able to finish it (I think it just needs to do the merging which is over my head), that would be greatly appreciated, otherwise I am unable to fix it.

          mcrooney added a comment - Unfortunately the half-written patch is as much as I can understand about the build/parameter process, so if anyone is able to finish it (I think it just needs to do the merging which is over my head), that would be greatly appreciated, otherwise I am unable to fix it.

          dogfood added a comment -

          Integrated in hudson_main_trunk #200
          [FIXED-JENKINS-7162]
          Hudson ignores Maven pom.xml path when it is specified as absolute path.
          Provided utility methods for checking whether a path is absolute and
          absolutizing a given path (w.r.t. a base).
          Provided a unit test case for this scenario (@Bug 7261).

          km :
          Files :

          • /trunk/hudson/main/core/src/main/java/hudson/util/IOUtils.java
          • /trunk/hudson/main/test/src/test/java/hudson/maven/MavenProjectTest.java
          • /trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          • /trunk/hudson/main/test/src/test/resources/hudson/maven/test-pom-7162.xml
          • /trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java

          dogfood added a comment - Integrated in hudson_main_trunk #200 [FIXED-JENKINS-7162] Hudson ignores Maven pom.xml path when it is specified as absolute path. Provided utility methods for checking whether a path is absolute and absolutizing a given path (w.r.t. a base). Provided a unit test case for this scenario (@Bug 7261). km : Files : /trunk/hudson/main/core/src/main/java/hudson/util/IOUtils.java /trunk/hudson/main/test/src/test/java/hudson/maven/MavenProjectTest.java /trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java /trunk/hudson/main/test/src/test/resources/hudson/maven/test-pom-7162.xml /trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java

          mcrooney added a comment -

          Hm, I'm pretty sure that comment is completely irrelevant.

          mcrooney added a comment - Hm, I'm pretty sure that comment is completely irrelevant.
          Danny Staple made changes -
          Component/s New: parameters [ 15594 ]
          Component/s New: ssh [ 16049 ]

          Danny Staple added a comment -

          This also affects the SSH cli access.
          #JENKINS-11691 looks like a duplicate of this.

          Danny Staple added a comment - This also affects the SSH cli access. # JENKINS-11691 looks like a duplicate of this.

            Unassigned Unassigned
            mcrooney mcrooney
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: