fix(gitea): surface workflow and alert receipt readiness
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 3m18s
CD Pipeline / build-and-deploy (push) Failing after 50s
CD Pipeline / post-deploy-checks (push) Has been skipped
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 3m18s
CD Pipeline / build-and-deploy (push) Failing after 50s
CD Pipeline / post-deploy-checks (push) Has been skipped
This commit is contained in:
@@ -8,6 +8,7 @@ mutates repositories, changes visibility, restarts runners, or touches hosts.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
import re
|
||||
from datetime import datetime
|
||||
@@ -27,6 +28,9 @@ from src.services.gitea_private_inventory_p0_scorecard import (
|
||||
from src.services.gitea_full_server_backup_dr_receipts import (
|
||||
load_latest_gitea_full_server_backup_dr_receipts,
|
||||
)
|
||||
from src.services.gitea_cicd_alert_receipt_chain_readback import (
|
||||
load_latest_gitea_cicd_alert_receipt_chain_readback,
|
||||
)
|
||||
from src.services.gitea_repo_bundle_backup_readback import (
|
||||
load_latest_gitea_repo_bundle_backup_readback,
|
||||
)
|
||||
@@ -101,6 +105,9 @@ def load_latest_gitea_capability_ci_cd_optimization_readback(
|
||||
backup_notification_policy=load_latest_backup_notification_policy(),
|
||||
repo_bundle_backup_readback=load_latest_gitea_repo_bundle_backup_readback(),
|
||||
full_server_backup_dr_receipts=load_latest_gitea_full_server_backup_dr_receipts(),
|
||||
gitea_cicd_alert_receipt_chain_readback=asyncio.run(
|
||||
load_latest_gitea_cicd_alert_receipt_chain_readback()
|
||||
),
|
||||
)
|
||||
_require_payload(payload, "gitea_capability_ci_cd_optimization_readback")
|
||||
return payload
|
||||
@@ -217,6 +224,7 @@ def build_gitea_capability_ci_cd_optimization_readback(
|
||||
backup_notification_policy: dict[str, Any],
|
||||
repo_bundle_backup_readback: dict[str, Any],
|
||||
full_server_backup_dr_receipts: dict[str, Any] | None = None,
|
||||
gitea_cicd_alert_receipt_chain_readback: dict[str, Any] | None = None,
|
||||
generated_at: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
"""Compose Gitea capability coverage and professional CI/CD work items."""
|
||||
@@ -237,6 +245,9 @@ def build_gitea_capability_ci_cd_optimization_readback(
|
||||
full_dr = _dict(full_server_backup_dr_receipts)
|
||||
full_dr_summary = _dict(full_dr.get("summary"))
|
||||
full_dr_gap_ids = _strings(full_dr.get("active_gap_ids"))
|
||||
alert_chain = _dict(gitea_cicd_alert_receipt_chain_readback)
|
||||
alert_chain_ready = alert_chain.get("ready") is True
|
||||
alert_chain_summary = _dict(alert_chain.get("summary"))
|
||||
full_dr_non_restore_gap_ids = [
|
||||
gap for gap in full_dr_gap_ids if gap != "restore_drill_approval_gate"
|
||||
]
|
||||
@@ -513,14 +524,31 @@ def build_gitea_capability_ci_cd_optimization_readback(
|
||||
"observability_alert_receipts",
|
||||
"observability",
|
||||
"CI/CD, backup, and Gitea alert receipt chain",
|
||||
"action_required",
|
||||
"policies exist, but live alert receipt chain must close before calling it complete",
|
||||
"verified_ready" if alert_chain_ready else "action_required",
|
||||
"CI/CD, backup, and Gitea alert receipt chain is verified"
|
||||
if alert_chain_ready
|
||||
else "policies exist, but live alert receipt chain must close before calling it complete",
|
||||
[
|
||||
"GET /api/v1/agents/gitea-cicd-alert-receipt-chain-readback",
|
||||
"GET /api/v1/agents/backup-notification-policy",
|
||||
"GET /api/v1/agents/telegram-alert-monitoring-coverage-readback",
|
||||
],
|
||||
"make backup/CD/Gitea alerts emit verifiable receipt-stage evidence",
|
||||
"keep receipt-stage evidence fresh for backup/CD/Gitea alerts"
|
||||
if alert_chain_ready
|
||||
else "make backup/CD/Gitea alerts emit verifiable receipt-stage evidence",
|
||||
{
|
||||
"alert_receipt_chain_ready": alert_chain_ready,
|
||||
"alert_receipt_chain_status": str(alert_chain.get("status") or ""),
|
||||
"action_required_chain_count": _int(
|
||||
alert_chain_summary.get("action_required_chain_count")
|
||||
),
|
||||
"monitoring_live_receipt_gap_count": _int(
|
||||
alert_chain_summary.get("monitoring_live_receipt_gap_count")
|
||||
),
|
||||
"workflow_notify_bridge_count": _int(
|
||||
alert_chain_summary.get("workflow_notify_bridge_count")
|
||||
),
|
||||
},
|
||||
p0=True,
|
||||
),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user