Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
extension_api: Add `digest` to `GithubReleaseAsset` (#44399)
Finn Evers79d4f7d33d75
diff --git a/crates/extension_api/wit/since_v0.8.0/github.wit b/crates/extension_api/wit/since_v0.8.0/github.witindex 21cd5d48056..6d7e5d952ae 100644--- a/crates/extension_api/wit/since_v0.8.0/github.wit+++ b/crates/extension_api/wit/since_v0.8.0/github.wit@@ -13,6 +13,8 @@ interface github {name: string,/// The download URL for the asset.download-url: string,+ /// The SHA-256 of the release asset if provided by the GitHub API.+ digest: option<string>,}/// The options used to filter down GitHub releases.diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rsindex a2776f9f3b5..b32ab979836 100644--- a/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs+++ b/crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs@@ -783,6 +783,7 @@ impl From<::http_client::github::GithubReleaseAsset> for github::GithubReleaseAsSelf {name: value.name,download_url: value.browser_download_url,+ digest: value.digest,}}}diff --git a/crates/project/src/agent_server_store.rs b/crates/project/src/agent_server_store.rsindex a2cc57beae9..62937476b8e 100644--- a/crates/project/src/agent_server_store.rs+++ b/crates/project/src/agent_server_store.rs@@ -1495,7 +1495,7 @@ impl ExternalAgentServer for LocalCodex {let digest = asset.digest.as_deref()- .and_then(|d| d.strip_prefix("sha256:").or(Some(d)));+ .map(|d| d.strip_prefix("sha256:").unwrap_or(d));match ::http_client::github_download::download_server_binary(&*http,&asset.browser_download_url,@@ -1727,10 +1727,10 @@ impl ExternalAgentServer for LocalExtensionArchiveAgent {release.assets.iter().find(|a| a.name == filename){// Strip "sha256:" prefix if present- asset.digest.as_ref().and_then(|d| {+ asset.digest.as_ref().map(|d| {d.strip_prefix("sha256:").map(|s| s.to_string())- .or_else(|| Some(d.clone()))+ .unwrap_or_else(|| d.clone())})} else {None