-
Notifications
You must be signed in to change notification settings - Fork 37
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
support JUnit XML output format #928
Comments
Hi there, @sebhoss! JUnit XML doesn't strike me as the optimal output format for a linter, but if it helps integrating Regal in GitLab, we can probably be pragmatic about it. Do you know of any other linters that do this? Or even better, links (or I guess, screenshots) to merge requests where this can be seen in action? It's been a while, but I remember how we've looked into various integration options for GitLab in the past, and none of them felt great compared to the ease of which this could be done for GitHub. I'm not sure we looked at using JUnit output though. If we can include links to the Regal docs in the output, that'd be one pretty nice advantage compared to the GitHub integration. |
We have some code in OPA contrib to turn OPA's JSON output from tests into JUnit XML here. I guess we could do something similar here just in order to test it out first. |
Yeah I agree that the JUnit format is not ideal for linters, but it is kinda flexible and well supported across various tools/platforms. I recently helped getting a similar feature request merged for kube-score in zegl/kube-score#603 and used https://github.com/jstemmer/go-junit-report for that. conftest does support JUnit output as well. The integration in GitLab is described here. I think you should be able to include links to the Regal docs in the optional message for each failure just fine. |
Thanks! I still have a week of vacation before I’m back in full capacity but I can take a look at this once I’m back. And of course, if you’d want to work on this yourself, then by all means go ahead! The reporters are quite straightforward to work with, so no deep knowledge of Regal required. I’d be happy to answer any questions along the way. |
Ok created #929 for that - happy to incorporate any feedback you have! |
Awesome! I'll have a look right away. |
Thanks! I'm about to call it a day so replies from my side might be late but I'll check again tomorrow ^^ |
I've just reviewed, but no stress! We just pushed a release last week, so there's plenty of time until the next one :) |
It would be nice to allow outputting linting results as JUnit XML because that can be parsed directly by GitLab and shown in merge requests.
The text was updated successfully, but these errors were encountered: