Combine multiple milestone change events into one system note
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
- After https://gitlab.com/gitlab-org/gitlab-ce/issues/46479 is implemented, we have all the atomic events of milestone changes in GitLab. This allows us to intelligently display milestone changes to the user (in issues and merge requests).
- We can consider a variety of algorithms to combine. But let's consider these user-facing and design requirements:
- We don't want to store the combined events (i.e. the system note) explicitly in the database. (We can cache them.) But storing them means over-specifying data and it's not a good idea.
- Anybody opening up the same issue or merge request at any time should see the same set of system notes. The system notes should not be different for different people or at different times, since this could be confusing, and also you wouldn't be able to link directly to a specific system note.
- The system notes that appear in the issue/merge request should correspond to what is sent in a notification, i.e. https://gitlab.com/gitlab-org/gitlab-ce/issues/46484. I.e. if you combine events {A, B, C} into one system note, that one system note should also correspond to that one email notification.
Proposal
- Combine events that fall in well-defined time boxes per system time.
- Set the time box to be 10 minutes, and starting on the hour. So in every hour, there are well defined 6 time boxes.
- If multiple milestone change events happen within a given time box, just combine them into one system note.
- So in particular, if an event happens at 11:59 and another event happens at 12:01, there are considered in different time boxes, even though there are only 2 minutes apart.
- The combined system note should look at the state at the beginning of the time box and the final state, and the system note should reflect that, (if you even have a system note). So the different scenarios are below:
| The state at beginning of time box | The state after the end of the time box (or the current time) | Combined system note and email notification |
|---|---|---|
| No milestone | No milestone | No system note is shown and no email notification is sent, even though many changes may have happened during the time period. |
| No milestone | Milestone X | changed to milestone X |
| Milestone X | No milestone | removed milestone |
| Milestone X | Milestone X | No system note is shown and no email notification is sent, even though many changes may have happened during the time period. |
| Milestone X | Milestone Y | changed to milestone Y |
There is one edge case to be careful about:
- For sending email notifications, we should wait until the full 10 minutes have elapsed to send them.
- But when you have issue/mr open and you are changing milestones (or others are making changes), you want real-time feedback. So the system note on the page needs to be smart enough to account for that. In particular:
- Suppose the time is 12:07. Then it the calculations, the last time box to consider is 12:00 to 12:07. And it needs to calculate everything for that 7 minute time box. The moment the time hits 12:08, it needs to re-calculate and do it for that 8 minute time box, and so forth, until 12:00. That means, the existing system note on the page might need to be updated in real time on the page.
- If this edge case is too difficult / adds too much complexity, then we don't need to worry about it. Or perhaps for real-time generated events, we don't consider the 10 minute window.
- Whatever we do, we want to make sure we still provide instant, real-time feedback system note wise, since that is what we support currently.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.
Edited by 🤖 GitLab Bot 🤖