Add build SHA to panic reports and zed --version (on nightly/dev) (#24258)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-02-06 02:09:24 -07:00 committed by GitHub
parent f08b1d78ec
commit 69e6910c9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 76 additions and 33 deletions

View file

@ -16,7 +16,7 @@ use node_runtime::{NodeBinaryOptions, NodeRuntime};
use paths::logs_dir;
use project::project_settings::ProjectSettings;
use release_channel::AppVersion;
use release_channel::{AppVersion, ReleaseChannel, RELEASE_CHANNEL};
use remote::proxy::ProxyLaunchError;
use remote::ssh_session::ChannelClient;
use remote::{
@ -149,6 +149,14 @@ fn init_panic_hook() {
(&backtrace).join("\n")
);
let release_channel = *RELEASE_CHANNEL;
let version = match release_channel {
ReleaseChannel::Stable | ReleaseChannel::Preview => env!("ZED_PKG_VERSION"),
ReleaseChannel::Nightly | ReleaseChannel::Dev => {
option_env!("ZED_COMMIT_SHA").unwrap_or("missing-zed-commit-sha")
}
};
let panic_data = telemetry_events::Panic {
thread: thread_name.into(),
payload: payload.clone(),
@ -156,11 +164,9 @@ fn init_panic_hook() {
file: location.file().into(),
line: location.line(),
}),
app_version: format!(
"remote-server-{}",
option_env!("ZED_COMMIT_SHA").unwrap_or(&env!("ZED_PKG_VERSION"))
),
release_channel: release_channel::RELEASE_CHANNEL.display_name().into(),
app_version: format!("remote-server-{version}"),
app_commit_sha: option_env!("ZED_COMMIT_SHA").map(|sha| sha.into()),
release_channel: release_channel.display_name().into(),
target: env!("TARGET").to_owned().into(),
os_name: telemetry::os_name(),
os_version: Some(telemetry::os_version()),