Inline codequality [RUN ALL RSPEC] [RUN AS-IF-FOSS]
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
inlicense.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
view | before (or without code quality data) | after (with code quality data) | in each code theme |
---|---|---|---|
inline | Screen_Recording_2021-05-07_at_14.09.29 | ||
side-by-side | Screen_Recording_2021-05-07_at_14.10.25 |
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because this feature is behind the feature flag :codequality_mr_diff
.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by 🤖 GitLab Bot 🤖