[OpenNMS/opennms] 83b42e: NMS-20113: Replace the Slack and Mattermost notifi...

Marshall Massengill via opennms-cvs <[email protected]> Mon, 03 Aug 2026 08:39:01 -0700
Newsgroups gmane.network.opennms.cvs
Message-ID <OpenNMS/opennms/push/refs/heads/mm/NMS-20113-smoke/[email protected]>
  Branch: refs/heads/mm/NMS-20113-smoke
  Home:   https://github.com/OpenNMS/opennms
  Commit: 83b42e383cf8243b87687cc22e67292a464fd7ad
      https://github.com/OpenNMS/opennms/commit/83b42e383cf8243b87687cc22e67292a464fd7ad
  Author: Marshall Massengill <[email protected]>
  Date:   2026-08-03 (Mon, 03 Aug 2026)

  Changed paths:
    M docs/modules/operation/nav.adoc
    M docs/modules/operation/pages/deep-dive/notifications/bonus-strategies.adoc
    M docs/modules/operation/pages/deep-dive/notifications/introduction.adoc
    R docs/modules/operation/pages/deep-dive/notifications/strategies/mattermost.adoc
    R docs/modules/operation/pages/deep-dive/notifications/strategies/slack.adoc
    A docs/modules/operation/pages/deep-dive/notifications/strategies/webhook.adoc
    M docs/modules/operation/pages/quick-start/beyond-qs.adoc
    M docs/modules/releasenotes/pages/changelog.adoc
    M docs/modules/releasenotes/pages/whatsnew.adoc
    M opennms-services/pom.xml
    R opennms-services/src/main/java/org/opennms/netmgt/notifd/AbstractSlackCompatibleNotificationStrategy.java
    R opennms-services/src/main/java/org/opennms/netmgt/notifd/MattermostNotificationStrategy.java
    R opennms-services/src/main/java/org/opennms/netmgt/notifd/SlackNotificationStrategy.java
    A opennms-services/src/main/java/org/opennms/netmgt/notifd/WebhookNotificationStrategy.java
    R opennms-services/src/test/java/org/opennms/netmgt/notifd/MattermostNotificationStrategyIT.java
    R opennms-services/src/test/java/org/opennms/netmgt/notifd/MattermostNotificationStrategyTestServlet.java
    R opennms-services/src/test/java/org/opennms/netmgt/notifd/SlackCompatibleNotificationStrategyTest.java
    R opennms-services/src/test/java/org/opennms/netmgt/notifd/SlackNotificationStrategyIT.java
    A opennms-services/src/test/java/org/opennms/netmgt/notifd/WebhookNotificationStrategyIT.java
    A opennms-services/src/test/java/org/opennms/netmgt/notifd/WebhookNotificationStrategyTest.java
    A opennms-services/src/test/java/org/opennms/netmgt/notifd/WebhookNotificationStrategyTestServlet.java
    R opennms-services/src/test/resources/MattermostNotificationStrategyTest/WEB-INF/web.xml
    A opennms-services/src/test/resources/WebhookNotificationStrategyTest/WEB-INF/web.xml

  Log Message:
  -----------
  NMS-20113: Replace the Slack and Mattermost notification channels with a generic webhook

The Slack and Mattermost strategies shared a base class that built one
hardcoded JSON shape, so no other receiver could be expressed, and it
treated only a literal "ok" response body as success, which meant a
receiver answering 204 with no body was always logged as failed.

Adds WebhookNotificationStrategy, which takes the URL, method, content
type, headers, and body template from the notification command. Values
substituted into a JSON body are escaped, with a |raw modifier for
fragments that are themselves JSON, and the rendered body is parsed
before it is sent so a template mistake is reported locally instead of
as an opaque 400. Any 2xx counts as success, narrowed by an optional
-success-match for receivers that report failure behind a 200.

Template tokens deliberately exclude colons so they cannot collide with
the metadata DSL, which notifd resolves against notification parameters
before the command runs.

Removes the two strategies, their shared base class, and their tests,
and replaces the two documentation pages with a single webhook page
carrying Slack, Mattermost, Microsoft Teams, Discord, and non-chat
examples plus a migration table.


  Commit: db56057dcde3d766ce7999b94d49386f4cceda49
      https://github.com/OpenNMS/opennms/commit/db56057dcde3d766ce7999b94d49386f4cceda49
  Author: Marshall Massengill <[email protected]>
  Date:   2026-08-03 (Mon, 03 Aug 2026)

  Changed paths:
    M docs/modules/operation/pages/deep-dive/notifications/strategies/webhook.adoc
    M opennms-services/src/main/java/org/opennms/netmgt/notifd/WebhookNotificationStrategy.java
    M opennms-services/src/test/java/org/opennms/netmgt/notifd/WebhookNotificationStrategyTest.java

  Log Message:
  -----------
  NMS-20113: Review fixes for the webhook notification strategy

Log only the scheme and host of the webhook URL. Slack, Discord and
Teams URLs carry their credential in the path or query, so the previous
error log wrote a secret to notifd.log on any connection failure.

Reject blank bodies and trailing content when validating a JSON payload.
ObjectMapper.readTree maps blank input to a MissingNode and stops at the
first value, so {"text": "x"} oops was passing the check the strategy
advertises and failing at the receiver instead.

Also warn on an unknown template modifier rather than emitting the token
verbatim, ignore a negative timeout, and document that substitution
applies to the body alone and that a header must be declared as an
argument for its system property to take effect.


Compare: https://github.com/OpenNMS/opennms/compare/83b42e383cf8%5E...db56057dcde3

To unsubscribe from these emails, change your notification settings at https://github.com/OpenNMS/opennms/settings/notifications


_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/wiki/index.php?page=MailingListFaq
opennms-cvs mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-cvs