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

Add support for extracting data from xml-files

    XMLWordPrintable

    Details

    • Type: Patch
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: plot-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      Currently the plot-plugin only supports extracting data from java properties
      files. It is often useful to extract from XML-files (for example to generate a
      coverage-graph from NCover).

      The patch below allows you to specify an XML-file and an XPath-expression, which
      is then used to extract the data-value.

        Attachments

          Activity

          Hide
          areese78 areese78 added a comment -

          I had the same idea and put an optional field in the properties file as well,
          and now that I think about it, the way you have suggested is much cleaner. When
          I added the help for the csv file, it made the help very long winded and confusing.

          You can see my changes here,
          https://hudson.dev.java.net/issues/show_bug.cgi?id=2899.

          I did some refactoring inside to support csv, which ended up in iterating over a
          set of plot points, this may be useful for reading XML as well.

          Look at PlotPoint.java and PlotPointFactory.java in my patch, I think that we
          can use this as a way to abstract out where the plot data comes from, and with a
          little work, we can setup some abstraction to use the value set in the UI to
          create a PlotPointFactory that will generate PlotPoints. It looks like you had
          some of the same issues I had with extra data.

          One of my needs, which it seems you may have it is to have multiple points from
          the same file.

          If you want to rework your patch with the suggestions below I'll rework mine and
          get Nigel to apply them.

          Unit tests would be great, I was looking for some when I made my changes, but
          didn't find an easy way to add them.

          Show
          areese78 areese78 added a comment - I had the same idea and put an optional field in the properties file as well, and now that I think about it, the way you have suggested is much cleaner. When I added the help for the csv file, it made the help very long winded and confusing. You can see my changes here, https://hudson.dev.java.net/issues/show_bug.cgi?id=2899 . I did some refactoring inside to support csv, which ended up in iterating over a set of plot points, this may be useful for reading XML as well. Look at PlotPoint.java and PlotPointFactory.java in my patch, I think that we can use this as a way to abstract out where the plot data comes from, and with a little work, we can setup some abstraction to use the value set in the UI to create a PlotPointFactory that will generate PlotPoints. It looks like you had some of the same issues I had with extra data. One of my needs, which it seems you may have it is to have multiple points from the same file. If you want to rework your patch with the suggestions below I'll rework mine and get Nigel to apply them. Unit tests would be great, I was looking for some when I made my changes, but didn't find an easy way to add them.
          Hide
          areese78 areese78 added a comment -

          Adding myself to the cc list.

          Show
          areese78 areese78 added a comment - Adding myself to the cc list.
          Hide
          seanf Sean Flanigan added a comment -

          Since I'm forced to comment if I want to be on the cc... I have been working on
          a simple patch for the existing property file support, to pick up all wildcard
          matches: https://hudson.dev.java.net/issues/show_bug.cgi?id=3984

          Show
          seanf Sean Flanigan added a comment - Since I'm forced to comment if I want to be on the cc... I have been working on a simple patch for the existing property file support, to pick up all wildcard matches: https://hudson.dev.java.net/issues/show_bug.cgi?id=3984
          Hide
          areese78 areese78 added a comment -

          I have fixed this, please re-open if you want to change the method of picking
          values from the xml.

          Show
          areese78 areese78 added a comment - I have fixed this, please re-open if you want to change the method of picking values from the xml.
          Hide
          espvlad Vlad Degtyar added a comment -

          Please, provide me with some .xml file where i can see how to create such .xml files with data for 2-3 plots in it.

          Show
          espvlad Vlad Degtyar added a comment - Please, provide me with some .xml file where i can see how to create such .xml files with data for 2-3 plots in it.

            People

            • Assignee:
              rfaber rfaber
              Reporter:
              rfaber rfaber
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: