Skip to content

Add per-service IBKR env sync plan - #90

Merged
Pigbibi merged 1 commit into
mainfrom
feat/ibkr-smart-env-sync
May 25, 2026
Merged

Add per-service IBKR env sync plan#90
Pigbibi merged 1 commit into
mainfrom
feat/ibkr-smart-env-sync

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add CLOUD_RUN_SERVICE_TARGETS_JSON for per-service Cloud Run sync targets
  • generate a validated sync plan before updating Cloud Run so slot runtime identity stays service-specific
  • keep Telegram/email/push/SMS alert policy shared while ACCOUNT_GROUP, RUNTIME_TARGET_JSON, snapshots, and plugin mounts can differ by slot
  • document the slot JSON format and add plan tests that prevent stale shared snapshot env from leaking into per-service targets

Tests

  • bash tests/test_sync_cloud_run_env_workflow.sh
  • .venv/bin/python -m pytest tests/test_runtime_config_support.py -q -k 'cloud_run_env_sync_plan or print_strategy_switch_env_plan_for_tqqq_growth_income'
  • .venv/bin/python -m ruff check .

@Pigbibi
Pigbibi merged commit dd07d85 into main May 25, 2026
1 check passed
@Pigbibi
Pigbibi deleted the feat/ibkr-smart-env-sync branch May 25, 2026 18:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fcb9bbf71b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +29 to +36
SHARED_TARGET_FALLBACK_ENV = frozenset(
{
"GLOBAL_TELEGRAM_CHAT_ID",
"NOTIFY_LANG",
"IB_ACCOUNT_GROUP_CONFIG_SECRET_NAME",
"IB_GATEWAY_ZONE",
"IB_GATEWAY_IP_MODE",
"EXECUTION_REPORT_GCS_URI",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve global safety env fallbacks in per-service mode

When CLOUD_RUN_SERVICE_TARGETS_JSON is used, only names in SHARED_TARGET_FALLBACK_ENV can fall back to repository-level env vars; IBKR_PAPER_LIQUIDATE_ONLY and cash guard vars are omitted from that allowlist even though they are still modeled as target env keys. As a result, existing repo-level settings are interpreted as absent and get pushed into remove_env_vars, so the sync step removes them from every Cloud Run service during migration to per-service mode. This can silently disable liquidation-only / cash-protection runtime safeguards unless operators duplicate those values into every target/default entry.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant