Skip to content

WIP: Project events via EventCreateService to set target_type

Michael Trainor requested to merge tmike-408356-project-event-target-type into master

What does this MR do and why?

Closes #408356

Project-related methods in EventCreateService uses create_event method, which did not set the appropriate target_type for these events. As the target_type is nil for these events, they can't be searched via API using the target_type parameter.

Events for other models such as MergeRequest, Issue, Milestone, and Note were changed previously to use create_record_event: 07d05d2d

This MR changes the method used to create_record_event for project-related events, which is a wrapper for create_event, and sets target_type as the subject class.

Push events for projects has not been changed, as PushEvent model has validation for validates :target_type, absence: true.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Michael Trainor

Merge request reports