Skip to content

Fix code quality report comparer

Max Orefice requested to merge mo-fix-codequality-comparer into master

Ref: #322780 (closed)

What does this MR do?

This MR refactors our CodequalityReportsComparer.

As brought up by @mfluharty :

Will base_report ever be nil here if we initialize it as CodequalityReports.new when it's nil at codequality_reports_comparer.rb:8?

We forgot to remove this behaviour in our previous MR which makes it impossible to return a not_found status to the frontend.

Why are we doing this?

After enabling our new comparison logic on the backend we realized that in some cases we don't have a base report from which to compare with our head pipeline.

This MR marks our new status response as not_found so we can inform the frontend that no base report has been found.

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

Merge request reports