stable

Clone or download

Read-only

feat: no calendar event when timeframe implied

When timeframe is implied from another tracker, then no calendar event is sent. This is necessary because calendar events in notification in this situation may lead to issues. For example in a ALM project, where story tracker is configured to have calendar event (timeframe implied from sprint tracker): * When we add a new story to a sprint (via sprint planning interface): the story is created, then attached to the sprint (two separate REST API calls). There is a high chance that the notification of artifact creation is sent before the link to the sprint: no sprint => no timeframe => event without any dates sent in notification :( * When we drag 'n drop a story to the sprint (from the release backlog, or from another sprint), or from the sprint (to the release backlog, or to another sprint), then it is the sprint that is updated, not the user story artifact. This means that no notification will be sent and calendar of people won't reflect the new dates of the user story. * Likewise, when someone update the dates of the sprint, it is still the sprint that is updated => no notification for the user story. In order to avoid those issues is to prevent usage of timeframe implied from another tracker in calendar events. This contribution starts by ignoring such configuration. Dedicated contributions will come to prevent tracker administrator to end up in such situation. No functional changes when timeframe is based on dates. Technical note: I may regret this later, but I took the shortest path to handle this situation: usage of `instanceof` 🙄 Other options was to A) add yet another method in `IComputeTimeframes` interface (snif OCP), or B) introduce Visitor pattern (maybe a little bit overkill). Usage of `instanceof` is the fastest way, but not really future proof. Will see later if this becomes critical, we could change our mind and go for a more sustainable solution. Part of story #35094: have "calendar" events attached to tracker email notification Change-Id: I618037465af66ab9cfbd233cedef81d25177ca1a

Modified Files

Name
M plugins/tracker/include/Tracker/Artifact/Changeset/PostCreation/CalendarEvent/EventDatesRetriever.php +5 −0 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Artifact/Changeset/PostCreation/CalendarEvent/EventDatesRetrieverTest.php +25 −0 Go to diff View file