Skip to content

Commit 606784f

Browse files
committed
[ACTP] address review feedback on launch config and idle timeout docs
Treat an empty PAR boolean environment variable as unset so it falls back to YAML or the default instead of aborting startup, matching how the fleet dir and log level are already resolved. Correct the idle_timeout_seconds description: the executor now self-terminates after exactly this many seconds, not three times as many.
1 parent eae352d commit 606784f

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

pkg/config/schema/yaml/private_action_runner.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ properties:
122122
type: integer
123123
default: 60
124124
description: |-
125-
Sets the split-mode control plane's executor idle timeout in seconds. The
126-
executor uses three times this value as a self-termination watchdog;
127-
values of zero or less disable the watchdog.
125+
Sets the split-mode executor's idle timeout in seconds. The executor
126+
self-terminates after this much time without activity; values of zero or
127+
less disable the watchdog.
128128
log_file:
129129
node_type: setting
130130
type: string

pkg/privateactionrunner/par-control/src/config.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn resolve_bool(
140140
if fleet_value.is_some() {
141141
return Ok(fleet_value);
142142
}
143-
let Some(raw) = env(name) else {
143+
let Some(raw) = env(name).filter(|value| !value.is_empty()) else {
144144
return Ok(yaml_value);
145145
};
146146
let value = match raw.trim() {
@@ -195,6 +195,23 @@ mod tests {
195195
assert_eq!(launch.log_level, log::LevelFilter::Trace);
196196
}
197197

198+
#[test]
199+
fn empty_environment_overrides_fall_back_to_yaml() {
200+
let env = |name: &str| match name {
201+
"DD_PRIVATE_ACTION_RUNNER_ENABLED"
202+
| "DD_PRIVATE_ACTION_RUNNER_SPLIT_ENABLED"
203+
| "DD_PRIVATE_ACTION_RUNNER_SELF_ENROLL" => Some(String::new()),
204+
_ => None,
205+
};
206+
let launch = Launch::from_yaml_str_with_env(
207+
"private_action_runner:\n enabled: true\n split_enabled: true\n self_enroll: false\n",
208+
env,
209+
)
210+
.unwrap();
211+
assert!(launch.gate.split_mode);
212+
assert!(!launch.gate.self_enroll);
213+
}
214+
198215
#[test]
199216
fn fleet_policy_overrides_local_config_and_environment() {
200217
let dir = tempfile::tempdir().unwrap();

0 commit comments

Comments
 (0)