Private
Public Access
1
0

fix: add HealthCheckListResponse type to match API response structure
Some checks failed
CI Pipeline / Rust Format Check (push) Successful in 6s
CI Pipeline / Clippy Lints (push) Successful in 46s
CI Pipeline / Rust Unit Tests (push) Successful in 1m1s
CI Pipeline / Security Audit (push) Successful in 4s
CI Pipeline / Frontend Lint & Type Check (push) Failing after 10s
CI Pipeline / Build .deb & Release (push) Has been skipped

- Added HealthCheckListResponse type { checks: [...], total: number }
- Updated healthChecksApi.list() return type to HealthCheckListResponse
- Fixed HostDetailPage to use res.data?.checks instead of Array.isArray
- Added Target column to health checks table
- Added git pre-commit/pre-push hooks to prevent format CI failures
- Updated lessons.md
This commit is contained in:
2026-05-06 16:18:29 +00:00
parent 12d640e5de
commit 0e9cb1c915
6 changed files with 119 additions and 1 deletions

33
scripts/git-hooks/pre-commit Executable file
View File

@ -0,0 +1,33 @@
#!/usr/bin/env bash
# =============================================================================
# Linux Patch Manager — Pre-Commit Hook
# =============================================================================
# Auto-formats Rust code and runs frontend type check before each commit.
# Prevents CI format-check failures by ensuring code is always formatted.
# Install: ./scripts/git-hooks/install.sh
# =============================================================================
set -euo pipefail
REPO_ROOT="$(git rev-parse --show-toplevel)"
# ── Rust auto-format ──────────────────────────────────────────────────────────
if [[ -f "${REPO_ROOT}/Cargo.toml" ]]; then
echo "[pre-commit] Running cargo fmt --all ..."
cargo fmt --all --manifest-path "${REPO_ROOT}/Cargo.toml" 2>/dev/null
# Re-stage any files that cargo fmt reformatted (including previously unstaged)
STAGED_RS=$(git diff --name-only --diff-filter=ACM -- '*.rs')
if [[ -n "${STAGED_RS}" ]]; then
git add ${STAGED_RS}
fi
fi
# ── Frontend type check ─────────────────────────────────────────────────────
if [[ -f "${REPO_ROOT}/frontend/package.json" ]]; then
echo "[pre-commit] Running TypeScript type check ..."
cd "${REPO_ROOT}/frontend"
npx tsc --noEmit 2>/dev/null
fi
echo "[pre-commit] All checks passed ✓"