5656# NOTE: to mark a plugin as a DEV-FEATURE annotated it with
5757# `Field(json_schema_extra={_X_DEV_FEATURE_FLAG: True})`
5858# This will force it to be disabled when WEBSERVER_DEV_FEATURES_ENABLED=False
59- _X_DEV_FEATURE_FLAG : Final [str ] = "x-dev-feature"
59+ _X_FEATURE_UNDER_DEVELOPMENT : Final [str ] = "x-dev-feature"
6060
6161
6262class ApplicationSettings (BaseApplicationSettings , MixinLoggingSettings ):
@@ -108,10 +108,9 @@ class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
108108 WEBSERVER_FUNCTIONS : Annotated [
109109 bool ,
110110 Field (
111- validation_alias = AliasChoices ("WEBSERVER_FUNCTIONS" ),
112- json_schema_extra = {_X_DEV_FEATURE_FLAG : True },
111+ json_schema_extra = {_X_FEATURE_UNDER_DEVELOPMENT : True },
113112 ),
114- ] = False
113+ ] = True
115114
116115 WEBSERVER_LOGLEVEL : Annotated [
117116 LogLevel ,
@@ -406,8 +405,8 @@ def _build_vcs_release_url_if_unset(cls, values):
406405
407406 @model_validator (mode = "before" )
408407 @classmethod
409- def _enable_only_if_dev_features_allowed (cls , data : Any ) -> Any :
410- """Force disables plugins marked 'under development ' when WEBSERVER_DEV_FEATURES_ENABLED=False"""
408+ def _disable_features_under_development_in_production (cls , data : Any ) -> Any :
409+ """Force disables plugins marked '_X_FEATURE_UNDER_DEVELOPMENT ' when WEBSERVER_DEV_FEATURES_ENABLED=False"""
411410
412411 dev_features_allowed = TypeAdapter (bool ).validate_python (
413412 data .get ("WEBSERVER_DEV_FEATURES_ENABLED" , False )
@@ -423,7 +422,8 @@ def _enable_only_if_dev_features_allowed(cls, data: Any) -> Any:
423422 field .json_schema_extra (json_schema )
424423
425424 assert isinstance (json_schema , dict ) # nosec
426- if json_schema .get (_X_DEV_FEATURE_FLAG ):
425+ if json_schema .get (_X_FEATURE_UNDER_DEVELOPMENT ):
426+ assert not dev_features_allowed # nosec
427427 _logger .warning (
428428 "'%s' is still under development and will be forcibly disabled [WEBSERVER_DEV_FEATURES_ENABLED=%s]." ,
429429 field_name ,
0 commit comments