Deprecate legacy feature flags, use ALWRITY_ENABLED_FEATURES only
- Remove fallback to ALWRITY_FEATURE_PROFILE, ALWRITY_ROUTER_PROFILE - Primary env var is now ALWRITY_ENABLED_FEATURES (backend) - Primary env var is REACT_APP_ENABLED_FEATURES (frontend) - Add deprecation comments to all get_enabled_features() functions - Update demoMode.ts with clear deprecation notes Usage: ALWRITY_ENABLED_FEATURES=podcast # Podcast only ALWRITY_ENABLED_FEATURES=all # All features (default)
This commit is contained in:
@@ -83,17 +83,16 @@ class RouterManager:
|
||||
|
||||
@staticmethod
|
||||
def get_enabled_features() -> set:
|
||||
"""Get enabled features from environment variable.
|
||||
"""Get enabled features from ALWRITY_ENABLED_FEATURES env var.
|
||||
|
||||
ALWRITY_ENABLED_FEATURES can be:
|
||||
Values:
|
||||
- "all" - enable all features (default)
|
||||
- comma-separated list: "podcast,blog-writer,youtube"
|
||||
- comma-separated: "podcast,blog-writer,youtube"
|
||||
- single feature: "podcast"
|
||||
|
||||
DEPRECATED: ALWRITY_FEATURE_PROFILE, ALWRITY_ROUTER_PROFILE, ALWRITY_FEATURE_TO_ENABLE
|
||||
"""
|
||||
env_value = os.getenv(
|
||||
"ALWRITY_ENABLED_FEATURES",
|
||||
os.getenv("ALWRITY_FEATURE_PROFILE", os.getenv("ALWRITY_ROUTER_PROFILE", "all"))
|
||||
).strip().lower()
|
||||
env_value = os.getenv("ALWRITY_ENABLED_FEATURES", "all").strip().lower()
|
||||
|
||||
if not env_value or env_value == "all":
|
||||
return {"all"}
|
||||
|
||||
@@ -60,17 +60,16 @@ def _env_flag_enabled(*env_names: str) -> bool:
|
||||
|
||||
|
||||
def get_enabled_features() -> set:
|
||||
"""Get enabled features from environment variable.
|
||||
"""Get enabled features from ALWRITY_ENABLED_FEATURES env var.
|
||||
|
||||
ALWRITY_ENABLED_FEATURES can be:
|
||||
Values:
|
||||
- "all" - enable all features (default)
|
||||
- comma-separated list: "podcast,core"
|
||||
- comma-separated: "podcast,core"
|
||||
- single feature: "podcast"
|
||||
|
||||
DEPRECATED: ALWRITY_FEATURE_PROFILE, ALWRITY_ROUTER_PROFILE, ALWRITY_FEATURE_TO_ENABLE
|
||||
"""
|
||||
env_value = os.getenv(
|
||||
"ALWRITY_ENABLED_FEATURES",
|
||||
os.getenv("ALWRITY_FEATURE_PROFILE", os.getenv("ALWRITY_ROUTER_PROFILE", "all"))
|
||||
).strip().lower()
|
||||
env_value = os.getenv("ALWRITY_ENABLED_FEATURES", "all").strip().lower()
|
||||
|
||||
if not env_value or env_value == "all":
|
||||
return {"all"}
|
||||
|
||||
@@ -27,17 +27,16 @@ LINGUISTIC_REQUIRED_FEATURES = {"content_planning", "strategy_copilot", "faceboo
|
||||
|
||||
|
||||
def get_enabled_features() -> set:
|
||||
"""Get enabled features from environment variable.
|
||||
"""Get enabled features from ALWRITY_ENABLED_FEATURES env var.
|
||||
|
||||
ALWRITY_ENABLED_FEATURES can be:
|
||||
Values:
|
||||
- "all" - enable all features (default)
|
||||
- comma-separated list: "podcast,blog-writer,youtube"
|
||||
- comma-separated: "podcast,blog-writer,youtube"
|
||||
- single feature: "podcast"
|
||||
|
||||
DEPRECATED: ALWRITY_FEATURE_PROFILE, ALWRITY_ROUTER_PROFILE, ALWRITY_FEATURE_TO_ENABLE
|
||||
"""
|
||||
env_value = os.getenv(
|
||||
"ALWRITY_ENABLED_FEATURES",
|
||||
os.getenv("ALWRITY_FEATURE_PROFILE", os.getenv("ALWRITY_ROUTER_PROFILE", "all"))
|
||||
).strip().lower()
|
||||
env_value = os.getenv("ALWRITY_ENABLED_FEATURES", "all").strip().lower()
|
||||
|
||||
if not env_value or env_value == "all":
|
||||
return {"all"}
|
||||
@@ -46,7 +45,7 @@ def get_enabled_features() -> set:
|
||||
|
||||
|
||||
def get_active_profile() -> str:
|
||||
"""Legacy function - returns primary profile for backwards compatibility."""
|
||||
"""Legacy function - use get_enabled_features() instead."""
|
||||
enabled = get_enabled_features()
|
||||
if "all" in enabled:
|
||||
return "all"
|
||||
|
||||
Reference in New Issue
Block a user