fix(reboot): reuse fresh windows99 verifier readback
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m5s
CD Pipeline / build-and-deploy (push) Successful in 6m38s
CD Pipeline / post-deploy-checks (push) Successful in 1m57s

This commit is contained in:
Your Name
2026-07-03 02:58:31 +08:00
parent db425d3b8a
commit 9eabf8c218
2 changed files with 34 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ STOCK_READBACK_TIMEOUT_SECONDS="${STOCK_READBACK_TIMEOUT_SECONDS:-10}"
POST_REBOOT_READINESS_TIMEOUT_SECONDS="${POST_REBOOT_READINESS_TIMEOUT_SECONDS:-60}"
PUBLIC_MAINTENANCE_READBACK_TIMEOUT_SECONDS="${PUBLIC_MAINTENANCE_READBACK_TIMEOUT_SECONDS:-8}"
PUBLIC_MAINTENANCE_URLS="${PUBLIC_MAINTENANCE_URLS:-https://awoooi.wooo.work/api/v1/health https://awoooi.wooo.work/ https://stock.wooo.work/api/v1/system/freshness https://mo.wooo.work/health https://bitan.wooo.work/ https://www.tsenyang.com/}"
WINDOWS99_VMWARE_FALLBACK_MAX_AGE_SECONDS="${WINDOWS99_VMWARE_FALLBACK_MAX_AGE_SECONDS:-900}"
mkdir -p "$TEXTFILE_DIR" "$LOG_DIR"
@@ -104,6 +105,34 @@ if [ -x "$ROOT_DIR/scripts/reboot-recovery/collect-windows99-vmware-verify.sh" ]
|| true
fi
if ! [ -s "$windows99_vmware_file" ] || ! grep -q '^AWOOOI_WINDOWS99_VMWARE_AUTOSTART=1$' "$windows99_vmware_file"; then
if [ -s "$windows99_vmware_file" ]; then
cp "$windows99_vmware_file" "$artifact_dir/windows99-vmware-verify.current-failed.txt" || true
fi
if [[ "$WINDOWS99_VMWARE_FALLBACK_MAX_AGE_SECONDS" =~ ^[1-9][0-9]*$ ]]; then
now_epoch="$(date +%s)"
while IFS= read -r candidate_row; do
candidate_mtime="${candidate_row%% *}"
candidate_path="${candidate_row#* }"
[ "$candidate_path" = "$windows99_vmware_file" ] && continue
[ -s "$candidate_path" ] || continue
grep -q '^AWOOOI_WINDOWS99_VMWARE_AUTOSTART=1$' "$candidate_path" || continue
candidate_epoch="${candidate_mtime%.*}"
candidate_age="$((now_epoch - candidate_epoch))"
[ "$candidate_age" -le "$WINDOWS99_VMWARE_FALLBACK_MAX_AGE_SECONDS" ] || continue
cp "$candidate_path" "$windows99_vmware_file" || break
{
printf '\nwindows99_vmware_verify_fallback_applied=1\n'
printf 'windows99_vmware_verify_fallback_source=%s\n' "$candidate_path"
printf 'windows99_vmware_verify_fallback_age_seconds=%s\n' "$candidate_age"
printf 'windows99_vmware_verify_fallback_max_age_seconds=%s\n' "$WINDOWS99_VMWARE_FALLBACK_MAX_AGE_SECONDS"
printf 'windows99_vmware_verify_current_failed_file=%s\n' "$artifact_dir/windows99-vmware-verify.current-failed.txt"
} >>"$windows99_vmware_file"
break
done < <(find "$LOG_DIR" -mindepth 2 -maxdepth 2 -name windows99-vmware-verify.txt -type f -printf '%T@ %p\n' 2>/dev/null | sort -nr)
fi
fi
scorecard_args=(
"$ROOT_DIR/scripts/reboot-recovery/reboot-auto-recovery-slo-scorecard.py"
--summary-file "$summary_file" \

View File

@@ -107,6 +107,11 @@ def test_exporter_projects_each_scorecard_blocker_to_textfile_metric() -> None:
assert "WINDOWS99_MAX_AUTH_USERS=\"${WINDOWS99_MAX_AUTH_USERS:-5}\"" in text
assert "AWOOOI_WINDOWS99_VMWARE_AUTOSTART=1" in text
assert "scorecard_args+=(--windows99-vmware-file" in text
assert "WINDOWS99_VMWARE_FALLBACK_MAX_AGE_SECONDS" in text
assert "windows99-vmware-verify.current-failed.txt" in text
assert "windows99_vmware_verify_fallback_applied=1" in text
assert "windows99_vmware_verify_fallback_max_age_seconds" in text
assert "find \"$LOG_DIR\" -mindepth 2 -maxdepth 2" in text
assert "POST_REBOOT_READINESS_TIMEOUT_SECONDS" in text
assert "POST_REBOOT_READINESS_SUMMARY_TIMEOUT=1" in text
assert "awoooi_windows99_vmware_missing_vmx_alias" in text