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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ on:
branches: [ main ]
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down Expand Up @@ -75,7 +79,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.12"

- name: Install dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dependabot_auto_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
auto-merge:
if: github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'dependabot/')
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/execution-report-heartbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ env:
GCP_WORKLOAD_IDENTITY_PROVIDER: projects/303168642265/locations/global/workloadIdentityPools/github-actions/providers/github-main
GCP_WORKLOAD_IDENTITY_SERVICE_ACCOUNT: ibkr-platform-deploy@interactivebrokersquant.iam.gserviceaccount.com

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false

jobs:
heartbeat:
name: Check execution report heartbeat
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/runtime-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ env:
GCP_WORKLOAD_IDENTITY_PROVIDER: projects/303168642265/locations/global/workloadIdentityPools/github-actions/providers/github-main
GCP_WORKLOAD_IDENTITY_SERVICE_ACCOUNT: ibkr-platform-deploy@interactivebrokersquant.iam.gserviceaccount.com

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false

jobs:
guard:
name: Check Cloud Run runtime
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/sync-cloud-run-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,15 @@ env:
GCP_RUNTIME_SERVICE_ACCOUNT: ibkr-platform-runtime@interactivebrokersquant.iam.gserviceaccount.com
GCP_ARTIFACT_REGISTRY_REPOSITORY: cloud-run-source-deploy

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false

jobs:
sync-cloud-run-env:
name: Deploy / Sync Cloud Run
runs-on: ubuntu-latest
timeout-minutes: 20

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Raise deploy job timeout above wait loop

When env sync waits for Cloud Run to reach the current commit, the workflow still allows the wait loop to run for up to 1800 seconds per service, but this new 20-minute job timeout kills the entire job before that loop can reach its own deadline. In any deployment where image build/push/deploy plus propagation takes more than the remaining job time, the job now fails from the GitHub timeout instead of completing or emitting the script's intended timeout message, so the job timeout should be greater than the longest expected wait path.

Useful? React with 👍 / 👎.

permissions:
contents: read
id-token: write
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
25 changes: 25 additions & 0 deletions tests/test_request_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@
from application.cycle_result import StrategyCycleResult


def route_methods(strategy_module):
return {
rule.rule: sorted(rule.methods - {"HEAD", "OPTIONS"})
for rule in strategy_module.app.url_map.iter_rules()
}


def test_cloud_run_route_contracts_are_registered(strategy_module):
assert route_methods(strategy_module) == {
"/": ["GET", "POST"],
"/precheck": ["GET", "POST"],
"/probe": ["GET", "POST"],
"/health": ["GET"],
"/static/<path:filename>": ["GET"],
}


def test_health_route_returns_ok(strategy_module):
with strategy_module.app.test_request_context("/health", method="GET"):
body, status = strategy_module.health()

assert status == 200
assert body == "OK"


def test_handle_request_get_returns_safe_message(strategy_module, monkeypatch):
def fail_if_called():
raise AssertionError("GET should not execute strategy")
Expand Down