backstage icon indicating copy to clipboard operation
backstage copied to clipboard

feat: add notifications filtering by processors

Open ydayagi opened this issue 9 months ago • 8 comments

Hey, I just made a Pull Request!

Allow processors to distinguish low and high-importance notifications The first use would be for email processor Users usually want only high-importance notifications in their emails Implementation is based on this suggestion https://github.com/backstage/backstage/pull/24322#issuecomment-2075131200

ydayagi avatar May 12 '24 16:05 ydayagi

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-notifications-backend-module-email plugins/notifications-backend-module-email minor v0.0.1
@backstage/plugin-notifications-backend plugins/notifications-backend minor v0.2.1
@backstage/plugin-notifications-node plugins/notifications-node minor v0.1.4

backstage-goalie[bot] avatar May 12 '24 16:05 backstage-goalie[bot]

Missing changeset + API report updates

drodil avatar May 13 '24 07:05 drodil

Missing changeset + API report updates

fixed

ydayagi avatar May 15 '24 09:05 ydayagi

@drodil I made the requested changes. who approves/merges? you?

ydayagi avatar May 15 '24 13:05 ydayagi

@ydayagi no I cannot do that, it's either @mareklibra @Rugvip or @freben

drodil avatar May 15 '24 13:05 drodil

@drodil is it good to ship from your PoV?

Rugvip avatar May 15 '24 14:05 Rugvip

Hm. It's not a major release for starters. Also not sure if the naming convention is understandable as there are no docs. Maybe also there could be other filters included in the first place and not just to get one specific functionality to work; maximumSeverity, topics from the top of my head.

Additionally this change itself does nothing yet and additional changes are required to the actual processors to make this work but that can be done in a separate PR.

drodil avatar May 15 '24 14:05 drodil

Hm. It's not a major release for starters. Also not sure if the naming convention is understandable as there are no docs. Maybe also there could be other filters included in the first place and not just to get one specific functionality to work; maximumSeverity, topics from the top of my head.

Additionally this change itself does nothing yet and additional changes are required to the actual processors to make this work but that can be done in a separate PR.

there is no real use for filters other than minSeverity at the moment. after this is merged I will create PR for email processor to use minSeverity filter. I don't see any real life use case for maxSeverity nor for topics

ydayagi avatar May 15 '24 17:05 ydayagi

@ydayagi you mean you don't have a use case for those filters? Backstage is a framework and should be developed as such.

drodil avatar May 16 '24 05:05 drodil

@ydayagi you mean you don't have a use case for those filters? Backstage is a framework and should be developed as such.

You are right. I meant that maxSeverity to my knowledge/experience might not have a legitimate use case. But you are right. It is better to have it. Lets be productive here. What would you like to add in order to have this merged and used by all of backstage users? Topics and maxSeverity? There are string fields such as scope and topic. What about replacing the topic filter with a 'text filter' that searches all descriptive string fields? I mean title description scope topic. I think that nowadays people do a more broad text search rather then a specific one. @Rugvip WDYT too?

ydayagi avatar May 16 '24 06:05 ydayagi

@mareklibra @drodil @Rugvip I added all filters suggested by drodil plus implementation in email processor

ydayagi avatar May 20 '24 10:05 ydayagi

Honestly, I do not see a use-case for the maxSeverity either, but there is just no harm in having it.

Once we have several processors implemented, such filtering will be copy-pasted in each of them. I would rather see the filtering logic to be shared and implemented once before passing a notification down to a processor.

I will not block merging of this PR on that, let's keep this idea for a future refactoring.

mareklibra avatar May 21 '24 08:05 mareklibra

It LGTM, just the change is minor, not major (pushing a commit changing it)

mareklibra avatar May 21 '24 08:05 mareklibra

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.28.0 release, scheduled for Tue, 18 Jun 2024.

github-actions[bot] avatar May 22 '24 10:05 github-actions[bot]

Uffizzi Cluster pr-24731 was deleted.

github-actions[bot] avatar May 22 '24 10:05 github-actions[bot]