Fix incorrect naming in code related to cross-references
The following discussion from !72794 (merged) should be addressed:
-
@alexkalderimis started a discussion: (+1 comment) I notice that the signature for this method is defined as:
def create_cross_reference_note(mentioned, noteable, author) # implement inside child end
the mismatch between
noteable
andmentionable
is a bit confusing. Is it intentional?Looking through the code path again, it seems we always have one
Mentionable
(thementioner
) mentioning anotherMentionable
(thementioned
), and noteables aren't really directly involved (they just tend to be mentionables too😅 ):- The entry point is
Mentionable#create_cross_references!
, which gathers the referenced mentionables at https://gitlab.com/gitlab-org/gitlab/blob/106972a833c7dc5559f09d4632dc6c1f79740572/app/models/concerns/mentionable.rb#L182 (only issues/MRs/commits at the moment) - The switch from
ref
(the mentionable) tonoteable
happens atSystemNoteService.cross_reference
- The entry point is