Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
collab: Add `zed-zippy[bot]` to the `GET /contributor` endpoint (#43568)
Marshall Bowers57e1bb810632
diff --git a/crates/collab/src/api/contributors.rs b/crates/collab/src/api/contributors.rsindex 8cfef0ad7e7..574667c723d 100644--- a/crates/collab/src/api/contributors.rs+++ b/crates/collab/src/api/contributors.rs@@ -64,6 +64,16 @@ async fn check_is_contributor(}));}+ if ZedZippyBot::is_zed_zippy_bot(¶ms) {+ return Ok(Json(CheckIsContributorResponse {+ signed_at: Some(+ ZedZippyBot::created_at()+ .and_utc()+ .to_rfc3339_opts(SecondsFormat::Millis, true),+ ),+ }));+ }+Ok(Json(CheckIsContributorResponse {signed_at: app.db@@ -103,6 +113,36 @@ impl RenovateBot {}}+/// The Zed Zippy bot GitHub user (`zed-zippy[bot]`).+///+/// https://api.github.com/users/zed-zippy[bot]+struct ZedZippyBot;++impl ZedZippyBot {+ const LOGIN: &'static str = "zed-zippy[bot]";+ const USER_ID: i32 = 234243425;++ /// Returns the `created_at` timestamp for the Zed Zippy bot user.+ fn created_at() -> &'static NaiveDateTime {+ static CREATED_AT: OnceLock<NaiveDateTime> = OnceLock::new();+ CREATED_AT.get_or_init(|| {+ chrono::DateTime::parse_from_rfc3339("2025-09-24T17:00:11Z")+ .expect("failed to parse 'created_at' for 'zed-zippy[bot]'")+ .naive_utc()+ })+ }++ /// Returns whether the given contributor selector corresponds to the Zed Zippy bot user.+ fn is_zed_zippy_bot(contributor: &ContributorSelector) -> bool {+ match contributor {+ ContributorSelector::GitHubLogin { github_login } => github_login == Self::LOGIN,+ ContributorSelector::GitHubUserId { github_user_id } => {+ github_user_id == &Self::USER_ID+ }+ }+ }+}+#[derive(Debug, Deserialize)]struct AddContributorBody {github_user_id: i32,