Skip to content

Resolve "Comments not being added on Ipynb Diffs"

What does this MR do and why?

When we create semantic notebook diffs, we need to map the lines of the transformed diff to lines on the original diff, so that comments can be assigned to the correct place. If lines can't be mapped, they shouldn't be able to receive comments. The mapping of lines that have mapping was working fine, but we were having problems with lines that didn't have proper mapping:

Screenshot_2022-06-14_at_14.20.25

This also adds further testing and documentation to Notebook::DiffFileHelper, removing all dependencies from the rest of the codebase.

Screenshots or screen recordings

Before After
Screenshot_2022-06-14_at_14.20.25 image

How to set up and validate locally

  1. Navigate to gitlab gitlab-test@5d6ed150 on your local gdk
  2. Verify that lines that appear on the raw diff have mapping
  3. Verify the lines that don't have mapping are blank and don't allow comments.
  4. For example, the first line has the description of the cell, but the line that starts that cell was cut off from the raw cell

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #364533 (closed)

Edited by Eduardo Bonet

Merge request reports