Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

collab: Remove unused `Config` fields (#48836)

Marshall Bowersf81dfca30a55
diff --git a/crates/collab/.env.toml b/crates/collab/.env.toml
index 325beb28fc0..8a4c74067a7 100644
--- a/crates/collab/.env.toml
+++ b/crates/collab/.env.toml
@@ -3,7 +3,6 @@ DATABASE_URL = "postgres://postgres@localhost/zed"
DATABASE_MAX_CONNECTIONS = 5
HTTP_PORT = 8080
API_TOKEN = "secret"
-INVITE_LINK_PREFIX = "http://localhost:3000/invites/"
ZED_ENVIRONMENT = "development"
LIVEKIT_SERVER = "http://localhost:7880"
LIVEKIT_KEY = "devkey"
@@ -15,10 +14,6 @@ BLOB_STORE_URL = "http://127.0.0.1:9000"
BLOB_STORE_REGION = "the-region"
ZED_CLIENT_CHECKSUM_SEED = "development-checksum-seed"
SEED_PATH = "crates/collab/seed.default.json"
-LLM_DATABASE_URL = "postgres://postgres@localhost/zed_llm"
-LLM_DATABASE_MAX_CONNECTIONS = 5
-LLM_API_SECRET = "llm-secret"
-OPENAI_API_KEY = "llm-secret"
# RUST_LOG=info
# LOG_JSON=true
diff --git a/crates/collab/k8s/collab.template.yml b/crates/collab/k8s/collab.template.yml
index 751decf5ff5..bad3d290d79 100644
--- a/crates/collab/k8s/collab.template.yml
+++ b/crates/collab/k8s/collab.template.yml
@@ -92,18 +92,6 @@ spec:
secretKeyRef:
name: api
key: token
- - name: LLM_API_SECRET
- valueFrom:
- secretKeyRef:
- name: llm-token
- key: secret
- - name: LLM_DATABASE_URL
- valueFrom:
- secretKeyRef:
- name: llm-database
- key: url
- - name: LLM_DATABASE_MAX_CONNECTIONS
- value: "${LLM_DATABASE_MAX_CONNECTIONS}"
- name: ZED_CLIENT_CHECKSUM_SEED
valueFrom:
secretKeyRef:
@@ -124,46 +112,6 @@ spec:
secretKeyRef:
name: livekit
key: secret
- - name: OPENAI_API_KEY
- valueFrom:
- secretKeyRef:
- name: openai
- key: api_key
- - name: ANTHROPIC_API_KEY
- valueFrom:
- secretKeyRef:
- name: anthropic
- key: api_key
- - name: ANTHROPIC_STAFF_API_KEY
- valueFrom:
- secretKeyRef:
- name: anthropic
- key: staff_api_key
- - name: LLM_CLOSED_BETA_MODEL_NAME
- valueFrom:
- secretKeyRef:
- name: llm-closed-beta
- key: model_name
- - name: GOOGLE_AI_API_KEY
- valueFrom:
- secretKeyRef:
- name: google-ai
- key: api_key
- - name: PREDICTION_API_URL
- valueFrom:
- secretKeyRef:
- name: prediction
- key: api_url
- - name: PREDICTION_API_KEY
- valueFrom:
- secretKeyRef:
- name: prediction
- key: api_key
- - name: PREDICTION_MODEL
- valueFrom:
- secretKeyRef:
- name: prediction
- key: model
- name: BLOB_STORE_ACCESS_KEY
valueFrom:
secretKeyRef:
@@ -214,15 +162,6 @@ spec:
secretKeyRef:
name: blob-store
key: bucket
- - name: COMPLETE_WITH_LANGUAGE_MODEL_RATE_LIMIT_PER_HOUR
- value: "1000"
- - name: SUPERMAVEN_ADMIN_API_KEY
- valueFrom:
- secretKeyRef:
- name: supermaven
- key: api_key
- - name: INVITE_LINK_PREFIX
- value: ${INVITE_LINK_PREFIX}
- name: RUST_BACKTRACE
value: "1"
- name: RUST_LOG
@@ -231,8 +170,6 @@ spec:
value: "true"
- name: ZED_ENVIRONMENT
value: ${ZED_ENVIRONMENT}
- - name: AUTO_JOIN_CHANNEL_ID
- value: "${AUTO_JOIN_CHANNEL_ID}"
securityContext:
capabilities:
# TODO - Switch to the more restrictive `PERFMON` capability.
diff --git a/crates/collab/k8s/environments/production.sh b/crates/collab/k8s/environments/production.sh
index 2861f378962..8e1790e7c80 100644
--- a/crates/collab/k8s/environments/production.sh
+++ b/crates/collab/k8s/environments/production.sh
@@ -1,7 +1,2 @@
ZED_ENVIRONMENT=production
RUST_LOG=info
-INVITE_LINK_PREFIX=https://zed.dev/invites/
-AUTO_JOIN_CHANNEL_ID=283
-# Set DATABASE_MAX_CONNECTIONS max connections in the `deploy_collab.yml`:
-# https://github.com/zed-industries/zed/blob/main/.github/workflows/deploy_collab.yml
-LLM_DATABASE_MAX_CONNECTIONS=25
diff --git a/crates/collab/k8s/environments/staging.sh b/crates/collab/k8s/environments/staging.sh
index 90aadce5146..bfa59bbe2c5 100644
--- a/crates/collab/k8s/environments/staging.sh
+++ b/crates/collab/k8s/environments/staging.sh
@@ -1,6 +1,3 @@
ZED_ENVIRONMENT=staging
RUST_LOG=info
-INVITE_LINK_PREFIX=https://staging.zed.dev/invites/
DATABASE_MAX_CONNECTIONS=5
-LLM_DATABASE_MAX_CONNECTIONS=5
-AUTO_JOIN_CHANNEL_ID=8
diff --git a/crates/collab/src/lib.rs b/crates/collab/src/lib.rs
index 84c8fb0c2f6..25337fe3fa0 100644
--- a/crates/collab/src/lib.rs
+++ b/crates/collab/src/lib.rs
@@ -12,7 +12,7 @@ use axum::{
http::{HeaderMap, StatusCode},
response::IntoResponse,
};
-use db::{ChannelId, Database};
+use db::Database;
use executor::Executor;
use serde::Deserialize;
use std::{path::PathBuf, sync::Arc};
@@ -115,18 +115,12 @@ impl std::error::Error for Error {}
pub struct Config {
pub http_port: u16,
pub database_url: String,
- pub migrations_path: Option<PathBuf>,
pub seed_path: Option<PathBuf>,
pub database_max_connections: u32,
pub api_token: String,
- pub invite_link_prefix: String,
pub livekit_server: Option<String>,
pub livekit_key: Option<String>,
pub livekit_secret: Option<String>,
- pub llm_database_url: Option<String>,
- pub llm_database_max_connections: Option<u32>,
- pub llm_database_migrations_path: Option<PathBuf>,
- pub llm_api_secret: Option<String>,
pub rust_log: Option<String>,
pub log_json: Option<bool>,
pub blob_store_url: Option<String>,
@@ -139,17 +133,7 @@ pub struct Config {
pub kinesis_access_key: Option<String>,
pub kinesis_secret_key: Option<String>,
pub zed_environment: Arc<str>,
- pub openai_api_key: Option<Arc<str>>,
- pub google_ai_api_key: Option<Arc<str>>,
- pub anthropic_api_key: Option<Arc<str>>,
- pub anthropic_staff_api_key: Option<Arc<str>>,
- pub llm_closed_beta_model_name: Option<Arc<str>>,
- pub prediction_api_url: Option<Arc<str>>,
- pub prediction_api_key: Option<Arc<str>>,
- pub prediction_model: Option<Arc<str>>,
pub zed_client_checksum_seed: Option<String>,
- pub auto_join_channel_id: Option<ChannelId>,
- pub supermaven_admin_api_key: Option<Arc<str>>,
}
impl Config {
@@ -173,14 +157,9 @@ impl Config {
database_url: "".into(),
database_max_connections: 0,
api_token: "".into(),
- invite_link_prefix: "".into(),
livekit_server: None,
livekit_key: None,
livekit_secret: None,
- llm_database_url: None,
- llm_database_max_connections: None,
- llm_database_migrations_path: None,
- llm_api_secret: None,
rust_log: None,
log_json: None,
zed_environment: "test".into(),
@@ -189,19 +168,8 @@ impl Config {
blob_store_access_key: None,
blob_store_secret_key: None,
blob_store_bucket: None,
- openai_api_key: None,
- google_ai_api_key: None,
- anthropic_api_key: None,
- anthropic_staff_api_key: None,
- llm_closed_beta_model_name: None,
- prediction_api_url: None,
- prediction_api_key: None,
- prediction_model: None,
zed_client_checksum_seed: None,
- auto_join_channel_id: None,
- migrations_path: None,
seed_path: None,
- supermaven_admin_api_key: None,
kinesis_region: None,
kinesis_access_key: None,
kinesis_secret_key: None,
diff --git a/crates/collab/tests/integration/test_server.rs b/crates/collab/tests/integration/test_server.rs
index f28d247f67a..a731a8ae1d5 100644
--- a/crates/collab/tests/integration/test_server.rs
+++ b/crates/collab/tests/integration/test_server.rs
@@ -573,14 +573,9 @@ impl TestServer {
database_url: "".into(),
database_max_connections: 0,
api_token: "".into(),
- invite_link_prefix: "".into(),
livekit_server: None,
livekit_key: None,
livekit_secret: None,
- llm_database_url: None,
- llm_database_max_connections: None,
- llm_database_migrations_path: None,
- llm_api_secret: None,
rust_log: None,
log_json: None,
zed_environment: "test".into(),
@@ -589,19 +584,8 @@ impl TestServer {
blob_store_access_key: None,
blob_store_secret_key: None,
blob_store_bucket: None,
- openai_api_key: None,
- google_ai_api_key: None,
- anthropic_api_key: None,
- anthropic_staff_api_key: None,
- llm_closed_beta_model_name: None,
- prediction_api_url: None,
- prediction_api_key: None,
- prediction_model: None,
zed_client_checksum_seed: None,
- auto_join_channel_id: None,
- migrations_path: None,
seed_path: None,
- supermaven_admin_api_key: None,
kinesis_region: None,
kinesis_stream: None,
kinesis_access_key: None,