Icinga / icinga-notifications

Icinga Notifications: new and improved notifications and incident management for Icinga (work in progress, not ready for production yet)
GNU General Public License v2.0
9 stars 0 forks source link

Change schedule configuration to support new rotations #204

Closed julianbrost closed 3 weeks ago

julianbrost commented 1 month ago

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:

The commits in this PR:

Dependencies

To allow testing with Icinga Notifications Web, the following PRs are required there:

[!CAUTION] Applying the schema upgrade is destructive to the current schedule configuration and there is no easy way to rollback. Be prepared for this and better create a backup first.

closes #193 (schema change already contained in this PR)

julianbrost commented 1 month 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.

julianbrost commented 4 weeks ago

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).

julianbrost commented 3 weeks ago

Next step: coordinating merging of all the required PRs, that'll be fun.

julianbrost commented 3 weeks ago

Next step: coordinating merging of all the required PRs, that'll be fun.

That was surprisingly easy.