LegacyDiffNotes have st_diff incorrectly on GitLab import
During GitLab to GitLab Import(file based)
- The
LegacyDiffNote
is a relation that comes from themerge_requests.ndjson
file which means it invokes this save action, which causes it to hit the before_create callback, which overwrites thest_diff
value from themerge_requests.ndjson
file. - This then causes the st_diff to get set from the raw_diffs that is ultimately pulled from the merge request diff files...
The fact that this doesn't work correctly sometimes(wrong st_diff
is set) is concerning...
More details - https://gitlab.com/gitlab-org/gitlab/-/issues/343345#note_710950301
Plan
However - We can fix this for those times it doesn't and overall
- We could simply try skipping the before_create callback on
LegacyDiffNote
when importing throughGitLab
file based import since themerge_requests.ndjson
file will havest_diff
populated already, and see if that works.- We'll merely check for presence on
st_diff
and put this functionality behind an operational feature flag
- We'll merely check for presence on
Related to #343345.
Edited by Doug Stull