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

Marshall Massengill via opennms-cvs <[email protected]>
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: cedbeffdbb24ce3c2bbe99f98152c9ea2b51ecac
      https://github.com/OpenNMS/opennms/commit/cedbeffdbb24ce3c2bbe99f98152c9ea2b51ecac
  Author: Marshall Massengill <[email protected]>
  Date:   2026-08-06 (Thu, 06 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: 08dd14bdb95ebe52c7ed8132beb185a8543a0061
      https://github.com/OpenNMS/opennms/commit/08dd14bdb95ebe52c7ed8132beb185a8543a0061
  Author: Marshall Massengill <[email protected]>
  Date:   2026-08-06 (Thu, 06 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.


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

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

  Log Message:
  -----------
  Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>


  Commit: 01b7ada9ecc5814dc0dd87bce116731e520bfcd6
      https://github.com/OpenNMS/opennms/commit/01b7ada9ecc5814dc0dd87bce116731e520bfcd6
  Author: Marshall Massengill <[email protected]>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M docs/modules/operation/pages/deep-dive/notifications/strategies/webhook.adoc

  Log Message:
  -----------
  NMS-20113: Fix three escaped tokens in the webhook documentation

AsciiDoc honors a backslash escape before a brace only when the braces
hold a valid attribute name, so ${...}, ${customBlocks|raw} and
${scv:...} kept their backslash and rendered as $\{...} on the page.
None of the three needs escaping, because none of them parses as an
attribute reference in the first place.


Compare: https://github.com/OpenNMS/opennms/compare/bb402a5cd9f5...01b7ada9ecc5

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.