Show code quality badge on files in MR diff view
What does this MR do?
For #267612 (closed)
Show a badge in the file header of each file in the MR diff/changes tab that has code quality changes, i.e. if the MR affects the code quality of a given file, show a badge next to its filename in the diff view
Technically, this MR:
- adds
inline_codequality
as a licensed feature for GitLab Ultimate - is behind the
codequality_mr_diff
feature flag - outputs the code quality diff endpoint in haml to be consumed by the diffs vue app only if both the feature flag and the licensed feature are enabled/available
- modifies the diffs vue app to fetch data from this endpoint if it is provided and display badges on changed files:
- uses the same polling procedure as inline code coverage
- stores the result in the diffs store as
codequalityDiff
- passes along code quality diff data for each file to
diff_file.vue
ascodequalityDiff
prop (defaults to []) - if a
diff_file
hascodequalityDiff.length > 0
, passes alonghasCodequalityChanges
prop todiff_file_header.vue
- if a
diff_file_header
hasCodequalityChanges
, display the code quality badge component
- add the code quality badge component
- in
ee/
because this will be a GitLab Ultimate feature - asynchronously import the EE child component
- in
Screenshots (strongly suggested)
Screen_Recording_2021-03-15_at_15.32.08
link-to-widget functionality has been split off from this MR and will be implemented in !57791 (merged)
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 change is behind a feature flag.
-
-
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 Miranda Fluharty