fix: recognize workflow detail migration in deploy gate

This commit is contained in:
江林铖 2026-08-27 11:09:13 +08:00
parent a0211e2890
commit 7f2fb05bc9
2 changed files with 11 additions and 0 deletions

View File

@ -1504,6 +1504,7 @@ const expectedMigrationNames = new Set([
'20260820_add_ding_workflow_snapshots',
'20260824_expand_ding_workflow_insights',
'20260826_add_ding_workflow_demand_type',
'20260827_add_ding_workflow_detail_fields',
]);
if (migrations.length !== expectedMigrationNames.size
|| migrations.some((item) => !expectedMigrationNames.has(item && item.name)

View File

@ -52,3 +52,13 @@ test('deployment SSH hops keep long builds and cutovers alive', () => {
assert.match(source, /TCPKeepAlive=yes/)
}
})
test('migration deployment gate recognizes the latest approved schema migration', () => {
const source = readFileSync(new URL('./git-incremental-deploy.ps1', import.meta.url), 'utf8')
const gateStart = source.indexOf('const expectedMigrationNames = new Set([')
const gateEnd = source.indexOf(']);', gateStart)
assert.ok(gateStart >= 0 && gateEnd > gateStart, 'migration gate list is missing')
const gate = source.slice(gateStart, gateEnd)
assert.match(gate, /20260827_add_ding_workflow_detail_fields/)
})