New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added SonarQube parsers #67
Conversation
Codecov Report
@@ Coverage Diff @@
## master #67 +/- ##
============================================
- Coverage 87.74% 87.58% -0.16%
- Complexity 1057 1083 +26
============================================
Files 140 143 +3
Lines 3451 3529 +78
Branches 359 374 +15
============================================
+ Hits 3028 3091 +63
- Misses 293 298 +5
- Partials 130 140 +10
Continue to review full report at Codecov.
|
Didn't had time to check out how to put the default pattern and icon, could you maybe please take care of that? :'D Maybe put these icons from the SQ scanner plugin? |
Thanks, I will add the pattern and icons by myself... |
To answer your questions:
Shouldn't the block
be considered as well? (At least in cases where lineNumber is not given...). An issue has the properties lineStart and end as well as columnStart and end. |
Very kind of you to check that and answer, thanks! If there's no need for the parsers to have the same behaviour in the two plugins, this can be implemented in this one by adding SonarQubeParser.parseEnd() (like "parseStart()"), and then overriding parseStart() and parseEnd() on SonarQubeDiffParser and SonarQubeIssuesParser. This way we'd be solving both issues.
I understand that this is not really your task, so please let me know if you need my support :) |
I added the parser partially in the warnings plug-in now, see jenkinsci/warnings-plugin@d5fa787. One thing that is not clear to me yet: how does a user decide which parser should be used? (Diff or Issues). Or should both parsers run on the same file and automatically only one of them reports issues? Or does a user really need to select one of the parsers? The new warnings plugin supports both styles: we can have a composite parser that runs all parsers of one ID one after the other and aggregates the issues using one id. Or you can have two separate parsers that produce different results. What is the best way for your parsers? |
I also merged you changes, otherwise I can't reference them in the other plug-in. The change you made for the old warnings plugin is kind of obsolete, the new 3.0 branch will hopefully released in august. So it makes sense to use all of the properties of the new API. So if you find some more time a subsequent PR would be nice ;-) |
Cool, thank you! :) To answer your question:
In our use case we use each parser depending on the branch and analysis performed:
Hopefully I can make the aforementioned changes and PR when I have time, nice to know the release date :) keep up the good work! Will there be any release of the old warnings plugin containing the last parsers? |
I added two issues, so we won't forget the open tasks: |
I understand, but is it possible to detect which parser to use for which file? Then the user can just select "SonarQube". Otherwise the user needs to decide, which format to use... |
I can make one if you can't wait for the new release... |
It should be possible, by checking the most characteristic attributes of each report type. It feels kinda dirty to me though, it doesn't seem a 100% unmistakable thing because sometimes attributes are missing depending on the issue (like the line). When I have some time I'll look into this, if that's OK with you :'D |
We only need the SQ parsers and we can build it locally for that, so I think there's no need to hurry for a new release. We'll survive ;) |
Added two parsers for SonarQube as in the Warnings plugin:
Some things that didn't go as expected and which made that the tests had to be changed:
Thanks for your attention :)