Skip to content

Commit 01817e5

Browse files
authored
Merge pull request #27 from QuantStrategyLab/remove-googlevoice-legacy-aliases
Remove legacy crisis alert email config
2 parents cfd5551 + 8b2396c commit 01817e5

9 files changed

Lines changed: 8 additions & 30 deletions

.env.example

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON=
2626

2727
# Optional Google Voice/SMS channel for escalated strategy plugin alerts.
2828
CRISIS_ALERT_GOOGLE_VOICE_TO=
29-
CRISIS_ALERT_EMAIL_TO=
3029
CRISIS_ALERT_SMTP_FROM=
31-
CRISIS_ALERT_EMAIL_FROM=
3230
CRISIS_ALERT_SMTP_HOST=
3331
CRISIS_ALERT_SMTP_PORT=587
3432
CRISIS_ALERT_SMTP_USERNAME=

.github/workflows/sync-cloud-run-env.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ jobs:
6262
FIRSTRADE_STRATEGY_CONFIG_PATH: ${{ vars.FIRSTRADE_STRATEGY_CONFIG_PATH }}
6363
FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON: ${{ vars.FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON }}
6464
CRISIS_ALERT_GOOGLE_VOICE_TO: ${{ vars.CRISIS_ALERT_GOOGLE_VOICE_TO }}
65-
CRISIS_ALERT_EMAIL_TO: ${{ vars.CRISIS_ALERT_EMAIL_TO }}
6665
CRISIS_ALERT_SMTP_FROM: ${{ vars.CRISIS_ALERT_SMTP_FROM }}
67-
CRISIS_ALERT_EMAIL_FROM: ${{ vars.CRISIS_ALERT_EMAIL_FROM }}
6866
CRISIS_ALERT_SMTP_HOST: ${{ vars.CRISIS_ALERT_SMTP_HOST }}
6967
CRISIS_ALERT_SMTP_PORT: ${{ vars.CRISIS_ALERT_SMTP_PORT }}
7068
CRISIS_ALERT_SMTP_USERNAME: ${{ vars.CRISIS_ALERT_SMTP_USERNAME }}
@@ -436,9 +434,7 @@ jobs:
436434
add_optional_env FIRSTRADE_STRATEGY_CONFIG_PATH
437435
add_optional_env FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON
438436
add_optional_env CRISIS_ALERT_GOOGLE_VOICE_TO
439-
add_optional_env CRISIS_ALERT_EMAIL_TO
440437
add_optional_env CRISIS_ALERT_SMTP_FROM
441-
add_optional_env CRISIS_ALERT_EMAIL_FROM
442438
add_optional_env CRISIS_ALERT_SMTP_HOST
443439
add_optional_env CRISIS_ALERT_SMTP_PORT
444440
add_optional_env CRISIS_ALERT_SMTP_USERNAME

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ commit credentials.
8686
| `GLOBAL_TELEGRAM_CHAT_ID` | Optional | Telegram chat ID for strategy-cycle summaries |
8787
| `FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON` | Optional | JSON sidecar plugin mount config. Overrides global `STRATEGY_PLUGIN_MOUNTS_JSON` for this platform |
8888
| `CRISIS_ALERT_GOOGLE_VOICE_TO` | Optional | Google Voice SMS gateway recipients, usually ending in `@txt.voice.google.com` |
89-
| `CRISIS_ALERT_EMAIL_TO` | Optional | Ordinary email recipients that receive the same escalated alert; also accepted as a legacy recipient list |
90-
| `CRISIS_ALERT_SMTP_FROM` | Optional | SMTP sender address for Google Voice alerts; falls back to `CRISIS_ALERT_EMAIL_FROM` |
91-
| `CRISIS_ALERT_EMAIL_FROM` | Optional | Legacy SMTP sender alias; prefer `CRISIS_ALERT_SMTP_FROM` |
89+
| `CRISIS_ALERT_SMTP_FROM` | Optional | SMTP sender address for Google Voice alerts |
9290
| `CRISIS_ALERT_SMTP_HOST` | Optional | SMTP host for Google Voice alerts |
9391
| `CRISIS_ALERT_SMTP_PORT` | Optional | SMTP port. Defaults to `587` |
9492
| `CRISIS_ALERT_SMTP_USERNAME` | Optional | SMTP username when authentication is required |

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ authors = [
1414
]
1515
dependencies = [
1616
"firstrade==0.0.38",
17-
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@8ed13d9122f52c35425b0802d22467bb6664dcd3",
18-
"us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@e89ea43181f687d3454636b4b2d99ab7771546f4",
17+
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@8e87e70d49487bc6d96587d5f9e9850727e9817b",
18+
"us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@fe9cc27b608ab18592b338519a5b0826f73e9a80",
1919
"google-cloud-storage",
2020
"requests",
2121
]

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
flask
22
gunicorn
33
firstrade==0.0.38
4-
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@8ed13d9122f52c35425b0802d22467bb6664dcd3
5-
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@e89ea43181f687d3454636b4b2d99ab7771546f4
4+
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@8e87e70d49487bc6d96587d5f9e9850727e9817b
5+
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@fe9cc27b608ab18592b338519a5b0826f73e9a80
66
google-cloud-storage
77
requests
88
pytest

runtime_config_support.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ class PlatformRuntimeSettings:
6060
strategy_plugin_mounts_json: str | None = None
6161
crisis_alert_google_voice_to: tuple[str, ...] = ()
6262
crisis_alert_smtp_from: str | None = None
63-
crisis_alert_email_to: tuple[str, ...] = ()
64-
crisis_alert_email_from: str | None = None
6563
crisis_alert_smtp_host: str | None = None
6664
crisis_alert_smtp_port: int = 587
6765
crisis_alert_smtp_username: str | None = None
@@ -156,12 +154,7 @@ def load_platform_runtime_settings(
156154
or os.getenv("STRATEGY_PLUGIN_MOUNTS_JSON")
157155
),
158156
crisis_alert_google_voice_to=_split_env_list(os.getenv("CRISIS_ALERT_GOOGLE_VOICE_TO")),
159-
crisis_alert_smtp_from=_first_non_empty(
160-
os.getenv("CRISIS_ALERT_SMTP_FROM"),
161-
os.getenv("CRISIS_ALERT_EMAIL_FROM"),
162-
),
163-
crisis_alert_email_to=_split_env_list(os.getenv("CRISIS_ALERT_EMAIL_TO")),
164-
crisis_alert_email_from=_first_non_empty(os.getenv("CRISIS_ALERT_EMAIL_FROM")),
157+
crisis_alert_smtp_from=_first_non_empty(os.getenv("CRISIS_ALERT_SMTP_FROM")),
165158
crisis_alert_smtp_host=_first_non_empty(os.getenv("CRISIS_ALERT_SMTP_HOST")),
166159
crisis_alert_smtp_port=_resolve_positive_int_env("CRISIS_ALERT_SMTP_PORT", default=587),
167160
crisis_alert_smtp_username=_first_non_empty(os.getenv("CRISIS_ALERT_SMTP_USERNAME")),

tests/test_rebalance_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ def test_run_strategy_cycle_loads_strategy_plugin_report_and_sends_email(
228228
)
229229
settings = _runtime_settings_with_persistence(
230230
strategy_plugin_mounts_json=mount_config,
231-
crisis_alert_email_to=("risk@example.com",),
232-
crisis_alert_email_from="bot@example.com",
231+
crisis_alert_google_voice_to=("gateway@txt.voice.google.com",),
232+
crisis_alert_smtp_from="bot@example.com",
233233
crisis_alert_smtp_host="smtp.example.com",
234234
)
235235
messages = []

tests/test_runtime_config_support.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def test_reserved_cash_policy_defaults_to_zero(monkeypatch):
5555
assert settings.reserved_cash_ratio == 0.0
5656
assert settings.crisis_alert_google_voice_to == ()
5757
assert settings.crisis_alert_smtp_from is None
58-
assert settings.crisis_alert_email_to == ()
5958
assert settings.crisis_alert_smtp_port == 587
6059
assert settings.crisis_alert_smtp_starttls is True
6160
assert settings.crisis_alert_smtp_ssl is False
@@ -75,9 +74,7 @@ def test_reserved_cash_policy_loads_from_env(monkeypatch):
7574
def test_crisis_alert_google_voice_settings_load_from_env(monkeypatch):
7675
monkeypatch.setenv("RUNTIME_TARGET_JSON", _target_json())
7776
monkeypatch.setenv("CRISIS_ALERT_GOOGLE_VOICE_TO", "gateway@txt.voice.google.com")
78-
monkeypatch.setenv("CRISIS_ALERT_EMAIL_TO", "risk@example.com;ops@example.com,risk@example.com")
7977
monkeypatch.setenv("CRISIS_ALERT_SMTP_FROM", "smtp-from@example.com")
80-
monkeypatch.setenv("CRISIS_ALERT_EMAIL_FROM", "bot@example.com")
8178
monkeypatch.setenv("CRISIS_ALERT_SMTP_HOST", "smtp.example.com")
8279
monkeypatch.setenv("CRISIS_ALERT_SMTP_PORT", "465")
8380
monkeypatch.setenv("CRISIS_ALERT_SMTP_USERNAME", "bot")
@@ -89,8 +86,6 @@ def test_crisis_alert_google_voice_settings_load_from_env(monkeypatch):
8986

9087
assert settings.crisis_alert_google_voice_to == ("gateway@txt.voice.google.com",)
9188
assert settings.crisis_alert_smtp_from == "smtp-from@example.com"
92-
assert settings.crisis_alert_email_to == ("risk@example.com", "ops@example.com")
93-
assert settings.crisis_alert_email_from == "bot@example.com"
9489
assert settings.crisis_alert_smtp_host == "smtp.example.com"
9590
assert settings.crisis_alert_smtp_port == 465
9691
assert settings.crisis_alert_smtp_username == "bot"

tests/test_sync_cloud_run_env_workflow.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ def test_sync_cloud_run_env_workflow_syncs_crisis_alert_settings():
99

1010
for name in (
1111
"CRISIS_ALERT_GOOGLE_VOICE_TO",
12-
"CRISIS_ALERT_EMAIL_TO",
1312
"CRISIS_ALERT_SMTP_FROM",
14-
"CRISIS_ALERT_EMAIL_FROM",
1513
"CRISIS_ALERT_SMTP_HOST",
1614
"CRISIS_ALERT_SMTP_PORT",
1715
"CRISIS_ALERT_SMTP_USERNAME",

0 commit comments

Comments
 (0)