-
Notifications
You must be signed in to change notification settings - Fork 198
feat: adding webhooks functionality #619
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
base: main
Are you sure you want to change the base?
feat: adding webhooks functionality #619
Conversation
Stale pull request message |
Description string `gorm:"type:text"` | ||
Events string `gorm:"type:text"` // Comma-separated list of events to trigger on | ||
Secret string `gorm:"type:text"` // Optional secret for webhook signature | ||
Enabled bool `gorm:"default:true"` |
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.
please add an index here, since the query uses enabled = true
} | ||
if params.Body.EntityType != nil { | ||
et := *params.Body.EntityType | ||
if err := entity.CreateFlagEntityType(tx, et); err != 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.
looks like this logic got removed?
@@ -1,22 +1,28 @@ | |||
package handler | |||
|
|||
import ( |
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.
many of the trigger logic seems repetitive, do you think it can be done with refactor much of this logic into GORM model hooks (BeforeCreate
, AfterCreate
, BeforeUpdate
, AfterUpdate
, BeforeDelete
, AfterDelete
)? This would centralize the webhook logic within the model definitions, making the CRUD handlers cleaner and reducing the risk of missing a webhook trigger in future code changes.
Stale pull request message |
Add Global Webhook Support
Description
This PR adds support for global webhooks in Flagr, allowing users to receive notifications for system events. The implementation includes:
Webhook
entity for storing webhook configurationsWebhookEvent
entity for tracking webhook delivery statusMotivation and Context
Currently, Flagr lacks a way to notify external systems about changes to flags, segments, variants, and other entities. This makes it difficult to integrate Flagr with other systems that need to react to these changes. The webhook system provides a flexible way to notify external systems about these events.
How Has This Been Tested?
Types of changes
Checklist: