- 为什么:白盒复检 P1——平台侧文件详情抽屉 503 只有文案,需求 §8 要求跳转链接;/monitor/tasks 行没有 URL。 - 做什么:抽出 KnowledgeBaseConsoleURL,finding 与 /monitor/tasks 共用同一拼接;handler 用当前生效测试端点填 weknora_url,前端抽屉透传给 WeKnoraProgress;openapi/需求 §7 同步。 - 补证据:stage=weknora 真库合并用例;对账扫描改为真实 HTTP 桩断言零写;progress 投影断言上游密钥字段不外泄。 - 验证:make verify 17 项 success;go test ./... exit 0;web 648 测试 + build;monitor_tasks 真库集成用例 PASS。
This commit is contained in:
@@ -29,15 +29,19 @@ type MonitorTask struct {
|
||||
TargetScope string `json:"target_scope"`
|
||||
TargetKB string `json:"target_kb"`
|
||||
DocumentID string `json:"document_id"`
|
||||
Action string `json:"action"`
|
||||
Stage string `json:"stage"`
|
||||
Status string `json:"status"`
|
||||
Detail string `json:"detail"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
RetryKind string `json:"retry_kind"`
|
||||
FailureID string `json:"failure_id"`
|
||||
RetryCount int `json:"retry_count"`
|
||||
VersionID string `json:"version_id"`
|
||||
// WeKnoraURL is the console link for this row's target knowledge base. The
|
||||
// handler fills it from the effective test endpoint so the detail drawer can
|
||||
// offer the same jump link as a reconciliation finding; empty = not configured.
|
||||
WeKnoraURL string `json:"weknora_url"`
|
||||
Action string `json:"action"`
|
||||
Stage string `json:"stage"`
|
||||
Status string `json:"status"`
|
||||
Detail string `json:"detail"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
RetryKind string `json:"retry_kind"`
|
||||
FailureID string `json:"failure_id"`
|
||||
RetryCount int `json:"retry_count"`
|
||||
VersionID string `json:"version_id"`
|
||||
}
|
||||
type MonitorTaskPage struct {
|
||||
Items []MonitorTask `json:"items"`
|
||||
|
||||
@@ -128,4 +128,23 @@ func TestMonitorTasksUnifiedPaginationIntegration(t *testing.T) {
|
||||
exec(`UPDATE jobs SET state='retry' WHERE id='mt-fetch-job'`)
|
||||
check("retrying", 0)
|
||||
})
|
||||
t.Run("weknora stage facet merges parsing and indexing in SQL", func(t *testing.T) {
|
||||
insertReviewFixture(t, ctx, pool, 8, "mt-merge-parse", now)
|
||||
insertReviewFixture(t, ctx, pool, 9, "mt-merge-index", now)
|
||||
exec(`UPDATE test_publications SET processing_state='processing' WHERE id='mt-merge-parse'`)
|
||||
exec(`UPDATE test_publications SET processing_state='finalizing' WHERE id='mt-merge-index'`)
|
||||
query := MonitorTaskFilter{Search: "Synthetic mt-merge", Limit: 20}
|
||||
merged, err := store.ListMonitorTasks(ctx, MonitorTaskFilter{Search: query.Search, Stage: "weknora", Limit: query.Limit})
|
||||
if err != nil || merged.Total != 2 {
|
||||
t.Fatalf("weknora facet: %#v %v", merged, err)
|
||||
}
|
||||
parsing, err := store.ListMonitorTasks(ctx, MonitorTaskFilter{Search: query.Search, Stage: "parsing", Limit: query.Limit})
|
||||
if err != nil || parsing.Total != 1 || parsing.Items[0].ID != "mt-merge-parse" {
|
||||
t.Fatalf("parsing facet: %#v %v", parsing, err)
|
||||
}
|
||||
indexing, err := store.ListMonitorTasks(ctx, MonitorTaskFilter{Search: query.Search, Stage: "indexing", Limit: query.Limit})
|
||||
if err != nil || indexing.Total != 1 || indexing.Items[0].ID != "mt-merge-index" {
|
||||
t.Fatalf("indexing facet: %#v %v", indexing, err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user