Skip to content

WIP: Fix imported from GitHub empty discussion threads on MRs

What does this MR do?

This MR fixes diff notes on Imported from GitHub merge requests. Currently diff notes are shown on diff page, however they are not shown on Overview Tab. This is due to the fact that discussion.diff_file.diff_refs is nil, which frontend relies on.

Please note that:

  1. Github Importer uses LegacyDiffNote instead of DiffNote
  2. Each diff note is inserted using bulk_insert https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/github_import/importer/diff_note_importer.rb#L50-50 and skips all rails validations and callbacks for performance reasons

I am not 100% sure of the solution yet, as I am not sure if there are going to be any side effects by initializing Diff File with diff_refs: noteable.diff_refs due to my lack of domain knowledge on Diffs and DiffNotes. I watched diff notes deep dive video and spent 3 days investigating but it's still not clear to me.

Screenshots

Before (old screenshot from #26952 (closed)) -- discussion is not expandable image

After image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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 🤖 GitLab Bot 🤖

Merge request reports