Repository navigation
fix: explain missing MySQL telemetry adapter column - #883
gezerui888 wants to merge 2 commits into
Conversation
Yanami-2K
left a comment
There was a problem hiding this comment.
核对了 #201 的要求:该 issue 剩余的第 2 点包含“应用侧缺列时友好报错”,本 PR 以 Refs 方式只处理这一部分,没有采用 issue 中明确否决的“退回 JSON 解析”,也没有在启动路径写库,范围与描述一致。internal/repo/runs.go 的 QueryRunTelemetry 只在 MySQL 1054 且缺失列为 'adapter' 时包装错误,并用 %w 保留底层驱动错误,其他错误原样返回,不改变正常查询行为。新增的 TestMySQLTelemetryMissingAdapterGuidance 用临时表构造缺列场景,断言了 1054 仍可通过 errors.As 取出、提示里包含列名和迁移脚本,并验证执行 001 脚本后过滤查询恢复正常,断言是实质性的。
非阻塞建议:(1) 该测试依赖 AGENTFLOW_TEST_MYSQL_DSN,默认 CI 会跳过;目前这个 head 上只有开源扫描一项检查,建议维护者触发完整 CI 后再合入。(2) #201 提到同一份 001 脚本还提供 run_logs.level,按日志级别过滤时缺列也会报同样的原始 1054,可以在后续 PR 中用同样方式补上。(3) 测试文件的 patch 在 prepared schema 子测试之后被截断,后半部分没有看全。
|
LoopForge PR Review Bot — reviewed commit Verdict: PASS ✅ What I checked
Note (not a blocker): No further action needed from the author for this version. |
What changed
Refs #201, specifically the external MySQL telemetry diagnostic.
Filtering telemetry fails with a raw MySQL 1054 error when
run_telemetry.adapteris missing. I add guidance to inspect existing columns and apply only missing statements frommigrations/001_run_obs_generated_columns.sql. The diagnostic preserves the underlying error and HTTP 400 status.Scope
Compatibility
Valid telemetry queries keep their existing results. The change performs no schema writes. Startup validation and analytics diagnostics remain separate parts of #201.
Validation
go test -p=2 ./... -count=1 -timeout=180s, with the workflow's browser exclusion: main hit the HTTP package time limit. Both complete HTTP reruns pass with-timeout=600s.bash scripts/build-chatbot.sh: production build succeeds. Frontend tests have the same 341 passes and 27 failures on both branches.go vet ./...,python3 scripts/check-public.py, andgit diff --checkpass.bash scripts/scan-secrets.shexits 126 on both branches. Native gitleaks 8.30.1 passes with the same configuration.Safety
cc @cocofhu