Skip to content
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

Allow to produce a text/xml/json/... report of the failures for better CI integration #134

Open
centic9 opened this issue Nov 21, 2017 · 7 comments

Comments

@centic9
Copy link
Contributor

centic9 commented Nov 21, 2017

We have a large Gradle based build which uses "--parallel" heavily to speed up compilation of commits.

Because of this, the output of the forbidden-api plugin is often hidden in some other build-output which makes it hard to find the actual fail reasons buried in many unrelated lines from multiple different projects that were built in parallel.

For this it would be very useful to have an option so that the results are also written to some result-file. This file could then be post-processed by CI servers and visualized on the landing page of the broken build, similar to junit-test-failures and other fail-reasons.

If the main bits of information can be extracted by downstream systems easily, it would make it much easier to integrate forbidden-api-checks in large CI setups.

@uschindler
Copy link
Member

I think it should be easy to optionally allow to write the reports to a separate file. The main thing to discuss: Type of output - structured file?

Other question: How do you handle compilation errors /javadoc errors? They have same problem!

@centic9
Copy link
Contributor Author

centic9 commented Nov 21, 2017

ad format: yes, some structure that can be post-processed, txt, xml or json would be fine

ad compile errors: Yes, similar problem, some CI systems at least apply different formatting/red font in the console output. And at least for us, devs are much less prone to send it off to CI when it does not even compile, but forbidden-api is sometimes turned off locally in order to speed up local builds.

For Javadoc there are some Jenkins/CI plugins, e.g. the "JavaDoc Warnings" entry at https://builds.apache.org/view/P/view/POI/job/POI-DSL-1.8/297/

@uschindler
Copy link
Member

uschindler commented Nov 21, 2017

I'd keep the logging output as is, but just create a file (like the JUnit report files).

Do you know a good format to use? How do other tools report their errors? It would be good to have a "standard format".

@centic9
Copy link
Contributor Author

centic9 commented Nov 23, 2017

Yes, sure, still having the log-output is expected.

As format, I don't think there is a standard, the findbugs results are likely quite similar in what info the results contain, maybe we can follow that one so you can use the existing CI tooling for findbugs? It's XML as far as I know.

@uschindler
Copy link
Member

This one?: https://gleclaire.github.io/findbugs-maven-plugin/examples/findbugs.xml

Looks easily produceable... Needs some refactoring of log writer but not complicated. Once I have a architecture for the failures, it should be easy to add more custom formats.

In the maven plugin you could generate it as report output, for gradle i have no idea where reports are generated. I will dive into it.

@uschindler
Copy link
Member

Here is an example/comparison of the files generated by PMD/Checkstyle/Findbugs: Blog by SOFTWARE ENGINEERING CANDIES

@burberius
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants