Skip to end of metadata
Go to start of metadata

Plugin Information

View Matrix Configuration Parameter on the plugin site for more information.

This plugin allows a user to choose which matrix combinations he wants to run, as opposed to the default behaviour where jenkins runs all combinations:


Using:

After clicking the build, the user gets a html table with a checkbox for each matrix combination.

After clicking the submit button, only checked combinations will run.

Configuration:

After installation a new type of parameter was added (Matrix Combinations Parameter).

 

  • Configure your matrix job and add exactly one parameter with this type.
  • Fill the name of the parameter.
  • Define the Axes as usual

Acknowledgements

Many thanks to Nathan Grunzweig for giving me the idea and help with the implmentation of this plugin.
I would also like to thank Christian Wolfgang, who developed the Matrix Reloaded Plugin which gave me the inspiration to implement it.

Change Log

Version 1.3.0 (3 Mar 2018)

  • Now targets Jenkins >= 1.651.3
  • FIXED: Exception when building a project with matrix-combinations in Jenkins 2.102+ (JEP-200) (JENKINS-49573)

Version 1.2.0 (3 Jun 2017)

  • Now targets Jenkins >= 1.532
  • FIXED: HTML in description is always escaped (JENKINS-42902)

Version 1.1.1 (17 Apr 2017)

  • Fixed: "By build result" cannot be added (NPE when adding "By build result") (JENKINS-42626)
  • Remove the duplicated parameter name display (JENKINS-39157)

Version 1.1.0 (1 Oct 2016)

  • New feature: Configurable shortcut links (JENKINS-29797, JENKINS-36894, JENKINS-36860)
    • You can define shortcut links in the job configuration page:
      • All: Select all combinations
      • None: Delelect all combinations
      • Previous: Select combinations build previously
      • By build result: Select combinations with previous results
      • By combination filter: Select combinations with combinations filter expression
  • Support CLI (JENKINS-25624)
    • You can pass a combinations filter expression as the parameter value via CLI.
  • Support WebAPI (JENKINS-37815)
    • You can pass a combinations filter expression as the parameter value via WebAPI.
  • Refactored HTML implementations (Fixed JENKINS-30918)

Version 1.0.9 (11 Jul 2015)

  • Fixed NPE for running builds (JENKINS-28824)
  • Fixed exceptions in parameter pages or rebuild pages for non multi-configuration builds triggered with combinations parameters (in the case triggered with parameterized-trigger-plugin). (JENKINS-27233)

Version 1.0.8 (28 Apr 2015)

  • FIXED: "Successful" and "Failed" links do not work (JENKINS-23609)

Version 1.0.7 (05 Jul 2014)

Version 1.0.6 (29 Mar 2014)

Version 1.0.5 (17 Feb 2014)

  • Support in rebuild

Version 1.0.4 (24 November 2013)

  • No need to fill combinations filter

Version 1.0.3 (28 July 2013)

  • Initial release

Issues

To report a bug or request an enhancement to this plugin please create a ticket in JIRA (you need to login or to sign up for an account). Also have a look on How to report an issue

Key T P Summary
Loading...
Refresh

10 Comments

  1. Omer:

    Excellent work on the plugin....  A small comment... if a multi-configuration project has only one axis then the build screen doesn't show any labels..

    .

    could this be fixed?

    1. This problem was already fixed by Ikedam. Check out the new 1.0.4 version which was just released

  2. Hi OMer

    great plugin , can I define the combination as a parameter ? ( I want to trigger the matrix job from another job ...)

    Thanks , Mor

    1. Thanks :)

      See my Reply to Jeremy below.

  3. Hello,

    How could I pass a Matrix Combinations Filter Parameter when using the Jenkins API to call a Matrix job?

    I have tried the following, without success (the build starts, but with an empty matrix so nothing happens):

    curl -X POST http://jenkins-server/jenkins/job/matrix-job/buildWithParameters?MATRIX_FILTER=<filter>
    

    Where <filter> is the url-encoded version of: (TARGET=="Linux"||TARGET=="Win32").

    Is that even possible? Would that be the responsibility of this plugin, or of the Matrix job?

    Any help would be greatly appreciated, thanks!

    1. The plugin is based on ui, and it's less suitable for automation. 

      You can try and do the following for regular matrix job (this is how the first version of the plugin worked)

      define a regular string parameter i.e. filterValue.

      since Jenkins 1.515: Define the matrix combination filter to accept the value of the parameter and set it like that 

      new GroovyShell(binding).evaluate(filterValue))

      before Jenkins 1.515: Define the matrix combination filter to accept the value of the parameter and set it like that

      if (Thread.currentThread().getClass().getName().equals('hudson.model.OneOffExecutor')) {str=Thread.currentThread().getCurrentExecutable().getBuildVariables().get('filterValue');new GroovyShell(binding).evaluate(str)}

      Now you can set the value of the filterValue to be (TARGET=="Linux"||TARGET=="Win32") or what ever value you want as long as the combinations you want to run are evaluated to true.

      Good Luck,

      Omer

      1. Hi Omer,

        Thanks for the quick reply!

        I'm using Jenkins 1.551 (latest stable), running on CentOS 6.5.

        When I do what you suggested, it works if I delete the Matrix Combinations Parameter, crashes otherwise. I'm guessing that's because both the filterValue parameter and your plugin are trying to manipulate the matrix.

        Ideally, I want to be able to trigger builds automatically, using the api, in which case I do not need the Matrix Combination Parameter, and also trigger manual builds, in which case you plugin is really useful.

        Any advice?

  4. Thanks for adding the default combination in your latest update!

    After upgrading Jenkins to 1.561, I can no longer start a Matrix job using the Matrix Combination Plugin. This is the first release where the Matrix Job is part of its own plugin, so I'm guessing this created some breaking changes with your plugin.

    Here is the ticket: https://issues.jenkins-ci.org/browse/JENKINS-22837

  5. Hi,

    We have a pretty big matrix for multi-config build and when I run build with this plugin it reports an error (see below). Is this a problem of  particular plugin or is this a general Jenkins error? Is it possible to fix?

    A problem occurred while processing the request. Please check our bug tracker to see if a similar problem has already been reported. If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. If you think this is a new issue, please file a new issue. When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. The users list might be also useful in understanding what has happened.

    Stack tracejavax.servlet.ServletException: java.lang.IllegalStateException: Form too large 248123>200000

    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:778)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
    at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:248)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:225)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:370)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
    Caused by: java.lang.IllegalStateException: Form too large 248123>200000
    at org.eclipse.jetty.server.Request.extractParameters(Request.java:352)
    at org.eclipse.jetty.server.Request.getParameter(Request.java:790)
    at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:184)
    at hudson.model.AbstractProject.doBuild(AbstractProject.java:1866)
    at sun.reflect.GeneratedMethodAccessor1136.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
    at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:120)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
    ... 63 more

  6. Hi,

    This is an awful lot easier to use than the Matrix Combination Filter, but is there a way of setting it up so that it isn't a parameter?  I am using Jenkins as a continuous build system so it automatically builds 17 projects on two platforms, in two modes and three configurations (totalling 102 possible combinations) whenever somebody checks something into source control.  Not all of those combinations are valid (only 55 are in fact), and the equation I have to specify to the Combination Filter is becoming quite unwieldy.

    The GUI looks like a much better way of setting this up, but I want to set it up statically in the project configuration rather than as a parameter on a manually triggered build.

    Kind regards,

    Charles