releases: Add build number to Nightly builds (#42990)

- **Remove semantic_version crate and use semver instead**
- **Update upload-nightly**


Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Piotr Osiewicz
2025-11-24 13:34:04 +01:00
committed by GitHub
co-authored by Conrad Irwin
parent a0fa5d57c1
commit 2d55c088cc
91 changed files with 372 additions and 419 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ use axum::{
};
use collections::{BTreeSet, HashMap};
use rpc::{ExtensionApiManifest, ExtensionProvides, GetExtensionsResponse};
use semantic_version::SemanticVersion;
use semver::Version as SemanticVersion;
use serde::Deserialize;
use std::str::FromStr;
use std::{sync::Arc, time::Duration};
@@ -108,8 +108,8 @@ struct GetExtensionUpdatesParams {
ids: String,
min_schema_version: i32,
max_schema_version: i32,
min_wasm_api_version: SemanticVersion,
max_wasm_api_version: SemanticVersion,
min_wasm_api_version: semver::Version,
max_wasm_api_version: semver::Version,
}
async fn get_extension_updates(
+2 -2
View File
@@ -22,7 +22,7 @@ use sea_orm::{
entity::prelude::*,
sea_query::{Alias, Expr, OnConflict},
};
use semantic_version::SemanticVersion;
use semver::Version;
use serde::{Deserialize, Serialize};
use std::ops::RangeInclusive;
use std::{
@@ -671,7 +671,7 @@ pub struct NewExtensionVersion {
pub struct ExtensionVersionConstraints {
pub schema_versions: RangeInclusive<i32>,
pub wasm_api_versions: RangeInclusive<SemanticVersion>,
pub wasm_api_versions: RangeInclusive<semver::Version>,
}
impl LocalSettingsKind {
+4 -5
View File
@@ -69,7 +69,7 @@ impl Database {
extensions: &[extension::Model],
constraints: Option<&ExtensionVersionConstraints>,
tx: &DatabaseTransaction,
) -> Result<HashMap<ExtensionId, (extension_version::Model, SemanticVersion)>> {
) -> Result<HashMap<ExtensionId, (extension_version::Model, Version)>> {
let mut versions = extension_version::Entity::find()
.filter(
extension_version::Column::ExtensionId
@@ -79,11 +79,10 @@ impl Database {
.await?;
let mut max_versions =
HashMap::<ExtensionId, (extension_version::Model, SemanticVersion)>::default();
HashMap::<ExtensionId, (extension_version::Model, Version)>::default();
while let Some(version) = versions.next().await {
let version = version?;
let Some(extension_version) = SemanticVersion::from_str(&version.version).log_err()
else {
let Some(extension_version) = Version::from_str(&version.version).log_err() else {
continue;
};
@@ -102,7 +101,7 @@ impl Database {
}
if let Some(wasm_api_version) = version.wasm_api_version.as_ref() {
if let Some(version) = SemanticVersion::from_str(wasm_api_version).log_err() {
if let Some(version) = Version::from_str(wasm_api_version).log_err() {
if !constraints.wasm_api_versions.contains(&version) {
continue;
}
+6 -6
View File
@@ -50,7 +50,7 @@ use rpc::{
RequestMessage, ShareProject, UpdateChannelBufferCollaborators,
},
};
use semantic_version::SemanticVersion;
use semver::Version;
use serde::{Serialize, Serializer};
use std::{
any::TypeId,
@@ -985,14 +985,14 @@ impl Server {
{
let mut pool = self.connection_pool.lock();
pool.add_connection(connection_id, user.id, user.admin, zed_version);
pool.add_connection(connection_id, user.id, user.admin, zed_version.clone());
self.peer.send(
connection_id,
build_initial_contacts_update(contacts, &pool),
)?;
}
if should_auto_subscribe_to_channels(zed_version) {
if should_auto_subscribe_to_channels(&zed_version) {
subscribe_user_to_channels(user.id, session).await?;
}
@@ -1136,7 +1136,7 @@ impl Header for ProtocolVersion {
}
}
pub struct AppVersionHeader(SemanticVersion);
pub struct AppVersionHeader(Version);
impl Header for AppVersionHeader {
fn name() -> &'static HeaderName {
static ZED_APP_VERSION: OnceLock<HeaderName> = OnceLock::new();
@@ -2834,8 +2834,8 @@ async fn remove_contact(
Ok(())
}
fn should_auto_subscribe_to_channels(version: ZedVersion) -> bool {
version.0.minor() < 139
fn should_auto_subscribe_to_channels(version: &ZedVersion) -> bool {
version.0.minor < 139
}
async fn subscribe_to_channels(
+5 -5
View File
@@ -2,7 +2,7 @@ use crate::db::{ChannelId, ChannelRole, UserId};
use anyhow::{Context as _, Result};
use collections::{BTreeMap, HashMap, HashSet};
use rpc::ConnectionId;
use semantic_version::SemanticVersion;
use semver::Version;
use serde::Serialize;
use std::fmt;
use tracing::instrument;
@@ -19,8 +19,8 @@ struct ConnectedPrincipal {
connection_ids: HashSet<ConnectionId>,
}
#[derive(Copy, Clone, Debug, Serialize, PartialOrd, PartialEq, Eq, Ord)]
pub struct ZedVersion(pub SemanticVersion);
#[derive(Clone, Debug, Serialize, PartialOrd, PartialEq, Eq, Ord)]
pub struct ZedVersion(pub Version);
impl fmt::Display for ZedVersion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -32,13 +32,13 @@ impl ZedVersion {
pub fn can_collaborate(&self) -> bool {
// v0.204.1 was the first version after the auto-update bug.
// We reject any clients older than that to hope we can persuade them to upgrade.
if self.0 < SemanticVersion::new(0, 204, 1) {
if self.0 < Version::new(0, 204, 1) {
return false;
}
// Since we hotfixed the changes to no longer connect to Collab automatically to Preview, we also need to reject
// versions in the range [v0.199.0, v0.199.1].
if self.0 >= SemanticVersion::new(0, 199, 0) && self.0 < SemanticVersion::new(0, 199, 2) {
if self.0 >= Version::new(0, 199, 0) && self.0 < Version::new(0, 199, 2) {
return false;
}
@@ -7,10 +7,7 @@ use debugger_ui::debugger_panel::DebugPanel;
use extension::ExtensionHostProxy;
use fs::{FakeFs, Fs as _, RemoveOptions};
use futures::StreamExt as _;
use gpui::{
AppContext as _, BackgroundExecutor, SemanticVersion, TestAppContext, UpdateGlobal as _,
VisualContext,
};
use gpui::{AppContext as _, BackgroundExecutor, TestAppContext, UpdateGlobal as _, VisualContext};
use http_client::BlockedHttpClient;
use language::{
FakeLspAdapter, Language, LanguageConfig, LanguageMatcher, LanguageRegistry,
@@ -43,10 +40,10 @@ async fn test_sharing_an_ssh_remote_project(
) {
let executor = cx_a.executor();
cx_a.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
});
server_cx.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
});
let mut server = TestServer::start(executor.clone()).await;
let client_a = server.create_client(cx_a, "user_a").await;
@@ -211,10 +208,10 @@ async fn test_ssh_collaboration_git_branches(
server_cx.set_name("server");
cx_a.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
});
server_cx.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
});
let mut server = TestServer::start(executor.clone()).await;
@@ -396,10 +393,10 @@ async fn test_ssh_collaboration_formatting_with_prettier(
server_cx.set_name("server");
cx_a.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
});
server_cx.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
});
let mut server = TestServer::start(executor.clone()).await;
@@ -583,13 +580,13 @@ async fn test_remote_server_debugger(
executor: BackgroundExecutor,
) {
cx_a.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
command_palette_hooks::init(cx);
zlog::init_test();
dap_adapters::init(cx);
});
server_cx.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
dap_adapters::init(cx);
});
let (opts, server_ssh) = RemoteClient::fake_server(cx_a, server_cx);
@@ -691,13 +688,13 @@ async fn test_slow_adapter_startup_retries(
executor: BackgroundExecutor,
) {
cx_a.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
command_palette_hooks::init(cx);
zlog::init_test();
dap_adapters::init(cx);
});
server_cx.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
dap_adapters::init(cx);
});
let (opts, server_ssh) = RemoteClient::fake_server(cx_a, server_cx);
+2 -3
View File
@@ -31,7 +31,6 @@ use rpc::{
RECEIVE_TIMEOUT,
proto::{self, ChannelRole},
};
use semantic_version::SemanticVersion;
use serde_json::json;
use session::{AppSession, Session};
use settings::SettingsStore;
@@ -173,7 +172,7 @@ impl TestServer {
let settings = SettingsStore::test(cx);
cx.set_global(settings);
theme::init(theme::LoadThemes::JustBase, cx);
release_channel::init(SemanticVersion::default(), cx);
release_channel::init(semver::Version::new(0, 0, 0), cx);
});
let clock = Arc::new(FakeSystemClock::new());
@@ -295,7 +294,7 @@ impl TestServer {
server_conn,
client_name,
Principal::User(user),
ZedVersion(SemanticVersion::new(1, 0, 0)),
ZedVersion(semver::Version::new(1, 0, 0)),
Some("test".to_string()),
None,
None,