fix(recovery): classify harbor repair cross-workflow jobs
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 35s
CD Pipeline / build-and-deploy (push) Failing after 2m38s
AWOOOI Harbor 110 Local Repair / workflow-shape (push) Successful in 0s
CD Pipeline / post-deploy-checks (push) Has been skipped
AWOOOI Harbor 110 Local Repair / harbor-110-local-repair (push) Has been cancelled
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 35s
CD Pipeline / build-and-deploy (push) Failing after 2m38s
AWOOOI Harbor 110 Local Repair / workflow-shape (push) Successful in 0s
CD Pipeline / post-deploy-checks (push) Has been skipped
AWOOOI Harbor 110 Local Repair / harbor-110-local-repair (push) Has been cancelled
This commit is contained in:
@@ -263,6 +263,44 @@ def _harbor_110_repair_stale_code_review_jobs() -> dict:
|
||||
}
|
||||
|
||||
|
||||
def _harbor_110_repair_cross_workflow_jobs() -> dict:
|
||||
return {
|
||||
"total_count": 3,
|
||||
"jobs": [
|
||||
{
|
||||
"id": 5901,
|
||||
"name": "build-and-deploy",
|
||||
"status": "completed",
|
||||
"conclusion": "success",
|
||||
"labels": ["awoooi-host"],
|
||||
"runner_name": "wooo-runner",
|
||||
"run_id": 4060,
|
||||
"head_sha": "f9ad460ff6f3d258bf86da2f30a2d40451234567",
|
||||
},
|
||||
{
|
||||
"id": 5902,
|
||||
"name": "tests",
|
||||
"status": "completed",
|
||||
"conclusion": "success",
|
||||
"labels": ["awoooi-host"],
|
||||
"runner_name": "wooo-runner",
|
||||
"run_id": 4060,
|
||||
"head_sha": "f9ad460ff6f3d258bf86da2f30a2d40451234567",
|
||||
},
|
||||
{
|
||||
"id": 5903,
|
||||
"name": "post-deploy-checks",
|
||||
"status": "completed",
|
||||
"conclusion": "success",
|
||||
"labels": ["awoooi-host"],
|
||||
"runner_name": "wooo-runner",
|
||||
"run_id": 4060,
|
||||
"head_sha": "f9ad460ff6f3d258bf86da2f30a2d40451234567",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def _host_pressure_waiting_log() -> str:
|
||||
return """
|
||||
2026-06-30T11:48:41.7864172Z ⏳ host web/build/smoke pressure detected (attempt 1/60); waiting 10s
|
||||
@@ -435,10 +473,50 @@ def test_build_readback_rejects_stale_harbor_110_repair_jobs_payload() -> None:
|
||||
assert payload["readback"]["harbor_110_repair_jobs_unexpected_names"] == [
|
||||
"ai-code-review"
|
||||
]
|
||||
assert (
|
||||
payload["readback"]["harbor_110_repair_jobs_payload_classifier"]
|
||||
== "unexpected_harbor_110_repair_job_names"
|
||||
)
|
||||
assert payload["readback"]["harbor_110_repair_jobs_labels"] == ["ubuntu-latest"]
|
||||
assert payload["rollups"]["harbor_110_repair_jobs_stale_or_mismatched"] is True
|
||||
|
||||
|
||||
def test_build_readback_classifies_cross_workflow_harbor_jobs_payload() -> None:
|
||||
module = _load_module()
|
||||
payload = module.build_readback(
|
||||
actions_html=_actions_html_harbor_repair_waiting_with_workflow_no_matching(),
|
||||
actions_list_http_status=401,
|
||||
actions_list_payload={"message": "token is required"},
|
||||
cd_jobs_http_status=200,
|
||||
cd_jobs_payload={"jobs": [], "total_count": 0},
|
||||
harbor_110_repair_jobs_http_status=200,
|
||||
harbor_110_repair_jobs_payload=_harbor_110_repair_cross_workflow_jobs(),
|
||||
)
|
||||
|
||||
assert payload["status"] == "blocked_harbor_110_repair_no_matching_runner"
|
||||
assert payload["readback"]["harbor_110_repair_jobs_stale_or_mismatched"] is True
|
||||
assert (
|
||||
payload["readback"]["harbor_110_repair_jobs_cross_workflow_mismatch"]
|
||||
is True
|
||||
)
|
||||
assert payload["readback"]["harbor_110_repair_jobs_payload_classifier"] == (
|
||||
"cd_workflow_jobs_returned_for_harbor_110_repair_run"
|
||||
)
|
||||
assert payload["readback"]["harbor_110_repair_jobs_expected_names"] == [
|
||||
"harbor-110-local-repair",
|
||||
"workflow-shape",
|
||||
]
|
||||
assert payload["readback"]["harbor_110_repair_jobs_unexpected_names"] == [
|
||||
"build-and-deploy",
|
||||
"post-deploy-checks",
|
||||
"tests",
|
||||
]
|
||||
assert (
|
||||
payload["rollups"]["harbor_110_repair_jobs_cross_workflow_mismatch"]
|
||||
is True
|
||||
)
|
||||
|
||||
|
||||
def test_build_readback_prioritizes_harbor_repair_jobs_stale_status() -> None:
|
||||
module = _load_module()
|
||||
payload = module.build_readback(
|
||||
|
||||
Reference in New Issue
Block a user