Skip to content

Improvements to the code quality badge in the MR diff file header

Miranda Fluharty requested to merge 267612-codequality-badge-improvements into master

What does this MR do?

This MR builds on !56710 (merged) to make improvements to the way we load the code quality data into the MR file diffs app and how we decide whether to show the code quality badge in the header when the MR makes changes to the code quality of a file.

Still need to:

I wonder if its better to access the codequalityDiff state directly in the component seeing as getters that return methods don't cache the result (https://vuex.vuejs.org/guide/getters.html#method-style-access)

  • rewrite ee/spec/frontend/diffs/components/diff_file_spec.js now that diff_file no longer gets passed a codequalityDiff prop (and maybe other specs too)

  • come up with a better error message for the createFlash that is displayed when something goes wrong while loading the code quality diff data

Screenshots (strongly suggested)

There should be no visual changes, but here is the badge we're talking about:

Screen_Shot_2021-03-24_at_12.49.47

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

Related to #267612 (closed)

Edited by Miranda Fluharty

Merge request reports