Skip to content

Allow to manage and subscribe to incidents - #1392

Merged
nilmerg merged 3 commits into
mainfrom
feature/incidents
Sep 3, 2026
Merged

Allow to manage and subscribe to incidents#1392
nilmerg merged 3 commits into
mainfrom
feature/incidents

Conversation

@BastianLedererIcinga

@BastianLedererIcinga BastianLedererIcinga commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

resolve #1358
requires Icinga/icinga-notifications-web#545

Add a new Subscribe button to QuickActions, to that allows to subscribe to the incident matching the Host/Service.

The existing Acknowledge/Unacknowledge option also serves as manage/unmanage of the matching incident.

Users that have no notification contact configured will see an error message when trying to subscribe, and a warning when acknowledging.

A new Notification Recipients section is added to both Host- and Sevicedetail, showing the current recipients and subscribers. The manager is highlighted with the redesigned ack badge suggested in #1358 (comment).

@cla-bot cla-bot Bot added the cla/signed CLA is signed by all contributors of a PR label Jul 15, 2026
@BastianLedererIcinga
BastianLedererIcinga force-pushed the feature/incidents branch 13 times, most recently from b67ee1d to d467e78 Compare July 15, 2026 06:13
@nilmerg
nilmerg requested a review from sukhwinder33445 July 15, 2026 11:23
@sukhwinder33445

Copy link
Copy Markdown
Contributor

Please mention the required PR Icinga/icinga-notifications-web#472 in the description.

@sukhwinder33445 sukhwinder33445 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the alignment of the new ack badge.

Image

Comment thread library/Icingadb/Notifications/SubscriptionForm.php Outdated
Comment thread library/Icingadb/Notifications/ManagesIncidents.php Outdated
Comment thread library/Icingadb/Common/HostLinks.php
Comment thread library/Icingadb/Common/ServiceLinks.php
Comment thread library/Icingadb/Notifications/SubscribeIncidents.php Outdated
Comment thread library/Icingadb/Notifications/SubscriptionForm.php Outdated
Comment thread library/Icingadb/Widget/Detail/QuickActions.php Outdated
@sukhwinder33445

Copy link
Copy Markdown
Contributor

One more thing I noticed: once you subscribe to and then unsubscribe from an incident in the incident detail view, subscribing again is not possible and throws an error, because the unsubscribe removes the incident_contact DB entry entirely.
Using the QuickAction introduced with this PR always works.

@BastianLedererIcinga

Copy link
Copy Markdown
Contributor Author

One more thing I noticed: once you subscribe to and then unsubscribe from an incident in the incident detail view, subscribing again is not possible and throws an error, because the unsubscribe removes the incident_contact DB entry entirely. Using the QuickAction introduced with this PR always works.

As discussed in person, this an unrelated bug, caused by the IncidentQuickActions not setting the changed_at column.

@sukhwinder33445 sukhwinder33445 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread library/Icingadb/Notifications/SubscriptionForm.php Outdated

@nilmerg nilmerg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this I noticed a flaw in my previous idea how the new component is integrated here. It relies on a few presumptions that are either incompatible or simply wrong:

  • The user acknowledging needs a matching notifications contact
    • This is not always true and we have no idea to identify this as intentional or not, an additional permission should solve this
  • The acknowledgement form still allows to declare an expiry time
  • The acknowledgement form still allows to disable the sticky flag
    • Let's hide this option for users that have the new manage permission and are a contact in notifications
  • Enabling icinga notifications web does not mean it's configured, but this should be a requirement and be easy to answer to decide what to offer
  • incident is already an outdated term so I don't want to see it here. It is also of no meaning to users which have no access to the configuration UI anyway, so we should rather focus on proper representation what the effect of acknowledge now is and what subscribe means compared to the legacy notifications feature. A seamless integration so to say, without the need for the user to know anything about Icinga Notifications.

Comment thread library/Icingadb/Notifications/SubscribeIncidents.php Outdated
Comment thread library/Icingadb/Notifications/SubscribeIncidents.php
Comment thread library/Icingadb/Notifications/ManagesIncidents.php Outdated
Comment thread library/Icingadb/Notifications/ManagesIncidents.php Outdated
Comment thread library/Icingadb/Notifications/ManagesIncidents.php Outdated
Comment thread library/Icingadb/Widget/Detail/ObjectDetail.php Outdated
Comment thread application/forms/Command/Object/AcknowledgeProblemForm.php
Comment thread library/Icingadb/Common/Backend.php
Comment thread configuration.php
Comment thread library/Icingadb/Widget/Detail/MultiselectQuickActions.php Outdated
Comment thread library/Icingadb/Widget/Detail/MultiselectQuickActions.php Outdated
Comment thread library/Icingadb/Widget/Detail/QuickActions.php Outdated
Comment thread library/Icingadb/Widget/Detail/QuickActions.php Outdated
Comment thread library/Icingadb/Widget/Detail/ObjectDetail.php Outdated
Base automatically changed from use-cached-results-when-processing-command-actions to main August 11, 2026 14:33
nilmerg added a commit that referenced this pull request Aug 11, 2026
This effectively makes it impossible to accidentally issue
the query over and over.

refs #1392
@nilmerg
nilmerg force-pushed the feature/incidents branch 3 times, most recently from 5c7bd3d to 0d9cb9f Compare August 11, 2026 14:53
Comment thread library/Icingadb/Common/Backend.php Outdated
Comment thread application/forms/Command/Object/AcknowledgeProblemForm.php Outdated
Comment thread application/forms/Command/Object/AcknowledgeProblemForm.php Outdated
Comment thread library/Icingadb/Notifications/ManagesIncidents.php Outdated
Comment thread library/Icingadb/Notifications/SubscribeIncidents.php
@BastianLedererIcinga

BastianLedererIcinga commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

The added SubscribeIncidents in RedundancygroupController can't be tested without local modifications, because the controller is completely broken due to recent changes, I will create seperate issues for these problems.

When testing subscribe and unsubscribe in a detail view, the subscribe button may not change to unsubscribe. This is a bug in Incidents::getRoles(), Icinga/icinga-notifications-web#541 should fix it.

Comment thread library/Icingadb/Common/Backend.php Outdated
Comment thread library/Icingadb/Notifications/IncidentFinder.php Outdated
Comment thread library/Icingadb/Notifications/ManagesIncidents.php Outdated
Comment thread library/Icingadb/Notifications/SubscriptionForm.php Outdated
Comment thread library/Icingadb/Widget/Detail/MultiselectQuickActions.php Outdated
Comment thread library/Icingadb/Widget/Detail/MultiselectQuickActions.php Outdated
Comment thread library/Icingadb/Widget/Detail/ObjectDetail.php Outdated
Comment thread library/Icingadb/Widget/Detail/QuickActions.php Outdated
@nilmerg

nilmerg commented Aug 18, 2026

Copy link
Copy Markdown
Member

Please also extend doc/05-Upgrading.md and explain the way both, new and legacy, configurations are supported. Also document the migration path I'd recommend as just discussed.

Comment thread library/Icingadb/Notifications/IncidentFinder.php Outdated
Comment thread library/Icingadb/Notifications/SubscriptionForm.php Outdated

@nilmerg nilmerg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still have to test this, though. 😩 Didn't look at the UI in detail as well yet.

Comment thread library/Icingadb/Notifications/IncidentFinder.php Outdated
Comment thread library/Icingadb/Notifications/SubscribeIncidents.php Outdated
Comment thread library/Icingadb/Notifications/SubscribeIncidents.php Outdated
Comment thread public/css/widget/notification-recipients.less
Comment thread library/Icingadb/Widget/Detail/ObjectDetail.php Outdated
Comment thread library/Icingadb/Widget/Detail/ObjectDetail.php Outdated
Comment thread library/Icingadb/Notifications/SubscribeIncidents.php Outdated
Comment thread public/css/widget/notification-recipients.less

@nilmerg nilmerg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One, very small, thing left. You can directly sqash and rebase now.

Comment thread library/Icingadb/Widget/Detail/ObjectDetail.php Outdated
Add a subscribe/unsubscribe option to `QuickActions` and `MultiSelectQuickActions`,
and adjust the exitsing acknowledge/unacknowledge actions to also manage/unmanage.
Show subscribers and recipeints in a new section, highlighting the
manager with a redisigned ack-badge.
Rename the exitsing `Notifications` section to `Configured Contacts`
to avoid confusion.

@nilmerg nilmerg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@nilmerg
nilmerg merged commit 8571eef into main Sep 3, 2026
13 checks passed
@nilmerg
nilmerg deleted the feature/incidents branch September 3, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to manage and subscribe to Icinga Notification Incidents

4 participants