Enforce near-run warmups for four IBKR gateways#344
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review✅ Merge allowed: No issues found Review by Codex PR Review bot • PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 192a71bee8
ℹ️ 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".
| return | ||
| if scheduler.get("timezone") != "America/New_York": | ||
| raise ValueError(f"{service_name} warmup timezone must be America/New_York") | ||
| if scheduler.get("probe_time") != NEAR_RUN_WARMUP_SCHEDULE: |
There was a problem hiding this comment.
Normalize two-field warmup overrides before rejecting
When one of these gateway targets uses the supported two-field scheduler override (probe_time: "43 9,15" or CLOUD_SCHEDULER_PROBE_TIME=43 9,15) with a weekday main_time, the sync workflow expands it to the same 43 9,15 * * 1-5 cron before creating the warmup job (.github/workflows/sync-cloud-run-env.yml accepts either 2 time fields or 5 cron fields). This raw exact comparison aborts the env sync before that normalization, so a configuration that would deploy the approved schedule is rejected; validate the normalized cron instead.
Useful? React with 👍 / 👎.
Summary
43 9,15 * * 1-5near-run warmup contract for the four IBKR gateway servicesSafety boundary
GET /health/run,/dry-run, order, position, funding, leverage, HK verify, Runtime Guard, or min-instances changesValidation
uv run --no-sync pytest -q tests/test_runtime_config_support.py tests/test_cloud_run_warmup_workflow.py— 76 passedbash tests/test_sync_cloud_run_env_workflow.shactionlint .github/workflows/sync-cloud-run-env.yml.github/workflows/sync-cloud-run-env.ymluv run --no-sync ruff check scripts/build_cloud_run_env_sync_plan.py tests/test_runtime_config_support.pygit diff --check