Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sending non-state notifications without an incident #188

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Commits on May 15, 2024

  1. Determine whether an incident is new by its StartedAt timestamp

    We don't need to pass this info around methods since we can easily
    determine whether an incident is new based on its `StartedAt` timestamp.
    
    Co-Authored-By: Sukhwinder Dhillon <sukhwinder.dhillon@icinga.com>
    yhabteab and sukhwinder33445 committed May 15, 2024
    Configuration menu
    Copy the full SHA
    311ed1b View commit details
    Browse the repository at this point in the history
  2. Decouple contactChannels from incident package

    We're going to use this recipient channels map elsewhere outside the
    `incident` package in the future and it seems reasonable to me to move
    it here to the `rule` package.
    yhabteab committed May 15, 2024
    Configuration menu
    Copy the full SHA
    46c8084 View commit details
    Browse the repository at this point in the history
  3. Introduce type rule.RecipientMeta

    In the upcoming commits, this will also be used elsewhere.
    yhabteab committed May 15, 2024
    Configuration menu
    Copy the full SHA
    8c41f87 View commit details
    Browse the repository at this point in the history
  4. Introduce type rule.Meta

    In the upcoming commits, this will also be used elsewhere.
    yhabteab committed May 15, 2024
    Configuration menu
    Copy the full SHA
    1d8ae0a View commit details
    Browse the repository at this point in the history
  5. Implement zapcore.ObjectMarshaler for rule.Escalation & `recipien…

    …t.Key`
    
    This allows us to use `zap.Inline(escalation)` or
    `zap.Object("escalation", escalation)`wherever more logging context is
    needed without having to add all the individual fields ourselves each
    time.
    yhabteab committed May 15, 2024
    Configuration menu
    Copy the full SHA
    e939e26 View commit details
    Browse the repository at this point in the history
  6. Introduce rule.Routing type

    It will be used to determine non-state notification recipients without
    an incident.
    yhabteab committed May 15, 2024
    Configuration menu
    Copy the full SHA
    4366dcc View commit details
    Browse the repository at this point in the history
  7. Load rule.Routing & rule.RoutingRecipients in runtime config

    Given that these configs are user-configurable, they need to be loaded
    regulary from the database just like the other types. I have also
    already taken careful consideration to deduplicate as much code as
    possible.
    yhabteab committed May 15, 2024
    Configuration menu
    Copy the full SHA
    259e1f4 View commit details
    Browse the repository at this point in the history
  8. Move superfluous event error type to event package & add another er…

    …ror type
    
    Otherwise, we will have a cyclic import error with the upcoming changes
    to non-state event processing support. They kind of also fit into this
    package.
    yhabteab committed May 15, 2024
    Configuration menu
    Copy the full SHA
    d9e344c View commit details
    Browse the repository at this point in the history
  9. Drop incident#AddHistory() method

    It was already quite annoying having to return `types.Int` every single
    time this method was used. This commit embeds the functionality for
    `insert and fetch ID` directly into the `HistoryRow` type and nowhere
    needs to be returned. The just inserted and fetched ID can be accessed
    with `history.ID`.
    yhabteab committed May 15, 2024
    Configuration menu
    Copy the full SHA
    e505946 View commit details
    Browse the repository at this point in the history
  10. Allow to send notifications without an active incident

    I also replaced `errors` with `github/pkg/errors` package, is it was
    quite challenging to track down the errors, as we only get messages
    without stack traces with the standard errors package.
    yhabteab committed May 15, 2024
    Configuration menu
    Copy the full SHA
    49b112b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e81c5c3 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    b2fc42d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    17b3122 View commit details
    Browse the repository at this point in the history
  14. Drop incident_event table & incident#ProcessEvent() function

    The `incident_event` table is now obsolete and is no longer required,
    and the `incident#ProcessEvent()` method has been replaced by the new
    `events.Router` type.
    yhabteab committed May 15, 2024
    Configuration menu
    Copy the full SHA
    39bf393 View commit details
    Browse the repository at this point in the history
  15. Add required schema changes

    Co-Authored-By: Sukhwinder Dhillon <sukhwinder.dhillon@icinga.com>
    yhabteab and sukhwinder33445 committed May 15, 2024
    Configuration menu
    Copy the full SHA
    11b142c View commit details
    Browse the repository at this point in the history