System note for label change event
- Enable tracking of label changes (using the model/service prepared in #47993 (closed)) instead of creating a system note
- Re-doing the system notes for labels in GitLab using the events from https://gitlab.com/gitlab-org/gitlab-ce/issues/47993
- Applies to issues, mrs, and epics.
Scenario 1
- The label referenced in the system note exists.
- The system note would be rendered as
@victorwu added ~Discussion label · 1 week ago
. - Use same existing text formatting / wording as existing system notes for removing, for multiple labels, for mix-and-match.
Scenario 2
- The label referenced in the system note was removed after the event itself happened, due to the label being removed.
- The system note would be rendered as
@victorwu added a deleted label · 1 week ago
- Use same existing text formatting / wording as existing system notes for removing, for multiple labels, for mix-and-match.
Scenario 3
- Handle promoted labels.
- A project label is added to an issue. Later on, that label is promoted to a group label, and so the project label itself is deleted.
- When promoting labels, the system notes should change the label they're pointing to. First, they point to a project label, which is deleted upon promotion, and so they then point to the group label. Here's an example:
- Project label “hello” is added to an issue:
@victorwu added [hello] label · 1 week ago
- The project label is promoted to a group label: The system note is unchanged
- The group label changes color: The label color changes in the system note
- The group label changes name to be “helloworld”: The label name changes in the system note to
@victorwu added [helloworld] label · 1 week ago
- The group label is promoted again to a higher group. (A future feature.): The system note is unchanged
- The group label is deleted: the system note now reads
@victorwu added a deleted label · 1 week ago
- Project label “hello” is added to an issue:
Scenario 4
- An issued is moved to a different project. What happens behind the scenes is that the original issue is closed and a new one is opened.
- All the system notes from the original issue are copied to the new issue.
- For the system notes that are copied over, that refer to a still existing label, render it by referencing where the label came from, same as raccoondogs/chicken#3 (comment 83812389). (So no change in existing user-facing functionality.)
- For the system notes that are copied over, that refer to a deleted label, follow Scenario 2.
Scenario 5
- Currently, a system note can contain multiple changes, such as multiple labels added and multiple labels removed.
- This should be supported in this issue, and is related to the design of https://gitlab.com/gitlab-org/gitlab-ce/issues/47993
Edited by Jan Provaznik