fix: 将 PikaOA 迁移契约校验降级为警告
This commit is contained in:
@@ -351,9 +351,6 @@ function parseTarget(id: string, root: Record<string, unknown>, configLabel: str
|
||||
workerReadinessPath: httpPath(workerProbes.readinessPath, `${path}.probes.worker.readinessPath`),
|
||||
},
|
||||
};
|
||||
if (!target.migration.command.includes("migrate") || !target.migration.command.includes("up")) {
|
||||
throw new Error(`${path}.migration.command 必须显式调用产品 migrate up`);
|
||||
}
|
||||
const secretKeys = secretSources(target).map((item) => item.targetKey);
|
||||
if (new Set(secretKeys).size !== secretKeys.length || secretKeys.includes("pikaoa.yaml")) {
|
||||
throw new Error(`${path} 的 Secret targetKey 必须唯一且不能使用 pikaoa.yaml`);
|
||||
@@ -561,6 +558,7 @@ function safetyBlockers(options: TestTargetOptions, selection: Selection, contex
|
||||
|
||||
function consistencyWarnings(target: TestTargetSpec, context: RenderContext | null): Warning[] {
|
||||
const warnings: Warning[] = [];
|
||||
if (!target.migration.command.includes("migrate") || !target.migration.command.includes("up")) warnings.push(warning("migration-command-unrecognized", "迁移命令未显示产品 migrate up;配置一致性只报告 warning。"));
|
||||
if (!target.source.apiImage.includes("${commit}") || !target.source.workerImage.includes("${commit}") || !target.source.migrationImage.includes("${commit}")) warnings.push(warning("image-template-not-commit-scoped", "API、Worker 或迁移镜像模板未包含 ${commit};版本一致性只报告 warning。"));
|
||||
if (context !== null && (!context.apiImage.includes(context.commit) || !context.workerImage.includes(context.commit) || !context.migrationImage.includes(context.commit))) warnings.push(warning("image-commit-not-visible", "渲染镜像引用未显示选中 commit;该漂移不阻塞当前 MVP。"));
|
||||
if (target.observability.exporterWarning) warnings.push(warning("otel-exporter-warning-only", "OTel exporter 失败按 owning YAML 仅报告 warning,不阻塞业务运行。"));
|
||||
|
||||
Reference in New Issue
Block a user