Skip to content

Commit f8a1b67

Browse files
committed
Remove useless disable_file parameter for ClientConfig.load
1 parent cd07caa commit f8a1b67

File tree

3 files changed

+8
-23
lines changed

3 files changed

+8
-23
lines changed

temporalio/ext/src/envconfig.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,14 @@ fn load_client_config_inner(
117117
ruby: &Ruby,
118118
config_source: Option<DataSource>,
119119
config_file_strict: bool,
120-
disable_file: bool,
121120
env_vars: Option<HashMap<String, String>>,
122121
) -> Result<RHash, Error> {
123-
let core_config = if disable_file {
124-
CoreClientConfig::default()
125-
} else {
126-
let options = LoadClientConfigOptions {
127-
config_source,
128-
config_file_strict,
129-
};
130-
core_load_client_config(options, env_vars.as_ref())
131-
.map_err(|e| error!("EnvConfig error: {}", e))?
122+
let options = LoadClientConfigOptions {
123+
config_source,
124+
config_file_strict,
132125
};
126+
let core_config = core_load_client_config(options, env_vars.as_ref())
127+
.map_err(|e| error!("EnvConfig error: {}", e))?;
133128

134129
core_config_to_hash(ruby, &core_config)
135130
}
@@ -157,18 +152,18 @@ fn load_client_connect_config_inner(
157152
profile_to_hash(ruby, &profile)
158153
}
159154

160-
// load_client_config(path: String|nil, data: String|nil, disable_file: bool, config_file_strict: bool, env_vars: Hash|nil)
155+
// load_client_config(path: String|nil, data: String|nil, config_file_strict: bool, env_vars: Hash|nil)
161156
fn load_client_config(args: &[magnus::Value]) -> Result<RHash, Error> {
162157
let ruby = Ruby::get().expect("Not in Ruby thread");
163158
let args = scan_args::scan_args::<
164-
(Option<String>, Option<RString>, bool, bool),
159+
(Option<String>, Option<RString>, bool),
165160
(Option<HashMap<String, String>>,),
166161
(),
167162
(),
168163
(),
169164
(),
170165
>(args)?;
171-
let (path, data, disable_file, config_file_strict) = args.required;
166+
let (path, data, config_file_strict) = args.required;
172167
let (env_vars,) = args.optional;
173168

174169
let config_source = match (path, data) {
@@ -189,7 +184,6 @@ fn load_client_config(args: &[magnus::Value]) -> Result<RHash, Error> {
189184
&ruby,
190185
config_source,
191186
config_file_strict,
192-
disable_file,
193187
env_vars,
194188
)
195189
}

temporalio/lib/temporalio/env_config.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,11 @@ def self.from_h(hash)
254254
# (TEMPORAL_CONFIG_FILE).
255255
#
256256
# @param config_source [Pathname, String, nil] Configuration source
257-
# @param disable_file [Boolean] If true, file loading is disabled
258257
# @param config_file_strict [Boolean] If true, will error on unrecognized keys
259258
# @param override_env_vars [Hash, nil] Environment variables to use
260259
# @return [ClientConfig] The client configuration
261260
def self.load(
262261
config_source: nil,
263-
disable_file: false,
264262
config_file_strict: false,
265263
override_env_vars: nil
266264
)
@@ -269,7 +267,6 @@ def self.load(
269267
loaded_profiles = Internal::Bridge::EnvConfig.load_client_config(
270268
path,
271269
data,
272-
disable_file,
273270
config_file_strict,
274271
override_env_vars || {}
275272
)

temporalio/test/envconfig_test.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,6 @@ def test_load_profiles_discovery
336336
end
337337
end
338338

339-
def test_load_profiles_disable_file
340-
# With no env vars, should be empty
341-
client_config = Temporalio::EnvConfig::ClientConfig.load(disable_file: true, override_env_vars: {})
342-
assert_empty client_config.profiles
343-
end
344-
345339
def test_default_profile_not_found_returns_empty_profile
346340
toml = <<~TOML
347341
[profile.existing]

0 commit comments

Comments
 (0)