feat: add controlled AgentRun CI cleanup

This commit is contained in:
Codex
2026-06-06 09:08:12 +00:00
parent 82e266353b
commit 9960b2609a
8 changed files with 642 additions and 13 deletions
-6
View File
@@ -1014,9 +1014,6 @@ def execute_registry_retention():
deployment = registry_deployment_preflight()
if not deployment.get("ok"):
raise RuntimeError("registry deployment preflight failed: %s" % deployment.get("reason"))
active = active_hwlab_ci_writes()
if not active.get("ok") or int(active.get("activeCount") or 0) > 0:
raise RuntimeError("refusing registry maintenance while hwlab-ci PipelineRun/TaskRun is active")
plan = plan_registry_retention()
delete_rows = plan.get("deleteRows") or []
delete_revision_rows = plan.get("deleteRevisionRows") or []
@@ -1144,9 +1141,6 @@ def execute_registry_garbage_collect_only():
deployment = registry_deployment_preflight()
if not deployment.get("ok"):
raise RuntimeError("registry deployment preflight failed: %s" % deployment.get("reason"))
active = active_hwlab_ci_writes()
if not active.get("ok") or int(active.get("activeCount") or 0) > 0:
raise RuntimeError("refusing registry maintenance while hwlab-ci PipelineRun/TaskRun is active")
cronjobs = ["hwlab-g14-branch-poller", "hwlab-v02-branch-poller"]
original_crons = cronjob_suspend_states(cronjobs)
before = du_size(REGISTRY_ROOT, 60) or 0