Skip to content

Add coquality comparison for merge request

Max Orefice requested to merge mo-add-coquality-merge-request into master

Ref: #271077 (closed)

This feature is exposed behind a feature flag called codequality_mr_diff introduced in this MR.

What does this MR do?

This MR exposes a new endpoint at the MergeRequest level containing the codequality diff between the base and the head pipeline.

It includes the following items:

  • Introduce CompareCodequalityReportsService to generate a diff report
  • Expose codequality_reports endpoint at the merge_request level

This is Step #3, to move our codequality report comparison on the backend.

Why are we doing this?

Step #3 to introduce Codequality Report comparison on diff/MR.

The grouptesting is currently moving the ability to generate diff report between the base and head pipeline of a codequality report to the backend.

Right now we are generating an inline diff on the frontend. We are planning to build up more features with codequality and one of those would be to display codequality diff on the MR itself. This will be similar to our current test coverage feature.

This implementation is similar to other reports comparison we have today:

Screenshots

image

Context

This MR represents a vertical slice of functionality for moving our codequality comparison feature on the backend . This is slice 3/3.

This work will occur in 3 slices:

  1. Move codequality processing on the backend - !47933 (merged)
  2. Introduce comparison logic - !48385 (merged)
  3. Surface diff report at the merge request level - !48830 (merged)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Max Orefice

Merge request reports