BartyCrouch icon indicating copy to clipboard operation
BartyCrouch copied to clipboard

Add integration with Jenkins CI

Open nysander opened this issue 5 years ago • 5 comments

Jenkins plugin Warnings NG can read checkstyle reports about found issues. Is it possible to add such reporting format for BartyCrouch to get reports integrated in Jenkins CI build results?

this format is used for example in Swiftlint project

nysander avatar Apr 02 '19 11:04 nysander

@nysander Thanks for this suggestion!

Could you please link to a documentation and an example of what the output should look like?

We could solve this by simply adding a new case named something like jenkins (or the format name) to the OutputFormatTarget enum here. Then, by adding a new option here similar to the already existing --xcode-output there could be something like --jenkins-output that you would be using when you need it on the CI.

Having outlined the way of how this could be tackled, feel free to post a PR with the changes needed to get this running. Otherwise you might need to wait a little longer until I have time to look into this.

Jeehut avatar Apr 03 '19 09:04 Jeehut

I do have almost any knowledge about this 😉 but I have found that swiftlint uses checkstyle report format which is parsable via this plugin without much problems. I have yesterday rewrited this reporter and added for IBLinter project and made PR to test it on live jenkins if merged as I have no knowledge how to force jenkins use it without cocoapods.

nysander avatar Apr 03 '19 09:04 nysander

IBLinter and SwiftLint uses --reporter ... format for different exports. format name should be checkstyle as this is XML format to which we must conform here - this format is not Jenkins' only format. Here you have example XML from IBLinter exported error:

updated file: test.xml.zip

reporter from IBLinter rewritten from SwiftLint one by myself: https://github.com/nysander/IBLinter/blob/checkstyle/Sources/IBLinterKit/Reporters/CheckstyleReporter.swift - not merged back to original project yet reporter from SwiftLint: https://github.com/realm/SwiftLint/blob/master/Source/SwiftLintFramework/Reporters/CheckstyleReporter.swift

nysander avatar Apr 03 '19 10:04 nysander

@nysander Sorry for getting back to you so late. I think a different output format can be implemented quite easily, just add a new option like we already have the -x option for Xcode compatible output, then add a case in this enum and implement the output file parser. I'd love to review and merge a PR adding this feature. :)

Jeehut avatar Apr 16 '20 07:04 Jeehut

thanks for feedback :) I will look at it but cannot tell you the timeframe now unfortunately

nysander avatar Apr 16 '20 20:04 nysander