Closed julianbrost closed 3 weeks ago
Force push just updated a comment in rotations.go
and rebased. The latter looks a bit confusing in the diff view: I just renamed 025.sql
to 026.sql
but it shows the differences between the two different and unrelated versions of 025.sql
.
Most new changes are within the three new additional commits (please see their commit messages and the updated PR description). Changes to to existing commits should only include changes necessary due to the rebase over #114 (changed import, more db:"-"
needed) and the removal of the unnecessary explicit access of the embedded SugaredLogger
(https://github.com/Icinga/icinga-notifications/pull/204#discussion_r1622602012).
Next step: coordinating merging of all the required PRs, that'll be fun.
Next step: coordinating merging of all the required PRs, that'll be fun.
That was surprisingly easy.
This is a fundamental and incompatible change to how schedules are defined. Now, a schedule consists of a list of rotations that's ordered by priority. Each rotation contains multiple members where each is either a contact or a contact group. Each member is linked to some timeperiod entries which defines when this member is active in the rotation.
This PR already includes code for a feature that was planned but is not yet possible using the web interface at the moment: multiple versions of the same rotation where the handoff time defines when a given version becomes active.
With this change, for the time being, the TimePeriod type itself fulfills no real purpose and the timeperiod entries are directly loaded as part of the schedule, bypassing the timeperiod loading code. However, there still is the plan to add standalone timeperiods in the future, thus the timeperiod code is kept.
More context for these changes:
193
The commits in this PR:
Init()
on timeperiod entries and require this in other methods (as suggested in https://github.com/Icinga/icinga-notifications/pull/204#discussion_r1622606472)./dump-schedules
debug endpoint that returns how all schedules expand within the next two days (as suggested in https://github.com/Icinga/icinga-notifications/pull/204#pullrequestreview-2090414546)Dependencies
To allow testing with Icinga Notifications Web, the following PRs are required there:
closes #193 (schema change already contained in this PR)