表结构变了之后口径凑不齐参数时照实记下:以前不试算、也不记日志,一声不响地跳过。现在记一条日志写缺哪几个参数(必填、没给值也没有缺省值的入口字段)和参数本来从哪来,同时写进变化记录的 affects.probes(同一版只记一条),变化页的「影响」一块写「「x」v3:缺少参数 start、end,没有试算」;同一条变化再被探查到时这份记录不丢。变化接口给的 affects 缺的几项补上空的

This commit is contained in:
ThearchyHelios
2026-10-19 10:10:38 +08:00
parent a534af6ea1
commit 2d108d116f
7 changed files with 137 additions and 5 deletions
+5
View File
@@ -110,6 +110,11 @@ export const SOURCE_CHANGE_TEXT = {
impactNeeds: '人工确认过、还说着被删的列',
impactRules: '有效记录条件用到了这一列:取值有变时,按它过滤的结果可能漏掉新状态的行',
impactTemplates: (n: number) => `用到这张表的已发布模板 ${formatNumber(n)} 个`,
/** 表结构变了之后没能试算的口径:缺参数的写缺哪几个,别的写原因原话 */
probesTitle: '没有试算的口径',
probeSkipped: (name: string, version: number, missing: string[], reason: string) =>
`「${name}」v${version}:${missing.length ? `缺少参数 ${missing.join('、')},没有试算` : `没有试算(${reason})`}`,
probeFrom: { formal: '参数按最近一次正式运行取', answer: '参数按等价的问数回答取', defaults: '这一版还没有正式运行,只能用入口的缺省值' } as Record<string, string>,
templateImpact: { direct: '写死的 SQL 直接引用', possible: '可能涉及' } as Record<string, string>,
templateVersion: (v: number) => `v${v}`,
breaks: (cols: string[]) => (cols.length
+17 -1
View File
@@ -294,7 +294,8 @@ function Facts({ change: c }: { change: SourceChange }) {
/** 影响面:说到这些列的目录项(测到时和现在的状态)、用到这张表的已发布模板(写死的 SQL 会不会坏)、有效记录条件 */
function Impact({ change: c }: { change: SourceChange }) {
const { catalog, templates, rules_touched: rules } = c.affects
const empty = !catalog.length && !templates.length && !rules
const probes = c.affects.probes ?? []
const empty = !catalog.length && !templates.length && !rules && !probes.length
return (
<Block title={T.impactTitle} attr="impact">
{empty && <p className="text-xs text-faint" data-change-impact-none="">{T.impactNone}</p>}
@@ -343,6 +344,21 @@ function Impact({ change: c }: { change: SourceChange }) {
</ul>
</div>
)}
{probes.length > 0 && (
<div data-change-probes={probes.length}>
<p className="text-2xs font-medium text-dim">{T.probesTitle}</p>
<ul className="mt-1 space-y-0.5">
{probes.map((p) => (
<li key={`${p.workflow_id}:${p.version}`} className="text-xs text-[var(--warn)]" data-change-probe={p.workflow_id}>
{T.probeSkipped(p.name, p.version, p.missing ?? [], p.reason)}
{p.inputs_from && T.probeFrom[p.inputs_from] && (
<span className="ml-1.5 text-2xs text-faint">{T.probeFrom[p.inputs_from]}</span>
)}
</li>
))}
</ul>
</div>
)}
</Block>
)
}
+16
View File
@@ -54,6 +54,22 @@ export interface SourceChangeAffects {
templates: SourceChangeTemplate[]
/** 有效记录条件用到了这一列 */
rules_touched: boolean
/**
* 表结构变了之后口径没能试算的那几版(服务端 ledger/recall._probe_skipped):缺哪几个参数、原因原话、参数本来从哪来。
* 只记没试算的;试算了的结论在召回待办里
*/
probes?: SourceChangeProbe[]
}
export interface SourceChangeProbe {
workflow_id: string
version: number
name: string
outcome: 'skipped'
missing: string[]
reason: string
/** formal 最近一次正式运行 / answer 等价的问数回答 / defaults 入口的缺省值 */
inputs_from?: string
}
/** 现在能做的一个处理动作;ok 为假时 reason 写为什么做不了 */