feat(delivery): expose production deploy readback blocker
This commit is contained in:
@@ -9,6 +9,9 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from src.services.awoooi_production_deploy_readback_blocker import (
|
||||
load_latest_awoooi_production_deploy_readback_blocker,
|
||||
)
|
||||
from src.services.awoooi_status_cleanup_dashboard import (
|
||||
load_latest_awoooi_status_cleanup_dashboard,
|
||||
)
|
||||
@@ -28,12 +31,14 @@ _SCHEMA_VERSION = "delivery_closure_workbench_v1"
|
||||
def load_delivery_closure_workbench() -> dict[str, Any]:
|
||||
"""Load existing delivery snapshots and return a compact workbench model."""
|
||||
status_cleanup = load_latest_awoooi_status_cleanup_dashboard()
|
||||
production_deploy = load_latest_awoooi_production_deploy_readback_blocker()
|
||||
github = _load_github_private_backup_evidence_gate()
|
||||
gitea = load_latest_gitea_workflow_runner_health()
|
||||
runtime = load_latest_runtime_surface_inventory()
|
||||
backup = load_latest_backup_dr_readiness_matrix()
|
||||
return build_delivery_closure_workbench(
|
||||
status_cleanup=status_cleanup,
|
||||
production_deploy=production_deploy,
|
||||
github=github,
|
||||
gitea=gitea,
|
||||
runtime=runtime,
|
||||
@@ -44,6 +49,7 @@ def load_delivery_closure_workbench() -> dict[str, Any]:
|
||||
def build_delivery_closure_workbench(
|
||||
*,
|
||||
status_cleanup: dict[str, Any],
|
||||
production_deploy: dict[str, Any],
|
||||
github: dict[str, Any],
|
||||
gitea: dict[str, Any],
|
||||
runtime: dict[str, Any],
|
||||
@@ -59,6 +65,8 @@ def build_delivery_closure_workbench(
|
||||
github_preflight.get("internal_governance_writeback")
|
||||
or github.get("internal_governance_writeback")
|
||||
)
|
||||
production_deploy_readback = _dict(production_deploy.get("readback"))
|
||||
production_deploy_rollups = _dict(production_deploy.get("rollups"))
|
||||
gitea_status = _dict(gitea.get("program_status"))
|
||||
gitea_rollups = _dict(gitea.get("rollups"))
|
||||
runtime_status = _dict(runtime.get("program_status"))
|
||||
@@ -97,6 +105,46 @@ def build_delivery_closure_workbench(
|
||||
"href": "/governance?tab=automation-inventory",
|
||||
"next_action": _first_string(status_cleanup.get("next_actions")),
|
||||
},
|
||||
{
|
||||
"id": "production_deploy",
|
||||
"source_id": "production_deploy_readback",
|
||||
"completion_percent": _percent(
|
||||
100
|
||||
if production_deploy_rollups.get("production_image_tag_matches_main")
|
||||
is True
|
||||
else 40
|
||||
),
|
||||
"status": str(production_deploy.get("status") or "unknown"),
|
||||
"blocker_count": _int(production_deploy_rollups.get("hard_blocker_count")),
|
||||
"metric": {
|
||||
"kind": "deploy_readback",
|
||||
"source_control_main_short_sha": str(
|
||||
production_deploy_readback.get("source_control_main_short_sha")
|
||||
or ""
|
||||
),
|
||||
"production_image_tag_short_sha": str(
|
||||
production_deploy_readback.get("production_image_tag_short_sha")
|
||||
or ""
|
||||
),
|
||||
"production_image_tag_matches_main": production_deploy_readback.get(
|
||||
"production_image_tag_matches_main"
|
||||
)
|
||||
is True,
|
||||
"current_main_cd_run_visible": production_deploy_readback.get(
|
||||
"current_main_cd_run_visible"
|
||||
)
|
||||
is True,
|
||||
"authorized_dispatch_channel_ready": production_deploy_readback.get(
|
||||
"authorized_dispatch_channel_ready"
|
||||
)
|
||||
is True,
|
||||
"latest_visible_cd_run_id": str(
|
||||
production_deploy_readback.get("latest_visible_cd_run_id") or ""
|
||||
),
|
||||
},
|
||||
"href": "/deployments",
|
||||
"next_action": _first_string(production_deploy.get("next_actions")),
|
||||
},
|
||||
{
|
||||
"id": "github",
|
||||
"source_id": "github_private_backup",
|
||||
@@ -208,6 +256,7 @@ def build_delivery_closure_workbench(
|
||||
|
||||
source_statuses = [
|
||||
_source_status("status_cleanup", status_cleanup),
|
||||
_source_status("production_deploy_readback", production_deploy),
|
||||
_source_status("github_private_backup", github),
|
||||
_source_status("gitea_ci_cd", gitea),
|
||||
_source_status("runtime_surface", runtime),
|
||||
@@ -257,6 +306,29 @@ def build_delivery_closure_workbench(
|
||||
"workflow_trigger_authorized"
|
||||
)
|
||||
is True,
|
||||
"production_deploy_status": str(production_deploy.get("status") or ""),
|
||||
"production_deploy_source_control_main_ready": production_deploy_rollups.get(
|
||||
"source_control_main_ready"
|
||||
)
|
||||
is True,
|
||||
"production_deploy_image_tag_matches_main": production_deploy_rollups.get(
|
||||
"production_image_tag_matches_main"
|
||||
)
|
||||
is True,
|
||||
"production_deploy_governance_fields_present": production_deploy_rollups.get(
|
||||
"production_governance_fields_present"
|
||||
)
|
||||
is True,
|
||||
"production_deploy_authorized_dispatch_channel_ready": (
|
||||
production_deploy_rollups.get("authorized_dispatch_channel_ready")
|
||||
is True
|
||||
),
|
||||
"production_deploy_hard_blocker_count": _int(
|
||||
production_deploy_rollups.get("hard_blocker_count")
|
||||
),
|
||||
"production_deploy_latest_visible_cd_run_id": str(
|
||||
production_deploy_readback.get("latest_visible_cd_run_id") or ""
|
||||
),
|
||||
"github_write_channel_ready": github_preflight.get(
|
||||
"github_write_channel_ready"
|
||||
)
|
||||
@@ -321,6 +393,10 @@ def build_delivery_closure_workbench(
|
||||
"workflow_trigger_allowed"
|
||||
)
|
||||
is True,
|
||||
"production_deploy_trigger_allowed": _dict(
|
||||
production_deploy.get("operation_boundaries")
|
||||
).get("deploy_trigger_allowed")
|
||||
is True,
|
||||
"github_write_channel_ready": github_preflight.get(
|
||||
"github_write_channel_ready"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user