feat: Warn and continue on unknown feature requirements#19038
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbaf2f5bcc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let Some(feature) = feature_for_key(&key) { | ||
| return Err(std::io::Error::new( | ||
| std::io::ErrorKind::InvalidData, | ||
| push_feature_requirement_warning( | ||
| &mut startup_warnings, | ||
| format!( | ||
| "invalid `features` requirement `{key}` from {source}: use canonical feature key `{}`", | ||
| "Using legacy `features` requirement `{key}` from {source}; prefer canonical feature key `{}`", | ||
| feature.key() | ||
| ), | ||
| )); | ||
| ); | ||
| pinned_features.insert(feature, enabled); | ||
| continue; |
There was a problem hiding this comment.
Detect conflicting canonical and legacy requirement keys
parse_feature_requirements now accepts legacy aliases and unconditionally inserts them into pinned_features. If a managed requirements payload includes both canonical and legacy keys for the same feature with different values, whichever key sorts later silently overrides the other. This can invert enforced feature requirements (policy bypass) while only logging a warning.
Useful? React with 👍 / 👎.
Requirements feature flags now fail open like config feature flags, but with a startup warning.