diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/services/system_notes | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/services/system_notes')
-rw-r--r-- | app/services/system_notes/issuables_service.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/services/system_notes/issuables_service.rb b/app/services/system_notes/issuables_service.rb index 275c64bea89..7d7ee8d829e 100644 --- a/app/services/system_notes/issuables_service.rb +++ b/app/services/system_notes/issuables_service.rb @@ -128,7 +128,7 @@ module SystemNotes body = cross_reference_note_content(gfm_reference) if noteable.is_a?(ExternalIssue) - noteable.project.issues_tracker.create_cross_reference_note(noteable, mentioner, author) + noteable.project.external_issue_tracker.create_cross_reference_note(noteable, mentioner, author) else create_note(NoteSummary.new(noteable, noteable.project, author, body, action: 'cross_reference')) end @@ -225,7 +225,12 @@ module SystemNotes action = status == 'reopened' ? 'opened' : status - create_note(NoteSummary.new(noteable, project, author, body, action: action)) + # A state event which results in a synthetic note will be + # created by EventCreateService if change event tracking + # is enabled. + unless state_change_tracking_enabled? + create_note(NoteSummary.new(noteable, project, author, body, action: action)) + end end # Check if a cross reference to a noteable from a mentioner already exists @@ -318,6 +323,11 @@ module SystemNotes def self.cross_reference?(note_text) note_text =~ /\A#{cross_reference_note_prefix}/i end + + def state_change_tracking_enabled? + noteable.respond_to?(:resource_state_events) && + ::Feature.enabled?(:track_resource_state_change_events, noteable.project) + end end end |