-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: be able to group slack notifications by feature flag tag #1472
Conversation
8d2dff7
to
890be22
Compare
64e27f8
to
b243d57
Compare
// When a flag changes it must be checked before sending notifications | ||
func (s *sender) checkForFeatureDomainEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function handles the domain events to ensure that they are from the FEATURE entity.
Also, it checks if there are tags in the subscription and if the tags configured in the flag match the tags configured in the subscription.
@@ -53,4 +53,5 @@ message Subscription { | |||
string name = 7; | |||
string environment_id = 8; | |||
string environment_name = 9; | |||
repeated string feature_flag_tags = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field will hold the tags that will be used to send the notifications.
// Check if the subcription tag is configured in the feature flag | ||
// If not, we skip the notification | ||
if !send { | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is where we decide whether to send the notification.
// We should only save the tags if the Feature source type is in the list | ||
if req.FeatureFlagTags != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the feature_flags_tags
belongs to the Feature
notification policy, we must validate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend code looks good! 👍
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
…mmand Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
b243d57
to
58e7a6f
Compare
Fix of #1230
Thins done
feature_flag_tags
column to subscription tablefeature_flag_tags
field in the subscription APIsThis pull request introduces the concept of
featureFlagTags
to the subscription feature in the notification service. The changes include updates to the API definitions, database schema, validation logic, and various parts of the notification service to support the newfeatureFlagTags
field.API and Schema Updates:
featureFlagTags
to multiple definitions inapi-description/web-api.swagger.yaml
. [1] [2] [3] [4]feature_flag_tags
column and populated it with an empty array inmigration/mysql/20250122261736_update_subscription_table.sql
.Service and Validation Logic:
NewSubscription
function and related methods inpkg/notification/domain/subscription.go
to handlefeatureFlagTags
. [1] [2]featureFlagTags
are only saved if theFeature
source type is present inpkg/notification/api/validation.go
. [1] [2] [3]Command Handling and Localization:
UpdateSubscriptionFeatureFlagTagsCommand
and its handler inpkg/notification/command/subscription.go
.pkg/locale/localizedata/en.yaml
,pkg/locale/localizedata/ja.yaml
, andpkg/locale/localizer.go
. [1] [2] [3]Test and Miscellaneous Updates:
featureFlagTags
field. [1] [2] [3]These changes ensure that the notification service can now handle feature flag tags within subscriptions, providing more granular control over notification settings.