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

JSON Exchange format for import/export?

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      5.2.0

      Description

      Having the Groovy based warnings parser is a great way to support new tools that reports warnings. It might be useful when you write the report (because you write the static analyser or because you plug something into an existing tool).


      Example:

      For example I have create an extension for Asciidoctor, that collects the issues reported and put them into a file like this.

      /tmp/file.adoc|5|ERROR|include file not found: /tmp/other.adoc
      /tmp/file.adoc|7|HIGH|list item index: expected 1, got 8
      UNKNOWN|0|HIGH|skipping reference to missing attribute: bla
      

      Thank to the Groovy based warnings parser, I can use a regex ((.)|(\d+)|(.)|(.*)) to parse the log that I have created.

      Read more about this: https://jmini.github.io/asciidoctorj-file-logger/

      The next step for me would be to contribute the parser to this project, so that it no longer rely on a config in Jenkins.

      But before doing this, I would like to challenge the format that is used...
      I could not find any discussion about this.

      One idea that I have: a collection of JSON structures on each line:

      {"fileName": "/tmp/file.adoc", "lineStart": "5", "severity": "ERROR", "message": "include file not found: /tmp/other.adoc"}
      {"fileName": "/tmp/file.adoc", "lineStart": "7", "severity": "HIGH", "message": "list item index: expected 1, got 8"}
      {"severity": "HIGH", "message": "skipping reference to missing attribute: bla"}
      

      This might be more robust, because the semantic is clearly defined (and not based on a regex config). I think this kind of files are now really common with tools like logstash (using JSON Layout in logger framework).

      In comparison to xml based file, this kind of format works with tools that works with an append-only approach.

      Thank in advance for your feedback.


      Related issue:

        Attachments

          Issue Links

            Activity

            jmini Jeremie Bresson created issue -
            jmini Jeremie Bresson made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-56510 [ JENKINS-56510 ]
            drulli Ulli Hafner made changes -
            Assignee Ulli Hafner [ drulli ]
            Labels help-wanted newbie-friendly
            drulli Ulli Hafner made changes -
            Assignee Ulli Hafner [ drulli ]
            drulli Ulli Hafner made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
            jmini Jeremie Bresson made changes -
            Released As  5.1.0 (analysis-model and warnings-ng)
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]
            jmini Jeremie Bresson made changes -
            Status Resolved [ 5 ] Fixed but Unreleased [ 10203 ]
            jmini Jeremie Bresson made changes -
            Released As  5.1.0 (analysis-model and warnings-ng)
            drulli Ulli Hafner made changes -
            Released As 5.2.0
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]

              People

              Assignee:
              drulli Ulli Hafner
              Reporter:
              jmini Jeremie Bresson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: