Skip to content

Inline codequality [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Miranda Fluharty requested to merge 2526-inline-codequality into master

What does this MR do?

For #2526 (closed)

This MR adds icons in the gutter of lines in the MR diff if the change made to the line has introduced a new code quality degradation. Hovering over the icon displays the description of the degradation in a tooltip. The data comes from an endpoint (!52843 (merged), !59421 (merged)) that returns the new code quality issues/degradations introduced by the MR. Since degradations are already sorted by severity (high to low), from the given array of degradations on a line, we choose the first one in the array so that we display the most severe degradation per line.

Testing instructions:

  • This is a GitLab Ultimate feature, defined as inline_codequality in license.rb so you must have the appropriate license loaded to see the feature
  • This feature is behind the feature flag :codequality_mr_diff_annotations - echo "Feature.enable(:codequality_mr_diff_annotations)" | rails c to enable it
  • The default code quality template is designed for docker-in-docker, but I would recommend setting up a specific local runner using these instructions if you want to fully test this in your gdk
Task checklist
  • rebase this once !56710 (merged) is merged (remove the shared commits that enable the POC for now)
  • rebase/update this once !58833 (merged) is merged (which moves the store code into ee/ and changes the structure a bit)
  • peel back some of this code and put it into ee/ files instead
  • figure out if/when we should show these icons in the left panel of the side-by-side view
  • add bits to the code theme scss to make the background of the new space match its surroundings (like inline coverage did)
  • retake screenshots now that the theme scss's have been updated
  • should we display the space when the feature is not available?
  • write tests
  • write a better description
  • rebase now that related MRs are merged

Screenshots

Screen_Shot_2021-05-07_at_14.16.37

view before (or without code quality data) after (with code quality data) in each code theme
inline Screen_Shot_2021-05-07_at_14.04.57 Screen_Shot_2021-05-07_at_14.03.29 Screen_Recording_2021-05-07_at_14.09.29
side-by-side Screen_Shot_2021-05-07_at_14.04.48 Screen_Shot_2021-05-07_at_14.03.55 Screen_Recording_2021-05-07_at_14.10.25

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by 🤖 GitLab Bot 🤖

Merge request reports