Prepare for tracking label add/remove events for issues/mrs/epics

Background

https://youtu.be/yRzIxEJgrq4

Description

  • Prepare backend to track label changes explicitly in the system, as events

  • Don't enable events creation yet, this will be enabled as part of #48483 (closed)) and switching system notes to events will be easier (see https://gitlab.com/gitlab-org/gitlab-ce/issues/47993#note_90719804)

  • Applies to project labels and group labels.

  • Applies to issues and merge requests and epics.

  • In each event, track the following:

    • Who made the change.
    • The label (a project label or a group label).
    • The associated object, i.e. the issue, mr, or the epic.
    • The timestamp.
  • This is for any new events.

  • Previous changes will not be considered. (I.e. we don't need to try to reconstruct previous changes and migrate them to the db.)

Use cases this should support

Edited by Jan Provaznik