GitLab Integration#
Lattix can be integrated with GitLab in the following ways:
Running Lattix analysis in a GitLab CI pipeline#
The Lattix analysis of a codebase can be performed as a step in a GitLab pipeline by using the LDC command line interface to Lattix. The ‘ldcupdate’ command is used to perform the analysis.
A common workflow when using Lattix in a GitLab pipeline is pushing a new snapshot to LattixWeb. In this scenario, the ‘ldcget’ command is used to download the latest snapshot from the LattixWeb repository. The downloaded snapshot is then passed to ‘ldcupdate’ and then uploaded to the LattixWeb server using the ‘ldcpublish’ command.
Exposing Lattix violations in a GitLab code quality feature#
Lattix rule violations can be exposed along with static analysis violations from other tools in the GitLab CI code quality features.
Once the ‘ldcupdate’ has been run in the pipeline, ‘ldcreport’ can be run generating the ‘violations_with_lines’ report in csv format. This will output a csv file containing the filenames and line numbers where Lattix rule violations are present. This data can be transformed with scripting to generate a file in the correct format for GitLab.
Annotating GitLab merge requests with the Lattix DSM, heatmap, and impact report#
Images of the Lattix DSM, heatmap, and the impact report can be embedded into the open merge request for a pipeline as a step in the pipeline execution. This can be achieved by running ‘ldcreport’ to generate the images and saving these as job artifacts.