2.7 KiB
2.7 KiB
id, title, status, type, team, supporting_teams, roadmap_item, priority
| id | title | status | type | team | supporting_teams | roadmap_item | priority | |
|---|---|---|---|---|---|---|---|---|
| TASK-245 | Fix public snapshot runner initialize storage argument | done | backend | Backend Senior |
|
foundation | high |
TASK-245 - Fix public snapshot runner initialize storage argument
Goal
Fix the deployed manual public jobs that failed with initialize_rcon_materialized_storage() got an unexpected keyword argument 'ensure_storage'.
Context
TASK-243 added ensure_storage gating in the ranking and historical snapshot paths, but one wrapper incorrectly propagated that keyword into initialize_rcon_materialized_storage(), whose signature only accepts db_path.
The failure was visible when running:
python -m app.historical_runner --public-job ranking-weeklypython -m app.historical_runner --public-job ranking-monthlypython -m app.historical_runner --public-job historical-weeklypython -m app.historical_runner --public-job historical-monthly
Steps
- Audited every
ensure_storage=path around public snapshot generation. - Confirmed that
initialize_rcon_materialized_storage()does not accept that keyword. - Moved the gating logic to a local path resolver in
rcon_historical_leaderboards. - Kept
connect_postgres_compat(initialize=False)for follow-up read/write connections after the one-time initialization point. - Added regression tests for both enabled and disabled initialization flows.
Files to Read First
AGENTS.mdai/architecture-index.mdai/repo-context.mdbackend/app/historical_runner.pybackend/app/rcon_historical_leaderboards.pybackend/app/rcon_admin_log_materialization.py
Expected Files to Modify
backend/app/rcon_historical_leaderboards.pybackend/tests/test_historical_snapshot_refresh.pydocs/public-snapshot-refresh-schedule.md
Constraints
- Keep public GET endpoints snapshot-only.
- Do not touch frontend, assets or server configuration.
- Preserve the TASK-243 fixes for JSON serialization, duplicate ranking items and monthly MVP V2 fallback.
Validation
python -m compileall backend/appcd backend; python -m unittest tests.test_historical_snapshot_refreshcd backend; python -m unittest tests.test_current_match_payload tests.test_rcon_admin_log_storage tests.test_historical_snapshot_refresh
Outcome
- Manual public jobs no longer pass an invalid keyword to
initialize_rcon_materialized_storage(). ensure_storage=Truestill initializes materialized storage once through the wrapper layer.ensure_storage=Falsenow skips the base initializer cleanly and relies on the existing non-DDL connection path.- Regression coverage now asserts both enabled and disabled initialization flows.