c8a115c0e3
Any mention of Issues, MergeRequests, or Commits via GitLab-flavored markdown references in descriptions, titles, or attached Notes creates a back-reference Note that links to the original referencer. Furthermore, pushing commits with commit messages that match a (configurable) regexp to a project's default branch will close any issues mentioned by GFM in the matched closing phrase. If accepting a merge request would close any Issues in this way, a banner is appended to the merge request's main panel to indicate this.
17 lines
492 B
Ruby
17 lines
492 B
Ruby
class NoteObserver < BaseObserver
|
|
def after_create(note)
|
|
notification.new_note(note)
|
|
|
|
unless note.system?
|
|
# Create a cross-reference note if this Note contains GFM that names an
|
|
# issue, merge request, or commit.
|
|
note.references.each do |mentioned|
|
|
Note.create_cross_reference_note(mentioned, note.noteable, note.author, note.project)
|
|
end
|
|
end
|
|
end
|
|
|
|
def after_update(note)
|
|
note.notice_added_references(note.project, current_user)
|
|
end
|
|
end
|