Report build SHA to Slack for Zed Nightly panics (#34665)
There can be a bunch of nightlies with the same version number and it's helpful to know exactly which one reported a panic. Release Notes: - N/A
This commit is contained in:
parent
0c88189aab
commit
237ce5c8e8
1 changed files with 43 additions and 38 deletions
|
@ -389,6 +389,11 @@ pub async fn post_panic(
|
|||
}
|
||||
}
|
||||
|
||||
if !report_to_slack(&panic) {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if let Some(slack_panics_webhook) = app.config.slack_panics_webhook.clone() {
|
||||
let backtrace = if panic.backtrace.len() > 25 {
|
||||
let total = panic.backtrace.len();
|
||||
format!(
|
||||
|
@ -405,21 +410,21 @@ pub async fn post_panic(
|
|||
} else {
|
||||
panic.backtrace.join("\n")
|
||||
};
|
||||
|
||||
if !report_to_slack(&panic) {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let backtrace_with_summary = panic.payload + "\n" + &backtrace;
|
||||
|
||||
if let Some(slack_panics_webhook) = app.config.slack_panics_webhook.clone() {
|
||||
let version = if panic.release_channel == "nightly"
|
||||
&& !panic.app_version.contains("remote-server")
|
||||
&& let Some(sha) = panic.app_commit_sha
|
||||
{
|
||||
format!("Zed Nightly {}", sha.chars().take(7).collect::<String>())
|
||||
} else {
|
||||
panic.app_version
|
||||
};
|
||||
|
||||
let payload = slack::WebhookBody::new(|w| {
|
||||
w.add_section(|s| s.text(slack::Text::markdown("Panic request".to_string())))
|
||||
.add_section(|s| {
|
||||
s.add_field(slack::Text::markdown(format!(
|
||||
"*Version:*\n {} ",
|
||||
panic.app_version
|
||||
)))
|
||||
s.add_field(slack::Text::markdown(format!("*Version:*\n {version} ",)))
|
||||
.add_field({
|
||||
let hostname = app.config.blob_store_url.clone().unwrap_or_default();
|
||||
let hostname = hostname.strip_prefix("https://").unwrap_or_else(|| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue