fix(runner): surface harbor repair failure truth
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 36s
CD Pipeline / build-and-deploy (push) Failing after 2m38s
CD Pipeline / post-deploy-checks (push) Has been skipped
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 36s
CD Pipeline / build-and-deploy (push) Failing after 2m38s
CD Pipeline / post-deploy-checks (push) Has been skipped
This commit is contained in:
@@ -401,6 +401,7 @@ def build_readback(
|
||||
)
|
||||
harbor_110_repair_waiting = harbor_110_repair_status == "Waiting"
|
||||
harbor_110_repair_running = harbor_110_repair_status == "Running"
|
||||
harbor_110_repair_failed = harbor_110_repair_status == "Failure"
|
||||
harbor_110_repair_status_blocked = harbor_110_repair_status == "Blocked"
|
||||
harbor_110_repair_jobs_run_id_matches_visible = (
|
||||
bool(harbor_110_repair_run_id)
|
||||
@@ -440,6 +441,9 @@ def build_readback(
|
||||
harbor_110_repair_visible_waiting_stale = (
|
||||
harbor_110_repair_waiting and harbor_110_repair_jobs_all_success
|
||||
)
|
||||
harbor_110_repair_visible_failure_jobs_api_stale = (
|
||||
harbor_110_repair_failed and harbor_110_repair_jobs_stale_or_mismatched
|
||||
)
|
||||
cd_harbor_repair_requires_110_controlled_lane = (
|
||||
build_log_classifier["harbor_public_route_blocked_or_retrying"]
|
||||
and build_log_classifier["harbor_controlled_repair_skip_reason"]
|
||||
@@ -465,6 +469,7 @@ def build_readback(
|
||||
)
|
||||
harbor_110_repair_blocked = (
|
||||
harbor_110_repair_status_blocked
|
||||
or harbor_110_repair_failed
|
||||
or bool(harbor_110_repair_no_matching_runner_label)
|
||||
or harbor_110_repair_waiting_after_cd_harbor_blocker
|
||||
)
|
||||
@@ -576,6 +581,7 @@ def build_readback(
|
||||
),
|
||||
"latest_visible_harbor_110_repair_waiting": harbor_110_repair_waiting,
|
||||
"latest_visible_harbor_110_repair_running": harbor_110_repair_running,
|
||||
"latest_visible_harbor_110_repair_failed": harbor_110_repair_failed,
|
||||
"latest_visible_harbor_110_repair_status_blocked": (
|
||||
harbor_110_repair_status_blocked
|
||||
),
|
||||
@@ -615,6 +621,9 @@ def build_readback(
|
||||
"harbor_110_repair_visible_waiting_stale": (
|
||||
harbor_110_repair_visible_waiting_stale
|
||||
),
|
||||
"harbor_110_repair_visible_failure_jobs_api_stale": (
|
||||
harbor_110_repair_visible_failure_jobs_api_stale
|
||||
),
|
||||
"latest_visible_cd_host_pressure_classifier": effective_tests_log_classifier[
|
||||
"host_pressure_classifier"
|
||||
],
|
||||
@@ -665,6 +674,11 @@ def build_readback(
|
||||
if latest_cd_visible_blocked
|
||||
else "blocked_current_cd_workflow_waiting_for_runner_or_queue"
|
||||
if latest_cd_waiting
|
||||
else "blocked_harbor_110_repair_failed"
|
||||
if (
|
||||
build_log_classifier["harbor_public_route_blocked_or_retrying"]
|
||||
and harbor_110_repair_failed
|
||||
)
|
||||
else (
|
||||
"blocked_harbor_public_route_unavailable_after_harbor_110_repair_success"
|
||||
)
|
||||
@@ -696,6 +710,8 @@ def build_readback(
|
||||
if harbor_110_repair_waiting
|
||||
else "harbor_110_repair_running"
|
||||
if harbor_110_repair_running
|
||||
else "blocked_harbor_110_repair_failed"
|
||||
if harbor_110_repair_failed
|
||||
else "blocked_harbor_110_repair_run"
|
||||
if harbor_110_repair_blocked
|
||||
else "harbor_110_repair_jobs_stale_or_mismatched"
|
||||
@@ -782,6 +798,7 @@ def build_readback(
|
||||
"harbor_110_repair_run_status": harbor_110_repair_status,
|
||||
"harbor_110_repair_waiting": harbor_110_repair_waiting,
|
||||
"harbor_110_repair_running": harbor_110_repair_running,
|
||||
"harbor_110_repair_failed": harbor_110_repair_failed,
|
||||
"harbor_110_repair_blocked": harbor_110_repair_blocked,
|
||||
"harbor_110_repair_waiting_after_cd_harbor_blocker": (
|
||||
harbor_110_repair_waiting_after_cd_harbor_blocker
|
||||
@@ -813,6 +830,9 @@ def build_readback(
|
||||
"harbor_110_repair_visible_waiting_stale": (
|
||||
harbor_110_repair_visible_waiting_stale
|
||||
),
|
||||
"harbor_110_repair_visible_failure_jobs_api_stale": (
|
||||
harbor_110_repair_visible_failure_jobs_api_stale
|
||||
),
|
||||
},
|
||||
"operation_boundaries": {
|
||||
"public_gitea_read_only": True,
|
||||
|
||||
@@ -132,6 +132,16 @@ def _actions_html_cd_running_harbor_repair_waiting() -> str:
|
||||
"""
|
||||
|
||||
|
||||
def _actions_html_cd_failed_harbor_repair_failed() -> str:
|
||||
return (
|
||||
_actions_html_cd_running_harbor_repair_waiting()
|
||||
.replace('data-tooltip-content="Running"', 'data-tooltip-content="Failure"', 1)
|
||||
.replace('data-tooltip-content="Waiting"', 'data-tooltip-content="Failure"', 1)
|
||||
.replace("4061", "4211")
|
||||
.replace("4060", "4212")
|
||||
)
|
||||
|
||||
|
||||
def _actions_html_harbor_repair_waiting_with_workflow_no_matching() -> str:
|
||||
return """
|
||||
<div class="menu">
|
||||
@@ -1080,6 +1090,36 @@ def test_harbor_repair_waiting_takes_actionable_precedence_after_harbor_blocker(
|
||||
assert payload["rollups"]["harbor_110_repair_blocked"] is True
|
||||
|
||||
|
||||
def test_harbor_repair_failure_takes_precedence_over_stale_jobs_payload() -> None:
|
||||
module = _load_module()
|
||||
payload = module.build_readback(
|
||||
actions_html=_actions_html_cd_failed_harbor_repair_failed(),
|
||||
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(),
|
||||
latest_cd_build_log_http_status=200,
|
||||
latest_cd_build_log_text=_harbor_blocked_log(),
|
||||
)
|
||||
|
||||
assert payload["status"] == "blocked_harbor_110_repair_failed"
|
||||
assert payload["readback"]["latest_visible_harbor_110_repair_run_id"] == "4212"
|
||||
assert payload["readback"]["latest_visible_harbor_110_repair_failed"] is True
|
||||
assert payload["readback"]["latest_visible_harbor_110_repair_blocked"] is True
|
||||
assert payload["readback"]["harbor_110_repair_jobs_stale_or_mismatched"] is True
|
||||
assert (
|
||||
payload["readback"]["harbor_110_repair_visible_failure_jobs_api_stale"]
|
||||
is True
|
||||
)
|
||||
assert payload["rollups"]["harbor_110_repair_failed"] is True
|
||||
assert (
|
||||
payload["rollups"]["harbor_110_repair_visible_failure_jobs_api_stale"]
|
||||
is True
|
||||
)
|
||||
|
||||
|
||||
def test_harbor_retrying_unavailable_marks_inflight_blocker_before_final_failure() -> None:
|
||||
module = _load_module()
|
||||
payload = module.build_readback(
|
||||
|
||||
Reference in New Issue
Block a user