fix: align pod feature flag naming
This commit is contained in:
@@ -74,7 +74,7 @@ pub struct FeatureConfigPartial {
|
||||
#[serde(default)]
|
||||
pub web: Option<FeatureFlagConfigPartial>,
|
||||
#[serde(default)]
|
||||
pub pod_management: Option<FeatureFlagConfigPartial>,
|
||||
pub pods: Option<FeatureFlagConfigPartial>,
|
||||
#[serde(default)]
|
||||
pub ticket: Option<TicketFeatureConfigPartial>,
|
||||
#[serde(default)]
|
||||
@@ -87,11 +87,7 @@ impl FeatureConfigPartial {
|
||||
task: merge_option(self.task, other.task, FeatureFlagConfigPartial::merge),
|
||||
memory: merge_option(self.memory, other.memory, FeatureFlagConfigPartial::merge),
|
||||
web: merge_option(self.web, other.web, FeatureFlagConfigPartial::merge),
|
||||
pod_management: merge_option(
|
||||
self.pod_management,
|
||||
other.pod_management,
|
||||
FeatureFlagConfigPartial::merge,
|
||||
),
|
||||
pods: merge_option(self.pods, other.pods, FeatureFlagConfigPartial::merge),
|
||||
ticket: merge_option(self.ticket, other.ticket, TicketFeatureConfigPartial::merge),
|
||||
ticket_orchestration: merge_option(
|
||||
self.ticket_orchestration,
|
||||
@@ -142,10 +138,7 @@ impl From<FeatureConfigPartial> for FeatureConfig {
|
||||
.map(FeatureFlagConfig::from)
|
||||
.unwrap_or_default(),
|
||||
web: value.web.map(FeatureFlagConfig::from).unwrap_or_default(),
|
||||
pod_management: value
|
||||
.pod_management
|
||||
.map(FeatureFlagConfig::from)
|
||||
.unwrap_or_default(),
|
||||
pods: value.pods.map(FeatureFlagConfig::from).unwrap_or_default(),
|
||||
ticket: value
|
||||
.ticket
|
||||
.map(TicketFeatureConfig::from)
|
||||
@@ -198,7 +191,7 @@ impl From<FeatureConfig> for FeatureConfigPartial {
|
||||
task: Some(value.task.into()),
|
||||
memory: Some(value.memory.into()),
|
||||
web: Some(value.web.into()),
|
||||
pod_management: Some(value.pod_management.into()),
|
||||
pods: Some(value.pods.into()),
|
||||
ticket: Some(value.ticket.into()),
|
||||
ticket_orchestration: Some(value.ticket_orchestration.into()),
|
||||
}
|
||||
@@ -1434,7 +1427,7 @@ worker_max_turns = 7
|
||||
assert!(!manifest.feature.task.enabled);
|
||||
assert!(!manifest.feature.memory.enabled);
|
||||
assert!(!manifest.feature.web.enabled);
|
||||
assert!(!manifest.feature.pod_management.enabled);
|
||||
assert!(!manifest.feature.pods.enabled);
|
||||
assert!(!manifest.feature.ticket.enabled);
|
||||
assert!(!manifest.feature.ticket_orchestration.enabled);
|
||||
}
|
||||
@@ -1544,7 +1537,7 @@ enabled = true
|
||||
TicketFeatureAccessConfig::Lifecycle
|
||||
);
|
||||
assert!(manifest.feature.web.enabled);
|
||||
assert!(!manifest.feature.pod_management.enabled);
|
||||
assert!(!manifest.feature.pods.enabled);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -97,7 +97,7 @@ pub struct FeatureConfig {
|
||||
#[serde(default)]
|
||||
pub web: FeatureFlagConfig,
|
||||
#[serde(default)]
|
||||
pub pod_management: FeatureFlagConfig,
|
||||
pub pods: FeatureFlagConfig,
|
||||
#[serde(default)]
|
||||
pub ticket: TicketFeatureConfig,
|
||||
#[serde(default)]
|
||||
@@ -110,7 +110,7 @@ impl Default for FeatureConfig {
|
||||
task: FeatureFlagConfig::disabled(),
|
||||
memory: FeatureFlagConfig::disabled(),
|
||||
web: FeatureFlagConfig::disabled(),
|
||||
pod_management: FeatureFlagConfig::disabled(),
|
||||
pods: FeatureFlagConfig::disabled(),
|
||||
ticket: TicketFeatureConfig::default(),
|
||||
ticket_orchestration: FeatureFlagConfig::disabled(),
|
||||
}
|
||||
|
||||
@@ -1480,7 +1480,7 @@ return profile {
|
||||
task = { enabled = true },
|
||||
memory = { enabled = false },
|
||||
web = { enabled = true },
|
||||
pod_management = { enabled = true },
|
||||
pods = { enabled = true },
|
||||
ticket = { enabled = true, access = "read_only" },
|
||||
ticket_orchestration = { enabled = false },
|
||||
},
|
||||
@@ -1500,7 +1500,7 @@ return profile {
|
||||
assert!(resolved.manifest.feature.task.enabled);
|
||||
assert!(!resolved.manifest.feature.memory.enabled);
|
||||
assert!(resolved.manifest.feature.web.enabled);
|
||||
assert!(resolved.manifest.feature.pod_management.enabled);
|
||||
assert!(resolved.manifest.feature.pods.enabled);
|
||||
assert!(resolved.manifest.feature.ticket.enabled);
|
||||
assert_eq!(
|
||||
resolved.manifest.feature.ticket.access,
|
||||
|
||||
@@ -595,11 +595,11 @@ where
|
||||
// loop's `PodEvent` handler). Expose them only behind the explicit
|
||||
// profile feature and require delegation authority up front so enabling
|
||||
// the surface cannot imply broad child scope by accident.
|
||||
if feature_config.pod_management.enabled {
|
||||
if feature_config.pods.enabled {
|
||||
if spawner_manifest.delegation_scope.allow.is_empty() {
|
||||
return Err(std::io::Error::new(
|
||||
std::io::ErrorKind::InvalidInput,
|
||||
"[feature.pod_management].enabled = true requires non-empty [[delegation_scope.allow]]",
|
||||
"[feature.pods].enabled = true requires non-empty [[delegation_scope.allow]]",
|
||||
));
|
||||
}
|
||||
worker.register_tool(spawn_pod_tool(
|
||||
|
||||
@@ -304,7 +304,7 @@ permission = "write"
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn pod_management_feature_requires_delegation_scope() {
|
||||
async fn pods_feature_requires_delegation_scope() {
|
||||
let manifest = r#"
|
||||
[pod]
|
||||
name = "pod-management-feature-test"
|
||||
@@ -317,7 +317,7 @@ model_id = "test-model"
|
||||
[worker]
|
||||
max_tokens = 100
|
||||
|
||||
[feature.pod_management]
|
||||
[feature.pods]
|
||||
enabled = true
|
||||
|
||||
[[scope.allow]]
|
||||
@@ -331,7 +331,7 @@ permission = "write"
|
||||
assert!(result.is_err());
|
||||
let message = result.err().unwrap().to_string();
|
||||
assert!(
|
||||
message.contains("[feature.pod_management].enabled = true requires non-empty"),
|
||||
message.contains("[feature.pods].enabled = true requires non-empty"),
|
||||
"unexpected error: {message}"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user