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

Warnings Plugin wants "Error" but Violations Lib wants "error" from JCReport

      Both the Warnings Plug-in, and Violations Lib used by Violation Comments to Bitbucket Server Plugin, are able to parse JCReport files, but they disagree on how the severity levels should be formatted.

      I was writing a script to convert a DocFX log from JSON to something that both plugins would be able to parse, and I chose the JCReport format because it is simple enough, supports newlines within messages, supports multiple severity levels, and does not require programming-specific information like class names. This mismatch however means that the script now needs to generate a separate JCReport file for each plugin. I don't know whether JCReport itself would capitalize the severity levels.

      I'm filing this under the warnings-plugin and violation-comments-to-github-plugin components because there is no violation-comments-to-stash-plugin component and both of those violation-comments-* plugins use violations-lib.

          [JENKINS-48669] Warnings Plugin wants "Error" but Violations Lib wants "error" from JCReport

          Tomas Bjerre added a comment - - edited

          Can you supply a sample DocFX report file? I can add it to the lib.

           

          Edit: I'm changing the lib to ignore casing when checking for equality. But still, I'd like to see an example of DocFX, it it is easy to parse I'd like to add it to the lib.

          Tomas Bjerre added a comment - - edited Can you supply a sample DocFX report file? I can add it to the lib.   Edit: I'm changing the lib to ignore casing when checking for equality. But still, I'd like to see an example of DocFX, it it is easy to parse I'd like to add it to the lib.

          tomasbjerre, I filed the sample DocFX report in JENKINS-48670.

          Kalle Niemitalo added a comment - tomasbjerre , I filed the sample DocFX report in JENKINS-48670 .

          Tomas Bjerre added a comment -

          I've changed it to ignore casing when checking for equality.

          I've added a DocFX parser.

          Tomas Bjerre added a comment - I've changed it to ignore casing when checking for equality. I've added a DocFX parser.

          I had filed this issue for both components because I didn't know which one was correct, and I still don't. After your violations-lib changes, both parsers will accept the capitalized forms "Error" and "Warning"; but is there evidence on whether JCReport outputs those?

          https://github.com/jCoderZ/fawkez-code-report/blob/5624ac77dcd11067f27b001bcb1ee3f1c06076e2/fawkez-code-report-core-base/src/main/java/org/jcoderz/phoenix/report/Severity.java and https://github.com/jCoderZ/fawkez-code-report/blob/5624ac77dcd11067f27b001bcb1ee3f1c06076e2/fawkez-code-report-core/src/main/resources/xjc/report-types.xsd show the strings in lower case, so I suspect the Warnings plugin of Jenkins should still be changed.

          Kalle Niemitalo added a comment - I had filed this issue for both components because I didn't know which one was correct, and I still don't. After your violations-lib changes, both parsers will accept the capitalized forms "Error" and "Warning"; but is there evidence on whether JCReport outputs those? https://github.com/jCoderZ/fawkez-code-report/blob/5624ac77dcd11067f27b001bcb1ee3f1c06076e2/fawkez-code-report-core-base/src/main/java/org/jcoderz/phoenix/report/Severity.java and https://github.com/jCoderZ/fawkez-code-report/blob/5624ac77dcd11067f27b001bcb1ee3f1c06076e2/fawkez-code-report-core/src/main/resources/xjc/report-types.xsd show the strings in lower case, so I suspect the Warnings plugin of Jenkins should still be changed.

          Tomas Bjerre added a comment -

          Is it ok to remove the "violation-comments-to-github-plugin" component?

          Tomas Bjerre added a comment - Is it ok to remove the "violation-comments-to-github-plugin" component?

          Kalle Niemitalo added a comment - - edited

          tomasbjerre, because you already changed violations-lib, I think I should instead file a separate issue for warnings-plugin so that this one can be left resolved.

          Filed as JENKINS-48720.

          Kalle Niemitalo added a comment - - edited tomasbjerre , because you already changed violations-lib, I think I should instead file a separate issue for warnings-plugin so that this one can be left resolved. Filed as JENKINS-48720 .

            tomasbjerre Tomas Bjerre
            kon Kalle Niemitalo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: