[go: up one dir, main page]

LegacyDiffNotes have st_diff incorrectly on GitLab import

During GitLab to GitLab Import(file based)

  • The LegacyDiffNote is a relation that comes from the merge_requests.ndjson file which means it invokes this save action, which causes it to hit the before_create callback, which overwrites the st_diff value from the merge_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 through GitLab file based import since the merge_requests.ndjson file will have st_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

Related to #343345.

Edited by Doug Stull