-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: fixed and improved webhooks #283
Conversation
@@ -43,9 +50,17 @@ pub enum WebhookEvent { | |||
ExperimentConcluded, | |||
} | |||
|
|||
#[derive(Serialize, Deserialize)] | |||
pub struct EventInfo { |
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.
pub struct EventInfo { | |
pub struct WebhookEventInfo { |
We may have other system events in the future, so wanted to namespace this now
#[derive(Serialize, Deserialize)] | ||
pub struct EventInfo { | ||
pub webhook_event: WebhookEvent, | ||
pub time: NaiveDateTime, |
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.
Why not string, then you don't need to import chrono
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.
Why string?
importing chrono will cause any issue?
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.
Yeah superposition_types is used in all other places, so it increases the size, compile time, etc. If we can avoid it, since it's used only to store the timestamp which is a string at the end - then fine
@@ -23,6 +21,6 @@ tenant = { schema = { "type" = "string", "enum" = ["test", "dev"] } } | |||
|
|||
[context."$tenant == 'dev'"] | |||
mandatory_dimensions = [] | |||
experiments_webhook_config = { "enabled" = false, "configuration" = { "url" = "http://localhost:8080/config/test", "method" = "Get", "headers" = [ | |||
"ConfigVersion", | |||
experiments_webhook_config = { "enabled" = false, "configuration" = { "url" = "http://localhost:8080/config/test", "method" = "Get", "service_headers" = [ |
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.
Shouldn't you define custom_headers here or in default_config?
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.
Yeah i'll define it
But i have kept it not required, so would be fine to leave it also
b7f7389
to
e1557b1
Compare
e1557b1
to
9292200
Compare
Problem
Improvement in webhook event.
Solution
Added tenant_id, config_version in the webhook response.
And added custom_headers in webhook object too.