Pending review notes move around when changes are pushed afterward

Summary

When you leave a pending code review there for a long time, and the MR author pushes code, the note will no longer be at the correct line.

Steps to reproduce

  1. Create a new MR with a number of lines added
  2. Create a pending review note at some of those lines (do not submit review)
  3. Push a new commit that adds more lines above the line you've created the pending note on

What is the current bug behavior?

The pending not with be at line number you've created it. But there is different code at that line now.

What is the expected correct behavior?

The pending note should move along, or be a proper diff_note so the (outdated) diff is placed in right above the comment.

Output of checks

This bug happens on GitLab.com.

Assignee Loading
Time tracking Loading