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

Default value appears in axes when there's an input variable

      The plugin continuously adds the 'default' axis value even if there's an existing variable in the environment.Dynamic axis source: String parameter.

      The issue appears on the particular job only and cannot be reproduced on others. Job reloading does not resolve the issue.

      Cause in DynamicAxis::rebuild():
      1. method flushes the internal axis values cache
      2. method calls build.getEnvironment to get the variable value
      3. an external plugin (Perforce SCM in my case) calls DynamicAxis.getValues() to resolve variables
      4. DynamicAxis.getValues() adds 'default', because the cache is empty
      ....
      X. method adds variables from the variable, but 'default' still exists in the list

      System log on 1 config (reverse order):
      Mar 04, 2015 11:01:38 AM ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis
      FINE: Returning axis list [default, 1]
      Mar 04, 2015 11:01:38 AM ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis
      FINE: Variable value is '1'
      Mar 04, 2015 11:01:38 AM ca.silvermaplesolutions.jenkins.plugins.daxis.DynamicAxis
      FINE: Rebuilding axis names from variable 'NUMBER_FILES'

          [JENKINS-27243] Default value appears in axes when there's an input variable

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/test/java/ca/silvermaplesolutions/jenkins/plugins/daxis/DynamicAxisTest.java
          http://jenkins-ci.org/commit/dynamic-axis-plugin/229a41c18f5c95bd47bd1bc308095d37366a23ba
          Log:
          JENKINS-27243 - Added Unit test for the issue

          The commit also adds a test of the basic functionality

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/test/java/ca/silvermaplesolutions/jenkins/plugins/daxis/DynamicAxisTest.java http://jenkins-ci.org/commit/dynamic-axis-plugin/229a41c18f5c95bd47bd1bc308095d37366a23ba Log: JENKINS-27243 - Added Unit test for the issue The commit also adds a test of the basic functionality Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/ca/silvermaplesolutions/jenkins/plugins/daxis/DynamicAxis.java
          http://jenkins-ci.org/commit/dynamic-axis-plugin/9b4b0d526d7d5bec525113ad91d1c59831f4d470
          Log:
          [FIXED JENKINS-27243] - Properly handle axis values cache to avoid issues on nested calls.

          The change also improves logging in the plugin.

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/ca/silvermaplesolutions/jenkins/plugins/daxis/DynamicAxis.java http://jenkins-ci.org/commit/dynamic-axis-plugin/9b4b0d526d7d5bec525113ad91d1c59831f4d470 Log: [FIXED JENKINS-27243] - Properly handle axis values cache to avoid issues on nested calls. The change also improves logging in the plugin. Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/ca/silvermaplesolutions/jenkins/plugins/daxis/DynamicAxis.java
          src/test/java/ca/silvermaplesolutions/jenkins/plugins/daxis/DynamicAxisTest.java
          http://jenkins-ci.org/commit/dynamic-axis-plugin/b8732442adfac7d3a3de27e2dd6386aaf6f82a7e
          Log:
          Merge pull request #5 from oleg-nenashev/master

          JENKINS-27243 - Fix the improper Axis values initialization on buildEnvironment() with circular dependencies

          Compare: https://github.com/jenkinsci/dynamic-axis-plugin/compare/bbac467585d2...b8732442adfa

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/ca/silvermaplesolutions/jenkins/plugins/daxis/DynamicAxis.java src/test/java/ca/silvermaplesolutions/jenkins/plugins/daxis/DynamicAxisTest.java http://jenkins-ci.org/commit/dynamic-axis-plugin/b8732442adfac7d3a3de27e2dd6386aaf6f82a7e Log: Merge pull request #5 from oleg-nenashev/master JENKINS-27243 - Fix the improper Axis values initialization on buildEnvironment() with circular dependencies Compare: https://github.com/jenkinsci/dynamic-axis-plugin/compare/bbac467585d2...b8732442adfa

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: