diff --git a/.env.example b/.env.example index c1cb9c5..ff6c9de 100644 --- a/.env.example +++ b/.env.example @@ -26,9 +26,7 @@ FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON= # Optional Google Voice/SMS channel for escalated strategy plugin alerts. CRISIS_ALERT_GOOGLE_VOICE_TO= -CRISIS_ALERT_EMAIL_TO= CRISIS_ALERT_SMTP_FROM= -CRISIS_ALERT_EMAIL_FROM= CRISIS_ALERT_SMTP_HOST= CRISIS_ALERT_SMTP_PORT=587 CRISIS_ALERT_SMTP_USERNAME= diff --git a/.github/workflows/sync-cloud-run-env.yml b/.github/workflows/sync-cloud-run-env.yml index 22f5e23..edeec2f 100644 --- a/.github/workflows/sync-cloud-run-env.yml +++ b/.github/workflows/sync-cloud-run-env.yml @@ -62,9 +62,7 @@ jobs: FIRSTRADE_STRATEGY_CONFIG_PATH: ${{ vars.FIRSTRADE_STRATEGY_CONFIG_PATH }} FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON: ${{ vars.FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON }} CRISIS_ALERT_GOOGLE_VOICE_TO: ${{ vars.CRISIS_ALERT_GOOGLE_VOICE_TO }} - CRISIS_ALERT_EMAIL_TO: ${{ vars.CRISIS_ALERT_EMAIL_TO }} CRISIS_ALERT_SMTP_FROM: ${{ vars.CRISIS_ALERT_SMTP_FROM }} - CRISIS_ALERT_EMAIL_FROM: ${{ vars.CRISIS_ALERT_EMAIL_FROM }} CRISIS_ALERT_SMTP_HOST: ${{ vars.CRISIS_ALERT_SMTP_HOST }} CRISIS_ALERT_SMTP_PORT: ${{ vars.CRISIS_ALERT_SMTP_PORT }} CRISIS_ALERT_SMTP_USERNAME: ${{ vars.CRISIS_ALERT_SMTP_USERNAME }} @@ -436,9 +434,7 @@ jobs: add_optional_env FIRSTRADE_STRATEGY_CONFIG_PATH add_optional_env FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON add_optional_env CRISIS_ALERT_GOOGLE_VOICE_TO - add_optional_env CRISIS_ALERT_EMAIL_TO add_optional_env CRISIS_ALERT_SMTP_FROM - add_optional_env CRISIS_ALERT_EMAIL_FROM add_optional_env CRISIS_ALERT_SMTP_HOST add_optional_env CRISIS_ALERT_SMTP_PORT add_optional_env CRISIS_ALERT_SMTP_USERNAME diff --git a/README.md b/README.md index 89bf8af..d745eda 100644 --- a/README.md +++ b/README.md @@ -86,9 +86,7 @@ commit credentials. | `GLOBAL_TELEGRAM_CHAT_ID` | Optional | Telegram chat ID for strategy-cycle summaries | | `FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON` | Optional | JSON sidecar plugin mount config. Overrides global `STRATEGY_PLUGIN_MOUNTS_JSON` for this platform | | `CRISIS_ALERT_GOOGLE_VOICE_TO` | Optional | Google Voice SMS gateway recipients, usually ending in `@txt.voice.google.com` | -| `CRISIS_ALERT_EMAIL_TO` | Optional | Ordinary email recipients that receive the same escalated alert; also accepted as a legacy recipient list | -| `CRISIS_ALERT_SMTP_FROM` | Optional | SMTP sender address for Google Voice alerts; falls back to `CRISIS_ALERT_EMAIL_FROM` | -| `CRISIS_ALERT_EMAIL_FROM` | Optional | Legacy SMTP sender alias; prefer `CRISIS_ALERT_SMTP_FROM` | +| `CRISIS_ALERT_SMTP_FROM` | Optional | SMTP sender address for Google Voice alerts | | `CRISIS_ALERT_SMTP_HOST` | Optional | SMTP host for Google Voice alerts | | `CRISIS_ALERT_SMTP_PORT` | Optional | SMTP port. Defaults to `587` | | `CRISIS_ALERT_SMTP_USERNAME` | Optional | SMTP username when authentication is required | diff --git a/pyproject.toml b/pyproject.toml index be90fb1..22d1f6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,8 +14,8 @@ authors = [ ] dependencies = [ "firstrade==0.0.38", - "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@8ed13d9122f52c35425b0802d22467bb6664dcd3", - "us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@e89ea43181f687d3454636b4b2d99ab7771546f4", + "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@8e87e70d49487bc6d96587d5f9e9850727e9817b", + "us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@fe9cc27b608ab18592b338519a5b0826f73e9a80", "google-cloud-storage", "requests", ] diff --git a/requirements.txt b/requirements.txt index a033cbd..19be69e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ flask gunicorn firstrade==0.0.38 -quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@8ed13d9122f52c35425b0802d22467bb6664dcd3 -us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@e89ea43181f687d3454636b4b2d99ab7771546f4 +quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@8e87e70d49487bc6d96587d5f9e9850727e9817b +us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@fe9cc27b608ab18592b338519a5b0826f73e9a80 google-cloud-storage requests pytest diff --git a/runtime_config_support.py b/runtime_config_support.py index 380c73d..8e75c44 100644 --- a/runtime_config_support.py +++ b/runtime_config_support.py @@ -60,8 +60,6 @@ class PlatformRuntimeSettings: strategy_plugin_mounts_json: str | None = None crisis_alert_google_voice_to: tuple[str, ...] = () crisis_alert_smtp_from: str | None = None - crisis_alert_email_to: tuple[str, ...] = () - crisis_alert_email_from: str | None = None crisis_alert_smtp_host: str | None = None crisis_alert_smtp_port: int = 587 crisis_alert_smtp_username: str | None = None @@ -156,12 +154,7 @@ def load_platform_runtime_settings( or os.getenv("STRATEGY_PLUGIN_MOUNTS_JSON") ), crisis_alert_google_voice_to=_split_env_list(os.getenv("CRISIS_ALERT_GOOGLE_VOICE_TO")), - crisis_alert_smtp_from=_first_non_empty( - os.getenv("CRISIS_ALERT_SMTP_FROM"), - os.getenv("CRISIS_ALERT_EMAIL_FROM"), - ), - crisis_alert_email_to=_split_env_list(os.getenv("CRISIS_ALERT_EMAIL_TO")), - crisis_alert_email_from=_first_non_empty(os.getenv("CRISIS_ALERT_EMAIL_FROM")), + crisis_alert_smtp_from=_first_non_empty(os.getenv("CRISIS_ALERT_SMTP_FROM")), crisis_alert_smtp_host=_first_non_empty(os.getenv("CRISIS_ALERT_SMTP_HOST")), crisis_alert_smtp_port=_resolve_positive_int_env("CRISIS_ALERT_SMTP_PORT", default=587), crisis_alert_smtp_username=_first_non_empty(os.getenv("CRISIS_ALERT_SMTP_USERNAME")), diff --git a/tests/test_rebalance_service.py b/tests/test_rebalance_service.py index a03907c..5cc742c 100644 --- a/tests/test_rebalance_service.py +++ b/tests/test_rebalance_service.py @@ -228,8 +228,8 @@ def test_run_strategy_cycle_loads_strategy_plugin_report_and_sends_email( ) settings = _runtime_settings_with_persistence( strategy_plugin_mounts_json=mount_config, - crisis_alert_email_to=("risk@example.com",), - crisis_alert_email_from="bot@example.com", + crisis_alert_google_voice_to=("gateway@txt.voice.google.com",), + crisis_alert_smtp_from="bot@example.com", crisis_alert_smtp_host="smtp.example.com", ) messages = [] diff --git a/tests/test_runtime_config_support.py b/tests/test_runtime_config_support.py index 9062d3c..17c2508 100644 --- a/tests/test_runtime_config_support.py +++ b/tests/test_runtime_config_support.py @@ -55,7 +55,6 @@ def test_reserved_cash_policy_defaults_to_zero(monkeypatch): assert settings.reserved_cash_ratio == 0.0 assert settings.crisis_alert_google_voice_to == () assert settings.crisis_alert_smtp_from is None - assert settings.crisis_alert_email_to == () assert settings.crisis_alert_smtp_port == 587 assert settings.crisis_alert_smtp_starttls is True assert settings.crisis_alert_smtp_ssl is False @@ -75,9 +74,7 @@ def test_reserved_cash_policy_loads_from_env(monkeypatch): def test_crisis_alert_google_voice_settings_load_from_env(monkeypatch): monkeypatch.setenv("RUNTIME_TARGET_JSON", _target_json()) monkeypatch.setenv("CRISIS_ALERT_GOOGLE_VOICE_TO", "gateway@txt.voice.google.com") - monkeypatch.setenv("CRISIS_ALERT_EMAIL_TO", "risk@example.com;ops@example.com,risk@example.com") monkeypatch.setenv("CRISIS_ALERT_SMTP_FROM", "smtp-from@example.com") - monkeypatch.setenv("CRISIS_ALERT_EMAIL_FROM", "bot@example.com") monkeypatch.setenv("CRISIS_ALERT_SMTP_HOST", "smtp.example.com") monkeypatch.setenv("CRISIS_ALERT_SMTP_PORT", "465") monkeypatch.setenv("CRISIS_ALERT_SMTP_USERNAME", "bot") @@ -89,8 +86,6 @@ def test_crisis_alert_google_voice_settings_load_from_env(monkeypatch): assert settings.crisis_alert_google_voice_to == ("gateway@txt.voice.google.com",) assert settings.crisis_alert_smtp_from == "smtp-from@example.com" - assert settings.crisis_alert_email_to == ("risk@example.com", "ops@example.com") - assert settings.crisis_alert_email_from == "bot@example.com" assert settings.crisis_alert_smtp_host == "smtp.example.com" assert settings.crisis_alert_smtp_port == 465 assert settings.crisis_alert_smtp_username == "bot" diff --git a/tests/test_sync_cloud_run_env_workflow.py b/tests/test_sync_cloud_run_env_workflow.py index d3aa499..21014c4 100644 --- a/tests/test_sync_cloud_run_env_workflow.py +++ b/tests/test_sync_cloud_run_env_workflow.py @@ -9,9 +9,7 @@ def test_sync_cloud_run_env_workflow_syncs_crisis_alert_settings(): for name in ( "CRISIS_ALERT_GOOGLE_VOICE_TO", - "CRISIS_ALERT_EMAIL_TO", "CRISIS_ALERT_SMTP_FROM", - "CRISIS_ALERT_EMAIL_FROM", "CRISIS_ALERT_SMTP_HOST", "CRISIS_ALERT_SMTP_PORT", "CRISIS_ALERT_SMTP_USERNAME",