Skip to content

Commit d8fa797

Browse files
committed
Align LongBridge service name prefixes
1 parent 90278ad commit d8fa797

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Deploy the same codebase as multiple Cloud Run services (e.g. `HK` and `SG`) by
104104

105105
- `LONGPORT_SECRET_NAME`: point to different secrets (e.g. `longport_token_hk`, `longport_token_sg`)
106106
- `ACCOUNT_PREFIX`: e.g. `HK`, `SG` (all Telegram/log alerts will include `[ACCOUNT_PREFIX/SERVICE_NAME]`)
107-
- `SERVICE_NAME`: e.g. `longbridge-quant-hk`, `longbridge-quant-sg`
107+
- `SERVICE_NAME`: e.g. `longbridge-quant-semiconductor-rotation-income-hk`, `longbridge-quant-semiconductor-rotation-income-sg`
108108
- `STRATEGY_PROFILE`: use `semiconductor_rotation_income` for the current LongBridge strategy profile
109109
- Current strategy domain is `us_equity`. The repo now keeps a small strategy registry so future strategy switching can grow by domain + profile, instead of mixing platform and strategy in one layer.
110110
- `ACCOUNT_REGION`: explicitly mark the deployed account region (`HK` / `SG`); if unset, the app falls back to `ACCOUNT_PREFIX` or the `-hk` / `-sg` service-name suffix
@@ -272,7 +272,7 @@ Secret Manager 中需存在 `LONGPORT_SECRET_NAME` 指定的密钥(默认: `lo
272272

273273
- `LONGPORT_SECRET_NAME`: 指向不同密钥(如 `longport_token_hk``longport_token_sg`
274274
- `ACCOUNT_PREFIX`: 如 `HK``SG`(所有通知/日志将包含 `[ACCOUNT_PREFIX/SERVICE_NAME]`
275-
- `SERVICE_NAME`: 如 `longbridge-quant-hk``longbridge-quant-sg`
275+
- `SERVICE_NAME`: 如 `longbridge-quant-semiconductor-rotation-income-hk``longbridge-quant-semiconductor-rotation-income-sg`
276276
- `STRATEGY_PROFILE`: 当前 LongBridge 策略档位使用 `semiconductor_rotation_income`
277277
- 当前策略大类是 `us_equity`。仓库里已经保留了一层很薄的策略注册表,后面如果要继续拆“策略大类 + 具体策略”,可以沿着这层继续扩,不需要再把平台和策略揉在一起。
278278
- `ACCOUNT_REGION`: 显式标记部署账户区域(`HK` / `SG`);未设置时会回退到 `ACCOUNT_PREFIX` 或服务名里的 `-hk` / `-sg` 后缀

tests/test_notifications.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,29 @@ def test_build_translator_supports_chinese(self):
2525
self.assertEqual(translate("equity", value="123.45"), "💰 净值: $123.45")
2626

2727
def test_build_prefixer_formats_account_and_service(self):
28-
with_prefix = build_prefixer("HK", "longbridge-quant-hk")
29-
self.assertEqual(with_prefix("hello"), "[HK/longbridge-quant-hk] hello")
28+
with_prefix = build_prefixer("HK", "longbridge-quant-semiconductor-rotation-income-hk")
29+
self.assertEqual(with_prefix("hello"), "[HK/longbridge-quant-semiconductor-rotation-income-hk] hello")
3030

3131
def test_build_sender_posts_prefixed_message(self):
3232
fake_requests = FakeRequests()
3333
sender = build_sender(
3434
"token-1",
3535
"chat-1",
36-
with_prefix_fn=build_prefixer("HK", "longbridge-quant-hk"),
36+
with_prefix_fn=build_prefixer("HK", "longbridge-quant-semiconductor-rotation-income-hk"),
3737
requests_module=fake_requests,
3838
)
3939
sender("hello")
4040
self.assertEqual(len(fake_requests.calls), 1)
4141
url, payload, timeout = fake_requests.calls[0]
4242
self.assertIn("token-1", url)
4343
self.assertEqual(payload["chat_id"], "chat-1")
44-
self.assertEqual(payload["text"], "[HK/longbridge-quant-hk] hello")
44+
self.assertEqual(payload["text"], "[HK/longbridge-quant-semiconductor-rotation-income-hk] hello")
4545
self.assertEqual(timeout, 10)
4646

4747
def test_build_issue_notifier_logs_and_sends(self):
4848
sent = []
4949
notifier = build_issue_notifier(
50-
with_prefix_fn=build_prefixer("SG", "longbridge-quant-sg"),
50+
with_prefix_fn=build_prefixer("SG", "longbridge-quant-semiconductor-rotation-income-sg"),
5151
send_tg_message_fn=sent.append,
5252
)
5353
notifier("Problem", "details")

tests/test_runtime_config_support.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_account_region_prefers_explicit_env(self):
4747
region = infer_account_region(
4848
"sg",
4949
account_prefix="HK",
50-
service_name="longbridge-quant-hk",
50+
service_name="longbridge-quant-semiconductor-rotation-income-hk",
5151
)
5252
self.assertEqual(region, "SG")
5353

@@ -63,7 +63,7 @@ def test_account_region_falls_back_to_service_name_suffix(self):
6363
region = infer_account_region(
6464
None,
6565
account_prefix="",
66-
service_name="longbridge-quant-sg",
66+
service_name="longbridge-quant-semiconductor-rotation-income-sg",
6767
)
6868
self.assertEqual(region, "SG")
6969

0 commit comments

Comments
 (0)