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:
- Github Importer uses
LegacyDiffNote
instead ofDiffNote
- 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
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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