Prepare State Hub retirement baseline
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Multi-Context Image / build-and-push (push) Successful in 1m0s

This commit is contained in:
tegwick 2026-08-09 16:19:53 +02:00
parent 2217bdd9f5
commit 5927591be8
46 changed files with 32583 additions and 62 deletions

View file

@ -53,6 +53,7 @@ from api.services.summary_cache import (
get_summary_cache,
register_summary_cache_invalidation,
)
from api.services.ops_run_projection import get_ops_run_projection
def _dual_workplan_refs(
@ -111,22 +112,22 @@ async def get_summary(
if cache_status == "hit-revision" and cached is not None:
_summary_cache_headers(response, cache_status="hit-revision", revision=revision_token)
return cached
return cached.model_copy(update={"ops_runs": await get_ops_run_projection()})
if cache_status == "progress-section" and cached is not None:
result = await apply_progress_section(session, cached, revision)
_summary_cache_headers(response, cache_status="hit-revision", revision=revision_token)
return result
return result.model_copy(update={"ops_runs": await get_ops_run_projection()})
if cache_status == "stale" and cached is not None:
cache.schedule_refresh(revision)
_summary_cache_headers(response, cache_status="stale", revision=revision_token)
return cached
return cached.model_copy(update={"ops_runs": await get_ops_run_projection()})
result = await build_state_summary(session)
cache.store(result, revision)
_summary_cache_headers(response, cache_status="miss", revision=revision_token)
return result
return result.model_copy(update={"ops_runs": await get_ops_run_projection(refresh=force_refresh)})
async def build_state_summary(session: AsyncSession) -> StateSummary: