fix(reboot): tighten windows99 vmx backup blocked host truth
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m22s
CD Pipeline / build-and-deploy (push) Successful in 4m50s
CD Pipeline / post-deploy-checks (push) Successful in 1m45s

This commit is contained in:
Your Name
2026-07-03 18:26:26 +08:00
parent e21d6de5b6
commit 9247446077
10 changed files with 165 additions and 43 deletions

View File

@@ -162,6 +162,8 @@ def build_windows99_vmx_source_backup_search_package(
else _load_backup_search_receipt(operations_dir)
)
receipt_applies = _receipt_applies(receipt, target_aliases)
receipt_next_step = str(receipt.get("next_executable_step") or "").strip()
receipt_safe_next_step = str(receipt.get("safe_next_step") or "").strip()
host_rows = (
_host_rows_from_receipt(receipt, locator)
if receipt_applies
@@ -206,10 +208,16 @@ def build_windows99_vmx_source_backup_search_package(
)
elif receipt_applies and blocked_rows:
status = "blocked_windows99_vmx_backup_source_not_found_some_hosts_unsearched"
next_step = "rerun_backup_search_for_blocked_hosts_or_offline_inventory"
next_step = (
receipt_next_step
or "rerun_backup_search_for_blocked_hosts_or_offline_inventory"
)
safe_next_step = (
"rerun_windows99_vmx_source_backup_search_check_mode_for_blocked_hosts_"
"then_update_receipt_no_write"
receipt_safe_next_step
or (
"rerun_windows99_vmx_source_backup_search_check_mode_for_blocked_hosts_"
"then_update_receipt_no_write"
)
)
elif receipt_applies:
status = "blocked_windows99_vmx_backup_source_not_found"

View File

@@ -895,9 +895,10 @@ def test_awoooi_priority_work_order_readback_routes_closed_backup_to_host_boot_a
assert state["windows99_vmx_source_backup_search_target_aliases"] == ["111"]
assert state["windows99_vmx_source_backup_search_receipt_readback_present"] is True
assert state["windows99_vmx_source_backup_search_host_count"] == 7
assert state["windows99_vmx_source_backup_search_searched_host_count"] == 4
assert state["windows99_vmx_source_backup_search_blocked_host_count"] == 3
assert state["windows99_vmx_source_backup_search_searched_host_count"] == 3
assert state["windows99_vmx_source_backup_search_blocked_host_count"] == 4
assert state["windows99_vmx_source_backup_search_blocked_host_aliases"] == [
"99",
"110",
"188",
"112",
@@ -1090,7 +1091,7 @@ def test_awoooi_priority_work_order_readback_routes_closed_backup_to_host_boot_a
"blocked_windows99_vmx_backup_source_not_found_some_hosts_unsearched"
)
assert payload["summary"]["windows99_vmx_source_backup_search_candidate_source_count"] == 0
assert payload["rollups"]["windows99_vmx_source_backup_search_blocked_host_count"] == 3
assert payload["rollups"]["windows99_vmx_source_backup_search_blocked_host_count"] == 4
assert "service/data/backup readback is green" in payload[
"next_execution_order"
][0]
@@ -1205,7 +1206,7 @@ def test_awoooi_priority_work_order_readback_routes_closed_backup_to_host_boot_a
in_progress["evidence"]["windows99_vmx_source_backup_search_candidate_source_count"]
== 0
)
assert in_progress["evidence"]["windows99_vmx_source_backup_search_blocked_host_count"] == 3
assert in_progress["evidence"]["windows99_vmx_source_backup_search_blocked_host_count"] == 4
assert (
in_progress["evidence"][
"windows99_vmx_source_backup_search_apply_allowed_by_this_package"

View File

@@ -83,12 +83,26 @@ def _backup_search_receipt() -> dict:
"collector_readback_present": True,
"target_host_alias": "99",
"target_vm_aliases": ["111"],
"next_executable_step": (
"continue_verified_backup_inventory_search_or_authorized_console_source_path"
),
"safe_next_step": (
"continue_verified_backup_inventory_search_or_authorized_console_source_path_"
"then_scoped_dry_run_no_write"
),
"host_rows": [
{
"host_alias": "99",
"status": "not_matched",
"status": "blocked_host_alias_unresolved",
"candidate_source_count": 0,
"candidate_source_count_known": True,
"candidate_source_count_known": False,
"candidate_source_fingerprint_count": 0,
},
{
"host_alias": "110",
"status": "blocked_ssh_batchmode_unavailable",
"candidate_source_count": 0,
"candidate_source_count_known": False,
"candidate_source_fingerprint_count": 0,
},
{
@@ -112,6 +126,20 @@ def _backup_search_receipt() -> dict:
"candidate_source_count_known": False,
"candidate_source_fingerprint_count": 0,
},
{
"host_alias": "112",
"status": "blocked_ssh_batchmode_unavailable",
"candidate_source_count": 0,
"candidate_source_count_known": False,
"candidate_source_fingerprint_count": 0,
},
{
"host_alias": "local",
"status": "not_matched",
"candidate_source_count": 0,
"candidate_source_count_known": True,
"candidate_source_fingerprint_count": 0,
},
],
}
@@ -132,14 +160,18 @@ def test_windows99_vmx_source_backup_search_package_builder_is_check_mode_only()
assert payload["target_vm_aliases"] == ["111"]
assert payload["source_locator_candidate_source_count"] == 0
assert payload["receipt_readback_present"] is True
assert payload["search_host_count"] == 4
assert payload["search_host_count"] == 7
assert payload["searched_host_count"] == 3
assert payload["blocked_host_count"] == 1
assert payload["blocked_host_aliases"] == ["188"]
assert payload["blocked_host_count"] == 4
assert payload["blocked_host_aliases"] == ["99", "110", "188", "112"]
assert payload["candidate_source_count"] == 0
assert payload["candidate_source_found"] is False
assert payload["next_executable_step"] == (
"rerun_backup_search_for_blocked_hosts_or_offline_inventory"
"continue_verified_backup_inventory_search_or_authorized_console_source_path"
)
assert payload["safe_next_step"] == (
"continue_verified_backup_inventory_search_or_authorized_console_source_path_"
"then_scoped_dry_run_no_write"
)
assert payload["apply_allowed_by_this_package"] is False
assert payload["raw_path_output"] is False
@@ -183,7 +215,7 @@ def test_windows99_vmx_source_backup_search_endpoint_is_public_safe(
assert payload["schema_version"] == "windows99_vmx_source_backup_search_package_v1"
assert payload["target_vm_aliases"] == ["111"]
assert payload["candidate_source_count"] == 0
assert payload["blocked_host_aliases"] == ["188"]
assert payload["blocked_host_aliases"] == ["99", "110", "188", "112"]
assert payload["public_lan_topology_redacted"] is True
assert payload["raw_path_output"] is False
assert payload["file_content_read"] is False