CI runner can't reach npmjs.org through GFW. Use npmmirror.com mirror for npm package installs, same pattern as pip uses Tsinghua mirror for backend deps.
3.9 KiB
Sprint 01 — Production Stability
Depends on: S00 (critical security fixes) Duration: ~6h Goal: Restore dev deployment, add test gates, fix broken UI states and inaccurate system data.
S01.1 — Fix dev deploy runner label
-
Files:
.gitea/workflows/deploy-dev.yml:15 -
Estimate: 0.5h
-
Done means:
runs-on: nasinstead ofruns-on: ubuntu-latest. CI deploy to dev succeeds. -
Verify by: Push a trivial change to
dev→ workflow runs onnasrunner → deploy succeeds →curl http://nas:4001/api/healthreturns 200 -
Risk: None — this is the same runner used by
deploy.ymlanddeploy-claude-dev-dev.yml. -
S01.1 — Fix dev deploy runner label
S01.2 — Add test gate to dev deploy
-
Files:
.gitea/workflows/deploy-dev.yml -
Estimate: 2h
-
Done means:
deploy-dev.ymlhas backend-tests and frontend-tests jobs that must pass before the deploy job runs (vianeeds). Same test pattern asdeploy.yml. -
Verify by:
- Push code with failing test → tests fail → deploy job skipped
- Push code with passing tests → tests pass → deploy proceeds
- Workflow summary in Gitea UI shows test→deploy dependency clearly
-
Risk: Adds 2-3 minutes to dev deploy cycle. Acceptable trade-off for safety.
-
S01.2 — Add test gate to dev deploy
S01.3 — Add error handling to Docker.svelte
-
Files:
dashboard/frontend/src/routes/Docker.svelte:12-15 -
Estimate: 1h
-
Done means: API errors in
load()are caught. UI shows error state with message and retry button instead of blank page or crash. Same pattern applied toaction()andshowLogs(). -
Verify by:
- Stop docker-socket-proxy → navigate to Docker page → see error message "Docker API unavailable" + retry button
- Start docker-socket-proxy → click retry → containers load
- During normal operation → no regression (page works as before)
-
Risk: Low. Add
let error = $state("")and an{#if error}block in the template. Keep existingloadingstate. -
S01.3 — Add error handling to Docker.svelte
S01.4 — Fix cpu_percent always returning 0
-
Files:
dashboard/backend/routers/system.py:53 -
Estimate: 0.5h
-
Done means: First call to
/api/system/statsreturns accurate CPU percentage (non-zero under load). -
Verify by:
- Restart dashboard backend
- Run
stress --cpu 1on the NAS - Call
/api/system/stats→cpu_percent> 0 - Stop stress → next call shows lower value
-
Risk:
psutil.cpu_percent(interval=0.1)blocks the request for 100ms. This is acceptable for a system stats endpoint. Alternative: callcpu_percent()once at startup (in lifespan) to prime the counter, then useinterval=0in the endpoint. -
S01.4 — Fix cpu_percent always returning 0
S01.5 — Verify production docker-socket-proxy
-
Files:
dashboard/docker-compose.yml -
Estimate: 2h
-
Done means: Production docker-socket-proxy container is running and healthy. Docker API calls from dashboard succeed without timeouts.
-
Verify by:
ssh nas "cd /volume1/docker/nas-dashboard && docker compose ps"→ docker-socket-proxy shows "Up" and "healthy"- Navigate to Docker page in production dashboard → containers load within 5 seconds
- Monitor
/api/docker/containersresponse time → < 2 seconds
-
Risk: If docker-socket-proxy needs to be created from scratch, ensure the compose file defines it correctly.
-
S01.5 — Verify production docker-socket-proxy
Exit criteria
- Push to
dev→ CI deploys successfully onnasrunner - Failing test blocks dev deploy
- Docker page shows error state when API unavailable (not blank/crash)
/api/system/statsreports non-zero CPU under load- Production Docker page loads containers within 5 seconds
- All backend tests pass
- All frontend tests pass