Skip to content

Commit 1fed953

Browse files
committed
Rename Google Voice config to recipients
1 parent a0e1e0f commit 1fed953

9 files changed

Lines changed: 19 additions & 17 deletions

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ GLOBAL_TELEGRAM_CHAT_ID=
2525
FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON=
2626

2727
# Optional Google Voice/SMS channel for escalated strategy plugin alerts.
28-
CRISIS_ALERT_GOOGLE_VOICE_GATEWAY=
28+
CRISIS_ALERT_GOOGLE_VOICE_RECIPIENTS=
2929
CRISIS_ALERT_GOOGLE_VOICE_GMAIL_USER=
3030
CRISIS_ALERT_GOOGLE_VOICE_GMAIL_APP_PASSWORD=
3131

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
FIRSTRADE_STATE_PREFIX: ${{ vars.FIRSTRADE_STATE_PREFIX }}
6262
FIRSTRADE_STRATEGY_CONFIG_PATH: ${{ vars.FIRSTRADE_STRATEGY_CONFIG_PATH }}
6363
FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON: ${{ vars.FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON }}
64-
CRISIS_ALERT_GOOGLE_VOICE_GATEWAY: ${{ vars.CRISIS_ALERT_GOOGLE_VOICE_GATEWAY }}
64+
CRISIS_ALERT_GOOGLE_VOICE_RECIPIENTS: ${{ vars.CRISIS_ALERT_GOOGLE_VOICE_RECIPIENTS }}
6565
CRISIS_ALERT_GOOGLE_VOICE_GMAIL_USER: ${{ vars.CRISIS_ALERT_GOOGLE_VOICE_GMAIL_USER }}
6666
CRISIS_ALERT_GOOGLE_VOICE_GMAIL_APP_PASSWORD_SECRET_NAME: ${{ vars.CRISIS_ALERT_GOOGLE_VOICE_GMAIL_APP_PASSWORD_SECRET_NAME }}
6767
FIRSTRADE_RUNTIME_EXECUTION_WINDOW_TRADING_DAYS: ${{ vars.FIRSTRADE_RUNTIME_EXECUTION_WINDOW_TRADING_DAYS }}
@@ -371,6 +371,7 @@ jobs:
371371
remove_env_vars=(
372372
"TELEGRAM_CHAT_ID"
373373
"CRISIS_ALERT_GOOGLE_VOICE_TO"
374+
"CRISIS_ALERT_GOOGLE_VOICE_GATEWAY"
374375
"CRISIS_ALERT_SMTP_FROM"
375376
"CRISIS_ALERT_SMTP_HOST"
376377
"CRISIS_ALERT_SMTP_PORT"
@@ -436,7 +437,7 @@ jobs:
436437
add_optional_env FIRSTRADE_FEATURE_SNAPSHOT_MANIFEST_PATH
437438
add_optional_env FIRSTRADE_STRATEGY_CONFIG_PATH
438439
add_optional_env FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON
439-
add_optional_env CRISIS_ALERT_GOOGLE_VOICE_GATEWAY
440+
add_optional_env CRISIS_ALERT_GOOGLE_VOICE_RECIPIENTS
440441
add_optional_env CRISIS_ALERT_GOOGLE_VOICE_GMAIL_USER
441442
add_optional_env FIRSTRADE_RUNTIME_EXECUTION_WINDOW_TRADING_DAYS
442443
add_optional_env FIRSTRADE_TECH_RUNTIME_EXECUTION_WINDOW_TRADING_DAYS

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ commit credentials.
8585
| `TELEGRAM_TOKEN` | Optional | Telegram bot token for strategy-cycle summaries |
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 |
88-
| `CRISIS_ALERT_GOOGLE_VOICE_GATEWAY` | Optional | Google Voice SMS gateway recipients, usually ending in `@txt.voice.google.com` |
89-
| `CRISIS_ALERT_GOOGLE_VOICE_GMAIL_USER` | Optional | Gmail address used to send Google Voice gateway alerts |
90-
| `CRISIS_ALERT_GOOGLE_VOICE_GMAIL_APP_PASSWORD` | Optional | Gmail App Password, preferably supplied from Secret Manager in Cloud Run |
88+
| `CRISIS_ALERT_GOOGLE_VOICE_RECIPIENTS` | Optional | Email-form recipients. Use a normal mailbox for email-only delivery, or a Google Voice mailbox/address to also trigger GV prompts |
89+
| `CRISIS_ALERT_GOOGLE_VOICE_GMAIL_USER` | Optional | Gmail address used as the sender for Google Voice notification mail |
90+
| `CRISIS_ALERT_GOOGLE_VOICE_GMAIL_APP_PASSWORD` | Optional | Gmail App Password for the sender account, preferably supplied from Secret Manager in Cloud Run |
9191
| `FIRSTRADE_COOKIE_DIR` | Optional | Cookie cache directory, default `.runtime/firstrade-cookies` |
9292
| `FIRSTRADE_ENABLE_LIVE_TRADING` | Optional | Must be `true` before any live order can be submitted |
9393
| `FIRSTRADE_RUN_SMOKE_ON_HTTP` | Optional | Must be `true` before `/smoke` performs a real login/quote |

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@34a2c74deb7aafef0f6f4b278444d7b0efb76794",
18-
"us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@861eaedc1caecf1e33ff12f55bbe9af87a221df1",
17+
"quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@705667fbb88b743eb83e858b1cc42fe9ebc3a87a",
18+
"us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@aca4e1449e9e87e0222b8a1a5e0dd84f822d516c",
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@34a2c74deb7aafef0f6f4b278444d7b0efb76794
5-
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@861eaedc1caecf1e33ff12f55bbe9af87a221df1
4+
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@705667fbb88b743eb83e858b1cc42fe9ebc3a87a
5+
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@aca4e1449e9e87e0222b8a1a5e0dd84f822d516c
66
google-cloud-storage
77
requests
88
pytest

runtime_config_support.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class PlatformRuntimeSettings:
5858
strategy_config_path: str | None = None
5959
strategy_config_source: str | None = None
6060
strategy_plugin_mounts_json: str | None = None
61-
crisis_alert_google_voice_gateway: tuple[str, ...] = ()
61+
crisis_alert_google_voice_recipients: tuple[str, ...] = ()
6262
crisis_alert_google_voice_gmail_user: str | None = None
6363
crisis_alert_google_voice_gmail_app_password: str | None = None
6464
runtime_target: RuntimeTarget | None = None
@@ -148,7 +148,7 @@ def load_platform_runtime_settings(
148148
os.getenv("FIRSTRADE_STRATEGY_PLUGIN_MOUNTS_JSON")
149149
or os.getenv("STRATEGY_PLUGIN_MOUNTS_JSON")
150150
),
151-
crisis_alert_google_voice_gateway=_split_env_list(os.getenv("CRISIS_ALERT_GOOGLE_VOICE_GATEWAY")),
151+
crisis_alert_google_voice_recipients=_split_env_list(os.getenv("CRISIS_ALERT_GOOGLE_VOICE_RECIPIENTS")),
152152
crisis_alert_google_voice_gmail_user=_first_non_empty(os.getenv("CRISIS_ALERT_GOOGLE_VOICE_GMAIL_USER")),
153153
crisis_alert_google_voice_gmail_app_password=_first_non_empty(
154154
os.getenv("CRISIS_ALERT_GOOGLE_VOICE_GMAIL_APP_PASSWORD")

tests/test_rebalance_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ 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_google_voice_gateway=("gateway@txt.voice.google.com",),
231+
crisis_alert_google_voice_recipients=("voice@example.com",),
232232
crisis_alert_google_voice_gmail_user="bot@example.com",
233233
crisis_alert_google_voice_gmail_app_password="app-password",
234234
)

tests/test_runtime_config_support.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_reserved_cash_policy_defaults_to_zero(monkeypatch):
5353

5454
assert settings.reserved_cash_floor_usd == 0.0
5555
assert settings.reserved_cash_ratio == 0.0
56-
assert settings.crisis_alert_google_voice_gateway == ()
56+
assert settings.crisis_alert_google_voice_recipients == ()
5757
assert settings.crisis_alert_google_voice_gmail_user is None
5858
assert settings.crisis_alert_google_voice_gmail_app_password is None
5959

@@ -71,13 +71,13 @@ def test_reserved_cash_policy_loads_from_env(monkeypatch):
7171

7272
def test_crisis_alert_google_voice_settings_load_from_env(monkeypatch):
7373
monkeypatch.setenv("RUNTIME_TARGET_JSON", _target_json())
74-
monkeypatch.setenv("CRISIS_ALERT_GOOGLE_VOICE_GATEWAY", "gateway@txt.voice.google.com")
74+
monkeypatch.setenv("CRISIS_ALERT_GOOGLE_VOICE_RECIPIENTS", "alerts@example.com; voice@example.com")
7575
monkeypatch.setenv("CRISIS_ALERT_GOOGLE_VOICE_GMAIL_USER", "sender@gmail.com")
7676
monkeypatch.setenv("CRISIS_ALERT_GOOGLE_VOICE_GMAIL_APP_PASSWORD", "secret")
7777

7878
settings = load_platform_runtime_settings(project_id_resolver=lambda: "project-1")
7979

80-
assert settings.crisis_alert_google_voice_gateway == ("gateway@txt.voice.google.com",)
80+
assert settings.crisis_alert_google_voice_recipients == ("alerts@example.com", "voice@example.com")
8181
assert settings.crisis_alert_google_voice_gmail_user == "sender@gmail.com"
8282
assert settings.crisis_alert_google_voice_gmail_app_password == "secret"
8383

tests/test_sync_cloud_run_env_workflow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def test_sync_cloud_run_env_workflow_syncs_crisis_alert_settings():
88
workflow = workflow_path.read_text(encoding="utf-8")
99

1010
for name in (
11-
"CRISIS_ALERT_GOOGLE_VOICE_GATEWAY",
11+
"CRISIS_ALERT_GOOGLE_VOICE_RECIPIENTS",
1212
"CRISIS_ALERT_GOOGLE_VOICE_GMAIL_USER",
1313
):
1414
assert f"{name}: ${{{{ vars.{name} }}}}" in workflow
@@ -24,4 +24,5 @@ def test_sync_cloud_run_env_workflow_syncs_crisis_alert_settings():
2424
"CRISIS_ALERT_GOOGLE_VOICE_GMAIL_APP_PASSWORD_SECRET_NAME CRISIS_ALERT_GOOGLE_VOICE_GMAIL_APP_PASSWORD"
2525
) in workflow
2626
assert '"CRISIS_ALERT_GOOGLE_VOICE_TO"' in workflow
27+
assert '"CRISIS_ALERT_GOOGLE_VOICE_GATEWAY"' in workflow
2728
assert '"CRISIS_ALERT_SMTP_HOST"' in workflow

0 commit comments

Comments
 (0)