Skip to content

Add codequality report comparison logic

Max Orefice requested to merge mo-add-codequality-report-comparison into master

Ref: #271077 (closed)

This feature will be behind a feature flag called codequality_mr_diff

What does this MR do?

This MR creates the necessary logic to compare 2 codequality reports (base/head) and generate a diff between them.

It includes the following items:

  • Introduce CodequalityReportsComparer
  • Add associated entity: CodequalityReportsComparerEntity
  • Add associated entity: CodeQualityDegradationEntity
  • Add serializer: CodequalityReportsComparerSerializer

In Step #3, we will expose our diff report at the merge request level.

Why are we doing this?

Step #2 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 2/3.

This work will occur in 3 slices:

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

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