Violation Comments to GitLab2.0Minimum Jenkins requirement: 2.1ID: violation-comments-to-gitlab
You can have a look at violations-test to see what the result may look like.
There is also plugins for:
It supports same formats as Violations Lib:
- RubyCop with `rubycop -f clang file.rb`
- GoVet Same format as GoLint.
- NullAway Same format as Google Error Prone.
- Lint A common XML format, used by different linters.
- PCLint PC-Lint using the same output format as the Jenkins warnings plugin, details here
Some formats may vary. Examples of the exact supported formats can be found here.
Missing a format? Open an issue here!
Notify Jenkins from GitLab
Or, trigger with GitLab plugin.
Or, trigger with GitLab Merge Request Builder Plugin.
You must perform the merge before build. If you don't perform the merge, the reported violations will refer to other lines then those in the pull request. The merge can be done with a shell script like this.
When installed, a post build action will be available.
The pull request will be commented like this.
Here is an example that will use Generic Webhook Trigger plugin and comment GitLab merge requests. It also uses HTTP Request Plugin to comment the merge request with a link to the job. And also Conditional BuildStep Plugin to have different comments depending on build status.
Here is an example pipeline that will merge, run unit tests, run static code analysis and finally report back to GitLab. It requires the GitLab Plugin.
And the merge_request_pipeline.pipeline contains