mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-20 16:07:11 +08:00
fix(ql3): classify retained legacy target tables
This commit is contained in:
@@ -93,6 +93,8 @@ function legacyDomain(name: string): LocalReconciliationPlanDomain {
|
||||
}
|
||||
|
||||
function targetDomain(name: string): LocalReconciliationPlanDomain {
|
||||
const retainedLegacyDomain = legacyDomain(name);
|
||||
if (retainedLegacyDomain !== 'unknown') return retainedLegacyDomain;
|
||||
if (name === 'QingLong3SchemaCapabilities' || name.includes('Migration')) {
|
||||
return 'schema_lineage';
|
||||
}
|
||||
|
||||
@@ -5,13 +5,28 @@ const {
|
||||
classifyLocalReconciliationFact,
|
||||
} = require('../dist/deployment/reconciliation/planning/inventory.js');
|
||||
|
||||
test('classifies Legacy runtime instances as preserved run history', () => {
|
||||
assert.equal(
|
||||
classifyLocalReconciliationFact('legacy', 'RunningInstances'),
|
||||
'run_history',
|
||||
);
|
||||
test('classifies known Legacy tables in source and adopted target inventories', () => {
|
||||
const knownLegacyTables = new Map([
|
||||
['Crontabs', 'automation'],
|
||||
['CrontabViews', 'automation'],
|
||||
['Subscriptions', 'automation'],
|
||||
['Envs', 'secret_and_config'],
|
||||
['Auths', 'identity_policy_audit'],
|
||||
['Dependences', 'plugin_package'],
|
||||
['Apps', 'plugin_package'],
|
||||
['CrontabStats', 'run_history'],
|
||||
['RunningInstances', 'run_history'],
|
||||
]);
|
||||
for (const [tableName, domain] of knownLegacyTables) {
|
||||
assert.equal(classifyLocalReconciliationFact('legacy', tableName), domain);
|
||||
assert.equal(classifyLocalReconciliationFact('target', tableName), domain);
|
||||
}
|
||||
assert.equal(
|
||||
classifyLocalReconciliationFact('legacy', 'PluginOwnedState'),
|
||||
'unknown',
|
||||
);
|
||||
assert.equal(
|
||||
classifyLocalReconciliationFact('target', 'PluginOwnedState'),
|
||||
'unknown',
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user