-
Notifications
You must be signed in to change notification settings - Fork 2
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
add webhooks function (Http, SlackIncomingWebhook) #259
Conversation
core/utils/src/wave_config.rs
Outdated
#[serde(default = "default_webhooks_headers")] | ||
pub headers: Option<HashMap<String, String>>, | ||
#[serde(default = "default_webhooks_webhook_url")] | ||
pub webhook_url: Option<String>, |
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.
merge webhook_url with url
#[derive(PartialEq, Clone, Deserialize, Debug)] | ||
pub struct Webhooks { | ||
pub id: String, | ||
pub webhook_type: WebhookType, |
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.
ignore the upper or the lower cases
core/wave-autoscale/src/app.rs
Outdated
pub async fn new( | ||
wave_config: WaveConfig, | ||
shared_data_layer: Arc<DataLayer>, | ||
webhooks: Option<Vec<utils::wave_config::Webhooks>>, |
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.
remove the webhooks and reuse the wave_config
core/wave-autoscale/src/main.rs
Outdated
let mut app = app::App::new( | ||
wave_config.clone(), | ||
shared_data_layer.clone(), | ||
wave_config.webhooks.clone(), |
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.
remove the line
})) | ||
} | ||
|
||
pub fn response_for_slack(&self) -> Option<serde_json::Value> { |
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.
to_slack
pub fail_message: Option<String>, | ||
} | ||
impl WebhookResponse { | ||
pub fn response_for_http(&self) -> Option<serde_json::Value> { |
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.
to_http
use utils::wave_config::Webhooks; | ||
|
||
#[derive(Clone)] | ||
pub struct WebhookResponse { |
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.
WebhookResponse => WebhookRequestBody
} | ||
} | ||
|
||
pub enum WebhookResponseStatus { |
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.
- PlanStatus
- remove 'pub'
Types of changes
Which issue/s this PR fixes (#)
#239
How Has This Been Tested?