feat: add migrations, test scripts, and utility tools
- Add database migrations (006-028) for face recognition, identity, file_uuid - Add test scripts for ASR, face, search, processing - Add portal frontend (Tauri) - Add config, benchmark, and monitoring utilities - Add model checkpoints and pretrained model references
This commit is contained in:
163
release/RELEASE_TEST_REPORT.md
Normal file
163
release/RELEASE_TEST_REPORT.md
Normal file
@@ -0,0 +1,163 @@
|
||||
# Release v1.0.0 測試報告
|
||||
|
||||
**測試日期**: 2026-04-30
|
||||
**Binary Build**: 2026-04-30 14:44:33
|
||||
**Port**: 3002
|
||||
**Schema**: public (已同步 V4.0)
|
||||
|
||||
---
|
||||
|
||||
## 測試結果摘要
|
||||
|
||||
| # | Category | Endpoint | Status | 說明 |
|
||||
|---|----------|----------|--------|------|
|
||||
| 1 | Health | `GET /health` | ✅ PASS | 正常回應 |
|
||||
| 2 | Health | `GET /health/detailed` | ✅ PASS | 4 服務全部正常 |
|
||||
| 3 | Videos | `GET /api/v1/videos` | ✅ PASS | 20 筆影片 |
|
||||
| 4 | Stats | `GET /api/v1/stats/ingest` | ✅ PASS | 20 videos, 4018 chunks |
|
||||
| 5 | Identity | `GET /api/v1/identities` | ✅ PASS | 2 筆身份 |
|
||||
| 6 | Search | `POST /api/v1/search` | ✅ PASS | 3 筆結果 |
|
||||
| 7 | PreChunks | `GET /api/v1/videos/:uuid/pre_chunks` | ✅ PASS | 0 筆 (正常) |
|
||||
| 8 | Faces | `GET /api/v1/faces/candidates` | ✅ PASS | 78 筆候選 |
|
||||
| 9 | Details | `GET /api/v1/videos/:uuid/details` | ✅ PASS | chunk 正常 |
|
||||
| 10 | Stats | `GET /api/v1/stats/inference` | ✅ PASS | Ollama + llama-server OK |
|
||||
| 11 | Stats | `GET /api/v1/stats/sftpgo` | ✅ PASS | 103 檔案 |
|
||||
| 12 | Jobs | `GET /api/v1/jobs` | ✅ PASS | 9 筆工作 |
|
||||
|
||||
**總結**: 12/12 通過 ✅
|
||||
|
||||
---
|
||||
|
||||
## 問題與修正
|
||||
|
||||
### 問題 1: Schema 不同步 (計劃缺失)
|
||||
|
||||
**根本原因**: 開發期間沒有建立 public schema 同步機制。
|
||||
|
||||
**修正**:
|
||||
1. 建立 `migrate_public_v4_complete.sql` migration 腳本
|
||||
2. 新增 missing columns: `parent_uuid`, `summary_text`, `metadata_version`, `content_version`, `file_uuid`, `bbox`
|
||||
3. 新增 missing tables: `file_identities`, `pre_chunks` (已存在)
|
||||
|
||||
### 問題 2: `parent_uuid` 欄位遺失於 SQL 查詢
|
||||
|
||||
**根本原因**: `search_videos` 函式的 `columns` 字串缺少 `parent_uuid`,但 `VideoRow` struct 有該欄位,導致 sqlx 映射失敗。
|
||||
|
||||
**修正**: 在 `src/core/db/postgres_db.rs` 的 `columns` 字串添加 `parent_uuid`。
|
||||
|
||||
```rust
|
||||
// Before
|
||||
let columns = "id, file_uuid, ..., total_frames";
|
||||
|
||||
// After
|
||||
let columns = "id, file_uuid, ..., total_frames, parent_uuid";
|
||||
```
|
||||
|
||||
### 計劃缺失分析
|
||||
|
||||
開發期間沒有明確的 schema 同步策略:
|
||||
|
||||
1. **雙 schema 策略未定義**:`dev` schema 用於 playground (3003),`public` schema 用於 production (3002),但沒有明確規定何時同步。
|
||||
2. **開發集中在 dev schema**:所有新功能、處理器、API 都在 dev schema 上開發和測試。
|
||||
3. **沒有 migration 腳本**:V3.x → V4.0 的 schema 變更沒有自動化 migration 腳本。
|
||||
4. **release 前未檢查**:沒有檢查 public schema 是否符合程式碼預期的欄位結構。
|
||||
5. **測試隔離不足**:pre-flight check 只檢查服務狀態,沒有檢查 schema 版本。
|
||||
|
||||
### 具體差異
|
||||
|
||||
| Table | public (V3.x) 缺少 | dev (V4.0) 有 |
|
||||
|-------|-------------------|---------------|
|
||||
| videos | `parent_uuid` | ✅ |
|
||||
| chunks | `summary_text`, `metadata_version`, `content_version` | ✅ |
|
||||
| face_detections | `file_uuid` (用 `video_uuid`), `bbox` (用 x/y/width/height) | ✅ |
|
||||
|
||||
---
|
||||
|
||||
## 解決方案
|
||||
|
||||
### 方案 A: 更新 .env(快速修復)
|
||||
```bash
|
||||
# 在 .env 中添加
|
||||
DATABASE_SCHEMA=dev
|
||||
```
|
||||
|
||||
**效果**:Production binary 將連接 dev schema,該 schema 已符合 V4.0 結構。
|
||||
|
||||
### 方案 B: Migration public schema(正式方案)
|
||||
執行 schema migration 將 public schema 更新為 V4.0 結構,然後再部署。
|
||||
|
||||
---
|
||||
|
||||
## Release Package 清單
|
||||
|
||||
| 檔案 | 大小 | 狀態 |
|
||||
|------|------|------|
|
||||
| `momentry_core_v1.0.0_source.zip` | 5.9M | ✅ 已打包 |
|
||||
| `output_json_v1.0.0.zip` | 9.5M | ✅ 已打包 |
|
||||
| `docs_v1.0.zip` | 1.4M | ✅ 已打包 |
|
||||
| `dev_data_v1.0.0.sql` | 7.3M | ✅ 已打包 |
|
||||
| `public_schema_v1.0.0.sql` | 134K | ✅ 已打包 |
|
||||
| `momentry_v1.0.0` | 27M | ✅ 已建置 |
|
||||
| `momentry_v0_backup` | 26M | ✅ 已備份 |
|
||||
| `RELEASE_INFO.txt` | - | ✅ 已建立 |
|
||||
|
||||
---
|
||||
|
||||
## Pre-flight Check 結果
|
||||
|
||||
| Service | Status |
|
||||
|---------|--------|
|
||||
| PostgreSQL | ✅ |
|
||||
| Redis | ✅ |
|
||||
| MongoDB | ✅ |
|
||||
| Qdrant | ✅ |
|
||||
| Ollama (nomic-embed-text) | ✅ |
|
||||
| llama-server (gemma4_e4b_q5) | ✅ |
|
||||
| ffmpeg/ffprobe | ✅ |
|
||||
| Python 3.11 | ✅ |
|
||||
| SFTPGo | ✅ |
|
||||
| Disk Usage (1%) | ✅ |
|
||||
|
||||
**總結**: 16 passed, 0 failed, 1 warning (port 3002 in use)
|
||||
|
||||
---
|
||||
|
||||
## 建議動作
|
||||
|
||||
1. ~~在 .env 添加 `DATABASE_SCHEMA=dev`~~ (已修正,不再需要)
|
||||
2. ~~執行 schema migration~~ (已完成)
|
||||
3. ~~修復 `parent_uuid` SQL 查詢~~ (已完成)
|
||||
4. ✅ **更新 Release SOP** - 添加 schema 同步為必要步驟
|
||||
5. ✅ **建立 migration 腳本** - `migrate_public_v4_complete.sql`
|
||||
6. **下次 release 前**:執行 `release_preflight_check.sh` 並確認 schema 版本
|
||||
|
||||
---
|
||||
|
||||
## Release Package 清單
|
||||
|
||||
| 檔案 | 大小 | 狀態 |
|
||||
|------|------|------|
|
||||
| `momentry_core_v1.0.0_source.zip` | 5.9M | ✅ 已打包 |
|
||||
| `output_json_v1.0.0.zip` | 9.5M | ✅ 已打包 |
|
||||
| `docs_v1.0.zip` | 1.4M | ✅ 已打包 |
|
||||
| `dev_data_v1.0.0.sql` | 7.3M | ✅ 已打包 |
|
||||
| `public_schema_v1.0.0.sql` | 134K | ✅ 已打包 |
|
||||
| `momentry_v1.0.0` | 27M | ✅ 已建置 (含修正) |
|
||||
| `momentry_v0_backup` | 26M | ✅ 已備份 |
|
||||
| `migrate_public_v4_complete.sql` | - | ✅ 已建立 |
|
||||
| `RELEASE_INFO.txt` | - | ✅ 已建立 |
|
||||
| `RELEASE_SOP.md` | - | ✅ 已建立 |
|
||||
| `RELEASE_TEST_REPORT.md` | - | ✅ 已建立 |
|
||||
|
||||
---
|
||||
|
||||
## Release Checklist
|
||||
|
||||
- [x] Phase 1: 預檢通過 (services, code)
|
||||
- [x] Phase 2: 打包完成 (source, data, docs, binary)
|
||||
- [x] Phase 3: Schema 同步完成且驗證通過
|
||||
- [x] Phase 4: 部署完成,服務啟動正常
|
||||
- [x] Phase 5: API 測試通過 (12/12 endpoints)
|
||||
- [x] Phase 6: 清理完成 (manifest, reports)
|
||||
- [x] Release SOP 已更新
|
||||
- [x] Lessons Learned 已記錄
|
||||
Reference in New Issue
Block a user