Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions cli/src/cli_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,6 @@ pub enum ConfigSubcommand {

#[arg(long, value_enum)]
log_level: Option<LogLevel>,

#[arg(long)]
timeout_ms: Option<u64>,
},

#[command(about = "Validate config files and report pass/fail with errors or warnings")]
Expand All @@ -289,9 +286,6 @@ pub enum ConfigSubcommand {

#[arg(long, value_enum)]
log_level: Option<LogLevel>,

#[arg(long)]
timeout_ms: Option<u64>,
},
}

Expand Down
1 change: 0 additions & 1 deletion cli/src/services/command_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ pub fn default_runtime_command(name: &str) -> Option<RuntimeCommand> {
report_format: services::config::ReportFormat::Text,
config_path: None,
log_level: None,
timeout_ms: None,
},
),
},
Expand Down
10 changes: 0 additions & 10 deletions cli/src/services/config/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ pub(super) fn format_show_output(runtime: &RuntimeConfig, report_format: ReportF
style::value(PRECEDENCE_DESCRIPTION)
),
format_config_paths_text(runtime),
format_resolved_value_text(
"timeout_ms",
&runtime.timeout_ms.value.to_string(),
runtime.timeout_ms.source,
),
format_optional_auth_resolved_value_text(
WORKOS_CLIENT_ID_KEY,
&runtime.workos_client_id,
Expand Down Expand Up @@ -86,11 +81,6 @@ pub(super) fn format_show_output(runtime: &RuntimeConfig, report_format: ReportF
runtime.log_file_retention_limit.value,
runtime.log_file_retention_limit.source,
),
"timeout_ms": {
"value": runtime.timeout_ms.value,
"source": runtime.timeout_ms.source.as_str(),
"config_source": runtime.timeout_ms.source.config_source().map(ConfigPathSource::as_str),
},
"workos_client_id": format_optional_auth_resolved_value_json(WORKOS_CLIENT_ID_KEY, &runtime.workos_client_id),
"control_plane_base_url": format_optional_auth_resolved_value_json(CONTROL_PLANE_BASE_URL_KEY, &runtime.control_plane_base_url),
"agent_trace": {
Expand Down
41 changes: 0 additions & 41 deletions cli/src/services/config/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use super::types::{
ENV_ATTRIBUTION_HOOKS_DISABLED, ENV_LOG_DIR, ENV_LOG_FORMAT, ENV_LOG_LEVEL,
};

const DEFAULT_TIMEOUT_MS: u64 = 30000;
pub(crate) const DEFAULT_AGENT_TRACE_REPOSITORY_REMOTE: &str = "origin";
pub(crate) const PRECEDENCE_DESCRIPTION: &str = "flags > env > config file > defaults";
const WORKOS_CLIENT_ID_ENV: &str = "WORKOS_CLIENT_ID";
Expand Down Expand Up @@ -73,7 +72,6 @@ pub(super) struct RuntimeConfig {
pub(super) log_to_file: ResolvedValue<bool>,
pub(super) log_dir: ResolvedOptionalValue<String>,
pub(super) log_file_retention_limit: ResolvedValue<usize>,
pub(super) timeout_ms: ResolvedValue<u64>,
pub(super) attribution_hooks_enabled: ResolvedValue<bool>,
pub(super) workos_client_id: ResolvedOptionalValue<String>,
pub(super) control_plane_base_url: ResolvedOptionalValue<String>,
Expand Down Expand Up @@ -135,7 +133,6 @@ pub(crate) fn resolve_agent_trace_auto_sync_runtime_config(
report_format: ReportFormat::Text,
config_path: None,
log_level: None,
timeout_ms: None,
},
cwd,
|key| std::env::var(key).ok(),
Expand Down Expand Up @@ -182,7 +179,6 @@ where
report_format: ReportFormat::Text,
config_path: None,
log_level: None,
timeout_ms: None,
},
cwd,
env_lookup,
Expand Down Expand Up @@ -210,7 +206,6 @@ pub(crate) fn resolve_bash_policy_runtime_config(cwd: &Path) -> Result<Option<Ba
report_format: ReportFormat::Text,
config_path: None,
log_level: None,
timeout_ms: None,
},
cwd,
|key| std::env::var(key).ok(),
Expand Down Expand Up @@ -242,7 +237,6 @@ where
report_format: ReportFormat::Text,
config_path: None,
log_level: None,
timeout_ms: None,
},
cwd,
env_lookup,
Expand Down Expand Up @@ -274,7 +268,6 @@ where
report_format: ReportFormat::Text,
config_path: None,
log_level: None,
timeout_ms: None,
},
cwd,
env_lookup,
Expand Down Expand Up @@ -311,7 +304,6 @@ where
report_format: ReportFormat::Text,
config_path: None,
log_level: None,
timeout_ms: None,
},
cwd,
env_lookup,
Expand Down Expand Up @@ -368,7 +360,6 @@ where
log_to_file: None,
log_dir: None,
log_file_retention_limit: None,
timeout_ms: None,
attribution_hooks_enabled: None,
workos_client_id: None,
control_plane_base_url: None,
Expand Down Expand Up @@ -406,9 +397,6 @@ where
if let Some(log_file_retention_limit) = layer.log_file_retention_limit {
file_config.log_file_retention_limit = Some(log_file_retention_limit);
}
if let Some(timeout_ms) = layer.timeout_ms {
file_config.timeout_ms = Some(timeout_ms);
}
if let Some(attribution_hooks_enabled) = layer.attribution_hooks_enabled {
file_config.attribution_hooks_enabled = Some(attribution_hooks_enabled);
}
Expand Down Expand Up @@ -517,32 +505,6 @@ where
},
};

let mut resolved_timeout_ms = ResolvedValue {
value: DEFAULT_TIMEOUT_MS,
source: ValueSource::Default,
};
if let Some(value) = file_config.timeout_ms {
resolved_timeout_ms = ResolvedValue {
value: value.value,
source: ValueSource::ConfigFile(value.source),
};
}
if let Some(raw) = env_lookup("SCE_TIMEOUT_MS") {
let value = raw
.parse::<u64>()
.map_err(|_| anyhow!("Invalid timeout '{raw}' from SCE_TIMEOUT_MS."))?;
resolved_timeout_ms = ResolvedValue {
value,
source: ValueSource::Env,
};
}
if let Some(value) = request.timeout_ms {
resolved_timeout_ms = ResolvedValue {
value,
source: ValueSource::Flag,
};
}

let mut resolved_attribution_hooks_enabled = ResolvedValue {
value: true,
source: ValueSource::Default,
Expand Down Expand Up @@ -623,7 +585,6 @@ where
log_to_file: resolved_log_to_file,
log_dir: resolved_log_dir,
log_file_retention_limit: resolved_log_file_retention_limit,
timeout_ms: resolved_timeout_ms,
attribution_hooks_enabled: resolved_attribution_hooks_enabled,
workos_client_id: resolved_workos_client_id,
control_plane_base_url: resolved_control_plane_base_url,
Expand Down Expand Up @@ -786,7 +747,6 @@ pub(crate) fn init_database_retry_config_from_environment(cwd: &Path) {
report_format: ReportFormat::Text,
config_path: None,
log_level: None,
timeout_ms: None,
},
cwd,
) {
Expand Down Expand Up @@ -815,7 +775,6 @@ mod tests {
report_format: ReportFormat::Text,
config_path: None,
log_level: None,
timeout_ms: None,
}
}

Expand Down
9 changes: 1 addition & 8 deletions cli/src/services/config/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pub(crate) const TOP_LEVEL_CONFIG_KEYS: &[&str] = &[
"log_to_file",
"log_dir",
"log_file_retention_limit",
"timeout_ms",
super::resolver::WORKOS_CLIENT_ID_KEY.config_key,
super::resolver::CONTROL_PLANE_BASE_URL_KEY.config_key,
"agent_trace",
Expand All @@ -46,7 +45,7 @@ pub(crate) const TOP_LEVEL_CONFIG_KEYS: &[&str] = &[
];

pub(crate) const TOP_LEVEL_CONFIG_KEYS_DESCRIPTION: &str =
"$schema, log_level, log_format, log_to_file, timeout_ms, workos_client_id, control_plane_base_url, agent_trace, policies, integrations, log_dir, log_file_retention_limit";
"$schema, log_level, log_format, log_to_file, workos_client_id, control_plane_base_url, agent_trace, policies, integrations, log_dir, log_file_retention_limit";

static CONFIG_SCHEMA_VALIDATOR: OnceLock<Validator> = OnceLock::new();

Expand Down Expand Up @@ -75,7 +74,6 @@ pub(crate) struct ParsedFileConfigDocument {
pub(crate) log_to_file: Option<bool>,
pub(crate) log_dir: Option<String>,
pub(crate) log_file_retention_limit: Option<usize>,
pub(crate) timeout_ms: Option<u64>,
pub(crate) workos_client_id: Option<String>,
pub(crate) control_plane_base_url: Option<String>,
pub(crate) agent_trace: Option<ParsedAgentTraceConfigDocument>,
Expand Down Expand Up @@ -163,7 +161,6 @@ pub(crate) struct FileConfig {
pub(crate) log_to_file: Option<FileConfigValue<bool>>,
pub(crate) log_dir: Option<FileConfigValue<String>>,
pub(crate) log_file_retention_limit: Option<FileConfigValue<usize>>,
pub(crate) timeout_ms: Option<FileConfigValue<u64>>,
pub(crate) attribution_hooks_enabled: Option<FileConfigValue<bool>>,
pub(crate) workos_client_id: Option<FileConfigValue<String>>,
pub(crate) control_plane_base_url: Option<FileConfigValue<String>>,
Expand Down Expand Up @@ -312,9 +309,6 @@ pub(crate) fn parse_file_config(
let log_file_retention_limit = typed
.log_file_retention_limit
.map(|value| FileConfigValue { value, source });
let timeout_ms = typed
.timeout_ms
.map(|value| FileConfigValue { value, source });
let workos_client_id = typed
.workos_client_id
.map(|value| FileConfigValue { value, source });
Expand All @@ -333,7 +327,6 @@ pub(crate) fn parse_file_config(
log_to_file,
log_dir,
log_file_retention_limit,
timeout_ms,
attribution_hooks_enabled,
workos_client_id,
control_plane_base_url,
Expand Down
1 change: 0 additions & 1 deletion cli/src/services/config/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ pub struct ConfigRequest {
pub report_format: ReportFormat,
pub config_path: Option<PathBuf>,
pub log_level: Option<LogLevel>,
pub timeout_ms: Option<u64>,
}

#[derive(Clone, Debug, Eq, PartialEq)]
Expand Down
4 changes: 0 additions & 4 deletions cli/src/services/parse/command_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,13 @@ fn convert_config_subcommand(
format,
config,
log_level,
timeout_ms,
} => Ok(RuntimeCommand::Config(
services::config::command::ConfigCommand {
subcommand: services::config::ConfigSubcommand::Show(
services::config::ConfigRequest {
report_format: format,
config_path: config,
log_level,
timeout_ms,
},
),
},
Expand All @@ -369,15 +367,13 @@ fn convert_config_subcommand(
format,
config,
log_level,
timeout_ms,
} => Ok(RuntimeCommand::Config(
services::config::command::ConfigCommand {
subcommand: services::config::ConfigSubcommand::Validate(
services::config::ConfigRequest {
report_format: format,
config_path: config,
log_level,
timeout_ms,
},
),
},
Expand Down
Loading
Loading