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
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:
@ -65,3 +65,18 @@ The Docker container intercepted some jobs and ran them in its Alpine environmen
|
||||
**Fix:** Stopped Docker container runner. Switched to runs-on: ubuntu-latest with docker://ubuntu:24.04 containers.
|
||||
|
||||
**Lesson:** Check for multiple runners with same name. Stop after 2 attempts and diagnose root cause.
|
||||
|
||||
## 2026-05-05: Always Use Git → Gitea → Runner CI/CD Pipeline for Deployment
|
||||
**Pattern:** When deploying code changes to any environment, always commit and push to Gitea and let the CI/CD pipeline handle building and deployment.
|
||||
**Why:** Manually copying built files (scp, etc.) bypasses quality gates (format, clippy, test, lint) and is not reproducible. The CI pipeline ensures every change passes all checks before reaching any environment.
|
||||
**Action:** Never manually copy files to servers. Always: commit → push to Gitea → let CI/CD run → deploy through proper pipeline.
|
||||
|
||||
## 2026-05-05: Verify API Response Structure Matches Frontend Expectations
|
||||
**Pattern:** When frontend data doesn't appear, check the API response structure before assuming the UI code is wrong.
|
||||
**Why:** Health checks list was always empty because backend returns `{ checks: [...], total: N }` but frontend used `Array.isArray(res.data) ? res.data : []` which returned `[]` for an object. Maintenance windows worked because they correctly used `res.data?.windows ?? []`.
|
||||
**Action:** When adding new API endpoints, verify the response wrapper structure matches what the frontend expects. Check existing working patterns (like maintenance windows) for the correct data extraction approach.
|
||||
|
||||
## 2026-05-05: Run cargo fmt Before Pushing to Avoid CI Failures
|
||||
**Pattern:** Always run `cargo fmt --all` locally before pushing Rust code changes.
|
||||
**Why:** The CI pipeline has a Rust Format Check gate that will fail if code isn't formatted. This wastes CI runner time and delays deployment.
|
||||
**Action:** Run `cargo fmt --all` as part of local pre-push checklist, alongside `npm run build` for frontend changes.
|
||||
|
||||
Reference in New Issue
Block a user