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

Allow the combination filter to accept parameter values

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • matrix-project-plugin
    • None
    • Seen on Windows 2008R2, running Hudson 1.371. Pretty sure it applies to any OS.

      It would be nice if the Combination Filter of a multi-configuration/matrix job could be specified via a parameter, or to have the contents of a parameter inserted into a part of an existing Combination Filter. The typical $PARAM notation could be used.

      We have a large matrix of configuration, taking several hours to run. If one configuration fails, it would be nice to go back and test just that configuration. Hudson-5623 (http://issues.jenkins-ci.org/browse/JENKINS-5623) addresses this same issue. But if that particular issue is too difficult to implement, a configuration Combination Filter would work for us.

      We could use a separate up-stream job to get the information from the user about which configuration to run again, then pass it to the matrix job as a parameter that could be used in the Combination Filter to directly target that one configuration.

          [JENKINS-7285] Allow the combination filter to accept parameter values

          jswager created issue -

          quentinburley added a comment -

          I note that with the 'Groovy Plugi'n installed it is possible to evaluate an expression as a 'System Groovy Script' such as:

          // evaluates to the value of the build param 'myParamName', even in a multi-configuration/matrix job
          Thread.currentThread()?.executable.buildVariableResolver.resolve("myParamName")

          documented here: https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+System+Groovy+script

              • it would be very useful if such expressions could be evaluated in the 'combination filter' of a multi-configuration/matrix job, which currently seems not possible.

          quentinburley added a comment - I note that with the 'Groovy Plugi'n installed it is possible to evaluate an expression as a 'System Groovy Script' such as: // evaluates to the value of the build param 'myParamName', even in a multi-configuration/matrix job Thread.currentThread()?.executable.buildVariableResolver.resolve("myParamName") documented here: https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+System+Groovy+script it would be very useful if such expressions could be evaluated in the 'combination filter' of a multi-configuration/matrix job, which currently seems not possible.

          Mike Elkin added a comment -

          Patch from jenkins-1_414 that does multi-configuration parameters via search/replace on the evaluation string. Parameters will default to true in the MatrixProject but use the selected parameter in MatrixBuild.

          Mike Elkin added a comment - Patch from jenkins-1_414 that does multi-configuration parameters via search/replace on the evaluation string. Parameters will default to true in the MatrixProject but use the selected parameter in MatrixBuild.
          Mike Elkin made changes -

          Oliver Gondža added a comment - - edited

          Oliver Gondža added a comment - - edited Pull request: https://github.com/jenkinsci/jenkins/pull/584

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          changelog.html
          core/src/main/java/hudson/matrix/Combination.java
          core/src/main/java/hudson/matrix/DefaultMatrixExecutionStrategyImpl.java
          core/src/main/java/hudson/matrix/MatrixProject.java
          core/src/main/java/hudson/model/Cause.java
          core/src/test/java/hudson/matrix/CombinationFilterUsingBuildParamsTest.java
          http://jenkins-ci.org/commit/jenkins/b26835ffeb03d1267c31c162928fd1fcea7c41a4
          Log:
          [fixed JENKINS-7285] Use build parameters in combination filters

          Based on the work of Michael Elkin [1].

          [1] https://issues.jenkins-ci.org/secure/attachment/20588/0001-tag-1.414-for-parameters-in-multiconfig-filters.patch

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: changelog.html core/src/main/java/hudson/matrix/Combination.java core/src/main/java/hudson/matrix/DefaultMatrixExecutionStrategyImpl.java core/src/main/java/hudson/matrix/MatrixProject.java core/src/main/java/hudson/model/Cause.java core/src/test/java/hudson/matrix/CombinationFilterUsingBuildParamsTest.java http://jenkins-ci.org/commit/jenkins/b26835ffeb03d1267c31c162928fd1fcea7c41a4 Log: [fixed JENKINS-7285] Use build parameters in combination filters Based on the work of Michael Elkin [1] . [1] https://issues.jenkins-ci.org/secure/attachment/20588/0001-tag-1.414-for-parameters-in-multiconfig-filters.patch
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          This feature was broken again in 1.536 (https://github.com/jenkinsci/jenkins/commit/5b639ae0339ae0507119807e1841d8253d4fbd93). Combination filter with parameters seems always evaluate to true.

          Oliver Gondža added a comment - This feature was broken again in 1.536 ( https://github.com/jenkinsci/jenkins/commit/5b639ae0339ae0507119807e1841d8253d4fbd93 ). Combination filter with parameters seems always evaluate to true.
          Oliver Gondža made changes -
          Assignee New: Oliver Gondža [ olivergondza ]
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          Oliver Gondža added a comment - - edited

          Oliver Gondža added a comment - - edited https://github.com/jenkinsci/jenkins/pull/1015

            olivergondza Oliver Gondža
            jswager jswager
            Votes:
            15 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved: