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

Build status page displays incorrect run combinaison for matrix build with dynamic axis

      On the build status page of a matrix build configured with one or more dynamic axis, run combinaison are not shown properly (but on-disk saved data is correct). The page is not using dynamic axis values coming from the build but cached values from the latest build.

      For example, if all the values of a dynamic axis change between 2 builds, the build status page of the first build will show all run combinaison as "Not Run" because no combinaison with latest value of dynamic axis ever run.

      Problem comes from MatrixBuild.axes field which is a reference of MatrixProject.axes. For manually configured axis, it isn't a problem. When the user updates axis values in job configuration page, MatrixProject.axes field is replaced with a newly instanciated AxisList object holding new Axis objects. As DynamicAxis might hold different values for each build, MatrixBuild.axes should hold a dedicated instance for each build.

      When Jenkins restarts and configuration is loaded from disk, each build gets its own DynamicAxis instance with the right values.

      The only fix I can see is to deep clone MatrixBuild.axes in MatrixBuild.doRun(), but there's no way to do that easily.

      I tried to change the copy of MatrixProject.axes in MatrixBuild.doRun() here with

      axes = (AxisList) Jenkins.XSTREAM.fromXML(Jenkins.XSTREAM.toXML(p.getAxes()));
      

      It works, but it's clearly not acceptable.

      Any thought?

          [JENKINS-30437] Build status page displays incorrect run combinaison for matrix build with dynamic axis

          Yoann Dubreuil created issue -
          Yoann Dubreuil made changes -
          Attachment New: jobs.zip [ 30667 ]
          James Brown made changes -
          Assignee Original: Yoann Dubreuil [ ydubreuil ]
          James Brown made changes -
          Assignee New: Yoann Dubreuil [ ydubreuil ]
          James Nord made changes -
          Comment [ how is this different from a normal matrix build where you just delete one values from one of the axes? ]
          Arnaud Héritier made changes -
          Assignee Original: Yoann Dubreuil [ ydubreuil ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 165543 ] New: JNJira + In-Review [ 182017 ]
          CloudBees Inc. made changes -
          Remote Link New: This issue links to "CloudBees Internal OSS-251 (Web Link)" [ 18934 ]

            Unassigned Unassigned
            ydubreuil Yoann Dubreuil
            Votes:
            8 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: