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

          Attached 2 jobs configuration to reproduce

          Yoann Dubreuil added a comment - Attached 2 jobs configuration to reproduce

          Oleg Nenashev added a comment -

          Probably MatrixProject:getAxis() may return a snapshot of the axes list instead of the original object. It's a common practice for all list getters, because otherwise they expose the internal implementation. BTW, this fix is not enough for Dynamic Axis, because we need to recalculate axes on rebuild.

          I think that Matrix Project API and Dynamic Axis should be updated.

          I would propose to...

          • Add new API methods to Axis definitions, which would allow to alter values. E.g. "Axis forRun(MatrixRun)", etc. (such self-factory pattern is weird, but we need something like that to avoid the huge changes scope)
          • In matrixProject:getAxes() accurately build axes lists using the new methods
          • Update Dynamic Axis plugin to implement the new API

          Ideal:

          • Decouple Axis and AxisValue entities
          • Seriously rework the implementation and APIs. BTW we will need the artificial Axis constructors in any case to maintain the backward compatibility

          Oleg Nenashev added a comment - Probably MatrixProject:getAxis() may return a snapshot of the axes list instead of the original object. It's a common practice for all list getters, because otherwise they expose the internal implementation. BTW, this fix is not enough for Dynamic Axis, because we need to recalculate axes on rebuild. I think that Matrix Project API and Dynamic Axis should be updated. I would propose to... Add new API methods to Axis definitions, which would allow to alter values. E.g. "Axis forRun(MatrixRun)", etc. (such self-factory pattern is weird, but we need something like that to avoid the huge changes scope) In matrixProject:getAxes() accurately build axes lists using the new methods Update Dynamic Axis plugin to implement the new API Ideal: Decouple Axis and AxisValue entities Seriously rework the implementation and APIs. BTW we will need the artificial Axis constructors in any case to maintain the backward compatibility

          Is there any updates on this issue?

          Richard Norling added a comment - Is there any updates on this issue?

          Jan Bottek added a comment -

          Hi, we patched the plugin on our local server with the bugfix mentioned above. With the fix we had much less incorrect links, but sometimes the problem still occurs - till now we didn't find a reproducible way to solve it and always get correct links.

          I there any updates, or someone has a idea?

          Jan Bottek added a comment - Hi, we patched the plugin on our local server with the bugfix mentioned above. With the fix we had much less incorrect links, but sometimes the problem still occurs - till now we didn't find a reproducible way to solve it and always get correct links. I there any updates, or someone has a idea?

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

              Created:
              Updated: