fix(api): surface gitops runtime readback current
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 42s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled

This commit is contained in:
Your Name
2026-07-01 23:55:57 +08:00
parent 492881ded3
commit 1433f151f6
3 changed files with 92 additions and 0 deletions

View File

@@ -157,6 +157,22 @@ def build_delivery_closure_workbench(
)
production_deploy_readback = _dict(production_deploy.get("readback"))
production_deploy_rollups = _dict(production_deploy.get("rollups"))
production_deploy_runtime_matches_gitops_desired = (
production_deploy_readback.get("runtime_build_matches_gitops_desired_image_tag")
is True
)
production_deploy_runtime_readback_status = str(
production_deploy_readback.get("runtime_build_readback_status") or ""
)
production_deploy_runtime_committed_drift_accepted = (
production_deploy_runtime_readback_status
== "matches_gitops_desired_image_tag_with_committed_deploy_readback_drift"
)
production_deploy_runtime_readback_current = (
production_deploy_runtime_matches_gitops_desired
and production_deploy_readback.get("desired_main_api_image_tag_readback_status")
== "ok"
)
gitea_status = _dict(gitea.get("program_status"))
gitea_rollups = _dict(gitea.get("rollups"))
gitea_runner_request_readback = _dict(
@@ -310,6 +326,15 @@ def build_delivery_closure_workbench(
production_deploy_readback.get("runtime_build_readback_status")
or ""
),
"runtime_build_matches_gitops_desired_image_tag": (
production_deploy_runtime_matches_gitops_desired
),
"runtime_build_deploy_readback_current": (
production_deploy_runtime_readback_current
),
"runtime_build_committed_readback_drift_accepted": (
production_deploy_runtime_committed_drift_accepted
),
"runtime_build_matches_committed_source_control_readback": (
production_deploy_readback.get(
"runtime_build_matches_committed_source_control_readback"
@@ -1849,6 +1874,15 @@ def build_delivery_closure_workbench(
"production_deploy_runtime_build_readback_status": str(
production_deploy_readback.get("runtime_build_readback_status") or ""
),
"production_deploy_runtime_build_matches_gitops_desired_image_tag": (
production_deploy_runtime_matches_gitops_desired
),
"production_deploy_runtime_build_deploy_readback_current": (
production_deploy_runtime_readback_current
),
"production_deploy_runtime_build_committed_readback_drift_accepted": (
production_deploy_runtime_committed_drift_accepted
),
"production_deploy_runtime_build_matches_committed_source_control_readback": (
production_deploy_readback.get(
"runtime_build_matches_committed_source_control_readback"

View File

@@ -49,6 +49,45 @@ def test_delivery_closure_workbench_endpoint_returns_product_summary():
_assert_delivery_workbench_shape(data)
def test_delivery_closure_workbench_surfaces_gitops_runtime_readback_current(
monkeypatch,
):
build_sha = "0123456789abcdef0123456789abcdef01234567"
monkeypatch.setenv("AWOOOI_BUILD_COMMIT_SHA", build_sha)
monkeypatch.setenv("AWOOOI_DESIRED_API_IMAGE_TAG", build_sha)
payload = load_delivery_closure_workbench()
summary = payload["summary"]
production_lane = {
lane["id"]: lane for lane in payload["lanes"]
}["production_deploy"]
metric = production_lane["metric"]
assert summary["production_deploy_image_tag_matches_main"] is True
assert (
summary[
"production_deploy_runtime_build_matches_gitops_desired_image_tag"
]
is True
)
assert (
summary["production_deploy_runtime_build_deploy_readback_current"]
is True
)
assert (
summary[
"production_deploy_runtime_build_committed_readback_drift_accepted"
]
is True
)
assert (
metric["runtime_build_matches_gitops_desired_image_tag"]
is True
)
assert metric["runtime_build_deploy_readback_current"] is True
assert metric["runtime_build_committed_readback_drift_accepted"] is True
def test_delivery_closure_workbench_uses_gitea_private_inventory_lane():
payload = load_delivery_closure_workbench()

View File

@@ -2775,6 +2775,16 @@ export interface DeliveryClosureWorkbenchSnapshot {
production_deploy_status: string
production_deploy_source_control_main_ready: boolean
production_deploy_image_tag_matches_main: boolean
production_deploy_runtime_build_commit_sha: string
production_deploy_runtime_build_commit_short_sha: string
production_deploy_runtime_build_readback_status: string
production_deploy_runtime_build_matches_gitops_desired_image_tag: boolean
production_deploy_runtime_build_deploy_readback_current: boolean
production_deploy_runtime_build_committed_readback_drift_accepted: boolean
production_deploy_runtime_build_matches_committed_source_control_readback: boolean
production_deploy_runtime_build_matches_committed_production_image_tag: boolean
production_deploy_desired_main_api_image_tag_short_sha: string
production_deploy_desired_main_api_image_tag_readback_status: string
production_deploy_governance_fields_present: boolean
production_deploy_authorized_dispatch_channel_ready: boolean
production_deploy_manual_run_button_visible: boolean
@@ -2873,6 +2883,15 @@ export interface DeliveryClosureWorkbenchSnapshot {
observed_source_control_main_short_sha: string
production_image_tag_short_sha: string
production_image_tag_matches_main: boolean
runtime_build_commit_short_sha: string
runtime_build_readback_status: string
runtime_build_matches_gitops_desired_image_tag: boolean
runtime_build_deploy_readback_current: boolean
runtime_build_committed_readback_drift_accepted: boolean
runtime_build_matches_committed_source_control_readback: boolean
runtime_build_matches_committed_production_image_tag: boolean
desired_main_api_image_tag_short_sha: string
desired_main_api_image_tag_readback_status: string
current_main_cd_run_visible: boolean
authorized_dispatch_channel_ready: boolean
manual_run_button_visible: boolean