mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
fix: deprecate use_legacy_landlock feature flag (#17971)
## Summary - mark `features.use_legacy_landlock` as a deprecated feature flag - emit a startup deprecation notice when the flag is configured - add feature- and core-level regression coverage for the notice <img width="1288" height="93" alt="Screenshot 2026-04-15 at 11 14 00 PM" src="https://github.com/user-attachments/assets/fffc628b-614c-4521-9374-64e50a269252" /> --------- Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
1 parent
0d0abe839a
commit
2967900d81
3 files changed
+86
-3
No files matched your search
@@ -42,8 +42,8 @@ fn default_enabled_features_are_stable() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn use_legacy_landlock_is_stable_and_disabled_by_default() {
|
||||
assert_eq!(Feature::UseLegacyLandlock.stage(), Stage::Stable);
|
||||
fn use_legacy_landlock_is_deprecated_and_disabled_by_default() {
|
||||
assert_eq!(Feature::UseLegacyLandlock.stage(), Stage::Deprecated);
|
||||
assert_eq!(Feature::UseLegacyLandlock.default_enabled(), false);
|
||||
}
|
||||
|
||||
@@ -166,6 +166,28 @@ fn image_generation_is_stable_and_enabled_by_default() {
|
||||
assert_eq!(Feature::ImageGeneration.default_enabled(), true);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn use_legacy_landlock_config_records_deprecation_notice() {
|
||||
let mut entries = BTreeMap::new();
|
||||
entries.insert("use_legacy_landlock".to_string(), true);
|
||||
|
||||
let mut features = Features::with_defaults();
|
||||
features.apply_map(&entries);
|
||||
|
||||
let usages = features.legacy_feature_usages().collect::<Vec<_>>();
|
||||
assert_eq!(usages.len(), 1);
|
||||
assert_eq!(usages[0].alias, "features.use_legacy_landlock");
|
||||
assert_eq!(usages[0].feature, Feature::UseLegacyLandlock);
|
||||
assert_eq!(
|
||||
usages[0].summary,
|
||||
"`[features].use_legacy_landlock` is deprecated and will be removed soon."
|
||||
);
|
||||
assert_eq!(
|
||||
usages[0].details.as_deref(),
|
||||
Some("Remove this setting to stop opting into the legacy Linux sandbox behavior.")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn image_detail_original_is_a_removed_feature_key() {
|
||||
assert_eq!(
|
||||
|
||||
Reference in new issue
Block a user