Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ft-adopt-facts-revision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
needed=["FIRSTRADE_ACCOUNT_FACTS_TARGET_ID","FIRSTRADE_ACCOUNT_FACTS_SOURCE_BINDING_ID","FIRSTRADE_ACCOUNT_FACTS_ACCOUNT_KEY","FIRSTRADE_ACCOUNT_FACTS_ACCOUNT_SCOPE"]
if enabled != "true":
print(f"sync_not_enabled value={enabled!r}", file=sys.stderr); sys.exit(1)
if url != "https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync":
if url != "https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync":
print("sync_url_invalid", file=sys.stderr); sys.exit(1)
if not has_secret_ref(token):
keys=sorted((token or {}).keys())
Expand Down
2 changes: 1 addition & 1 deletion scripts/account_facts_config_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from typing import Any


APPROVED_SYNC_URL = "https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync"
APPROVED_SYNC_URL = "https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync"
FACTS_ENV_KEYS = (
"FIRSTRADE_ACCOUNT_FACTS_SYNC_ENABLED",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL",
Expand Down
2 changes: 1 addition & 1 deletion scripts/inspect_account_data_readiness.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
REGION_RE = re.compile(REGION_PATH_PATTERN + r"\Z")
COMMIT_RE = re.compile(r"[0-9a-fA-F]{40}\Z")
MAX_RESPONSE_BYTES = 2_000_000
ACCOUNT_FACTS_DESTINATION = "https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync"
ACCOUNT_FACTS_DESTINATION = "https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync"


class DiagnosticFailure(Exception):
Expand Down
4 changes: 2 additions & 2 deletions src/firstrade_platform/application/account_facts_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from firstrade_platform.application.account_facts_readonly import AccountFactsUnavailable

_APPROVED_SYNC_URL = "https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync"
_APPROVED_SYNC_URL = "https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync"
Comment thread
Pigbibi marked this conversation as resolved.
Resolved
_TARGET_ID_RE = re.compile(r"[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?", re.ASCII)
_ACCOUNT_KEY_RE = re.compile(r"[A-Za-z0-9][A-Za-z0-9._:-]*", re.ASCII)
_ACCOUNT_SCOPE_RE = re.compile(r"[A-Za-z0-9][A-Za-z0-9._:-]*", re.ASCII)
Expand Down Expand Up @@ -77,7 +77,7 @@ def load_account_facts_publish_config(
if (
sync_url != _APPROVED_SYNC_URL
or parsed.scheme != "https"
or parsed.netloc != "qsl-strategy-switch-console.pigbibi.workers.dev"
or parsed.netloc != "qsl-strategy-switch-console.pigbibi-e06.workers.dev"
or parsed.path != "/api/account-facts/sync"
or parsed.query
or parsed.fragment
Expand Down
2 changes: 1 addition & 1 deletion tests/test_account_facts_config_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
def _desired(monkeypatch, **overrides):
values = {
"FIRSTRADE_ACCOUNT_FACTS_SYNC_ENABLED": "false",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync",
"FIRSTRADE_ACCOUNT_FACTS_TARGET_ID": "synthetic-target",
"FIRSTRADE_ACCOUNT_FACTS_SOURCE_BINDING_ID": "b" * 64,
"FIRSTRADE_ACCOUNT_FACTS_ACCOUNT_KEY": "synthetic-account-key",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_account_facts_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def flush(self):
def _configure(monkeypatch, **overrides):
values = {
"FIRSTRADE_ACCOUNT_FACTS_SYNC_ENABLED": "true",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_TOKEN": "synthetic-facts-token",
"FIRSTRADE_ACCOUNT_FACTS_TARGET_ID": "firstrade-live-synthetic",
"FIRSTRADE_ACCOUNT_FACTS_SOURCE_BINDING_ID": "a" * 64,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_account_facts_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def config(**overrides):
values = {
"FIRSTRADE_ACCOUNT_FACTS_SYNC_ENABLED": "true",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_TOKEN": "synthetic-facts-token",
"FIRSTRADE_ACCOUNT_FACTS_TARGET_ID": "firstrade-live-synthetic",
"FIRSTRADE_ACCOUNT_FACTS_SOURCE_BINDING_ID": "a" * 64,
Expand Down Expand Up @@ -147,9 +147,9 @@ def test_available_cash_never_replaces_missing_exact_cash(missing_key):
("overrides", "reason"),
[
({"FIRSTRADE_ACCOUNT_FACTS_SYNC_ENABLED": "false"}, "disabled"),
({"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "http://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync"}, "destination_not_approved"),
({"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "http://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync"}, "destination_not_approved"),
({"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://other.example/api/account-facts/sync"}, "destination_not_approved"),
({"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync?next=other"}, "destination_not_approved"),
({"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync?next=other"}, "destination_not_approved"),
({"FIRSTRADE_ACCOUNT_FACTS_SOURCE_BINDING_ID": "A" * 64}, "source_binding_invalid"),
({"FIRSTRADE_ACCOUNT_FACTS_SYNC_TOKEN": "same", "ACCOUNT_FACTS_SYNC_TOKEN": "same"}, "sync_token_not_dedicated"),
],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_build_cloud_run_env_sync_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_build_cloud_run_env_sync_plan_legacy_mode_without_telegram():
def test_build_cloud_run_env_sync_plan_carries_balance_facts_config_but_not_token_value():
facts_config = {
"FIRSTRADE_ACCOUNT_FACTS_SYNC_ENABLED": "false",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync",
"FIRSTRADE_ACCOUNT_FACTS_TARGET_ID": "synthetic-target",
"FIRSTRADE_ACCOUNT_FACTS_SOURCE_BINDING_ID": "a" * 64,
"FIRSTRADE_ACCOUNT_FACTS_ACCOUNT_KEY": "synthetic-account-key",
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_per_service_facts_config_fallback_applies_only_to_current_firstrade_tar
{"defaults": {"NOTIFY_LANG": "en"}, "targets": targets}
),
"FIRSTRADE_ACCOUNT_FACTS_SYNC_ENABLED": "false",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync",
"FIRSTRADE_ACCOUNT_FACTS_SYNC_URL": "https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync",
"FIRSTRADE_ACCOUNT_FACTS_TARGET_ID": "synthetic-target",
"FIRSTRADE_ACCOUNT_FACTS_SOURCE_BINDING_ID": "b" * 64,
"FIRSTRADE_ACCOUNT_FACTS_ACCOUNT_KEY": "synthetic-account-key",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_publish_archived_account_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

def config():
return AccountFactsPublishConfig(
"https://qsl-strategy-switch-console.pigbibi.workers.dev/api/account-facts/sync",
"https://qsl-strategy-switch-console.pigbibi-e06.workers.dev/api/account-facts/sync",
"synthetic-token", "synthetic-target", SOURCE, "synthetic-key", "live", ACCOUNT,
position_currency="USD",
)
Expand Down
Loading