feat(GOV-007): 建立开发库 Schema 基线门禁
This commit is contained in:
@@ -34,6 +34,10 @@ function run(command, args) {
|
||||
* 根目录 verify 脚本会继续串联前端和后端测试,而不需要改变本门禁入口。
|
||||
*/
|
||||
run('npm', ['run', 'test:governance']);
|
||||
run('npm', ['run', 'test:mysql-baseline']);
|
||||
run('npm', ['run', 'test:environment-baseline']);
|
||||
run('npm', ['run', 'test:schema-baseline']);
|
||||
run('npm', ['run', 'schema:verify']);
|
||||
run('npx', ['gitnexus', 'analyze']);
|
||||
|
||||
const status = run('npx', ['gitnexus', 'status']);
|
||||
|
||||
@@ -2,6 +2,7 @@ import { execFileSync } from 'node:child_process';
|
||||
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
import { assertCurrentReleasedBaselinePublished } from '../database/schema-baseline.mjs';
|
||||
import { getFeatureDirectory, validateFeatureId } from './feature-record.mjs';
|
||||
|
||||
const [featureId, slug] = process.argv.slice(2);
|
||||
@@ -15,6 +16,10 @@ const featureDirectory = getFeatureDirectory(repositoryRoot, featureId, slug);
|
||||
const gitnexusDirectory = path.join(featureDirectory, 'gitnexus');
|
||||
const beforeReport = path.join(gitnexusDirectory, 'before.md');
|
||||
|
||||
// Schema 基线必须在新版本的功能档案和 GitNexus 分析之前已经独立提交;
|
||||
// 这里仅做只读验证,绝不在一般功能开发命令中连接数据库或静默生成历史产物。
|
||||
assertCurrentReleasedBaselinePublished(repositoryRoot);
|
||||
|
||||
if (existsSync(beforeReport)) {
|
||||
throw new Error(`开发前报告已存在,为保护历史不会覆盖:${beforeReport}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user