Fix for: check for highlighted_diff_lines iterates over parallel_diff_lines; parallel left/right duplicates property
What does this MR do?
I've uncovered a couple of bugs in my work on !19930 (merged).
Neither of these were exposed previously because the whole diff (both Parallel and Inline) was loaded, so in both cases the other cases were scraping by.
- In one change, there was a duplicated key
.linethat causes a throw. It should beline.left.xxxbut it isline.line.left.xxx, which doesn't exist. - In the other change, a test for
highlighted_diff_linescauses the code to enter a block only ifparallel_diff_linesdoesn't exist, but then attempts to iterate overparallel_diff_linesanyway.
For that last item, it's unlikely this block of code was ever entered, because the diffs (should) always include both parallel_ and highlighted_ lines. As part of my work on !19930 (merged), this block is actually exercised since the diffs are often only one or the other.
Screenshots
No screenshots, this is ~backstage work.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
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
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
Edited by Thomas Randolph