fix: remove project from ktx config (#95)

This commit is contained in:
Andrey Avtomonov 2026-05-14 17:39:31 +02:00 committed by GitHub
parent 2bca308863
commit ce23aca4c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
70 changed files with 178 additions and 323 deletions

View file

@ -231,7 +231,6 @@ describe('writeLocalScanEnrichmentArtifacts', () => {
tempDir = await mkdtemp(join(tmpdir(), 'ktx-local-enrichment-artifacts-'));
project = await initKtxProject({
projectDir: join(tempDir, 'project'),
projectName: 'warehouse',
});
});

View file

@ -371,7 +371,7 @@ describe('local scan enrichment', () => {
},
},
relationshipSettings: {
...buildDefaultKtxProjectConfig('warehouse').scan.relationships,
...buildDefaultKtxProjectConfig().scan.relationships,
llmProposals: false,
maxLlmTablesPerBatch: 40,
},
@ -383,7 +383,7 @@ describe('local scan enrichment', () => {
it('skips relationship detection when scan relationships are disabled', async () => {
const settings = {
...buildDefaultKtxProjectConfig('warehouse').scan.relationships,
...buildDefaultKtxProjectConfig().scan.relationships,
enabled: false,
};
const result = await runLocalScanEnrichment({
@ -474,7 +474,7 @@ describe('local scan enrichment', () => {
})),
};
const settings = {
...buildDefaultKtxProjectConfig('test').scan.relationships,
...buildDefaultKtxProjectConfig().scan.relationships,
enabled: false,
};

View file

@ -515,8 +515,7 @@ export async function runLocalScanEnrichment(
const now = input.now ?? (() => new Date());
const state = completedKtxScanEnrichmentStateSummary();
const syncId = input.syncId ?? input.context.runId;
const relationshipSettings =
input.relationshipSettings ?? buildDefaultKtxProjectConfig(input.connectionId).scan.relationships;
const relationshipSettings = input.relationshipSettings ?? buildDefaultKtxProjectConfig().scan.relationships;
const inputHash = computeKtxScanEnrichmentInputHash({
snapshot,
mode: input.mode,

View file

@ -105,7 +105,6 @@ async function writeLiveDatabaseConfig(projectDir: string): Promise<void> {
await writeFile(
join(projectDir, 'ktx.yaml'),
[
'project: warehouse',
'connections:',
' warehouse:',
' driver: postgres',
@ -123,7 +122,6 @@ async function writeDatabaseConfigWithoutIngestAdapters(projectDir: string): Pro
await writeFile(
join(projectDir, 'ktx.yaml'),
[
'project: warehouse',
'connections:',
' warehouse:',
' driver: postgres',
@ -184,7 +182,7 @@ describe('local scan', () => {
beforeEach(async () => {
tempDir = await mkdtemp(join(tmpdir(), 'ktx-local-scan-'));
const projectDir = join(tempDir, 'project');
await initKtxProject({ projectDir, projectName: 'warehouse' });
await initKtxProject({ projectDir });
await writeLiveDatabaseConfig(projectDir);
project = await loadKtxProject({ projectDir });
});
@ -1037,7 +1035,6 @@ describe('local scan', () => {
await writeFile(
join(project.projectDir, 'ktx.yaml'),
[
'project: warehouse',
'connections:',
' warehouse:',
' driver: postgres',
@ -1393,7 +1390,6 @@ describe('local scan', () => {
await writeFile(
join(project.projectDir, 'ktx.yaml'),
[
'project: warehouse',
'connections:',
' warehouse:',
' driver: sqlite',
@ -1425,7 +1421,6 @@ describe('local scan', () => {
await writeFile(
join(project.projectDir, 'ktx.yaml'),
[
'project: warehouse',
'connections:',
' warehouse:',
' driver: mysql',
@ -1457,7 +1452,6 @@ describe('local scan', () => {
await writeFile(
join(project.projectDir, 'ktx.yaml'),
[
'project: warehouse',
'connections:',
' warehouse:',
' driver: clickhouse',
@ -1492,7 +1486,6 @@ describe('local scan', () => {
await writeFile(
join(project.projectDir, 'ktx.yaml'),
[
'project: warehouse',
'connections:',
' warehouse:',
' driver: sqlserver',

View file

@ -13,7 +13,6 @@ describe('readLocalScanStructuralSnapshot', () => {
tempDir = await mkdtemp(join(tmpdir(), 'ktx-local-structural-artifacts-'));
project = await initKtxProject({
projectDir: join(tempDir, 'project'),
projectName: 'warehouse',
});
});

View file

@ -19,7 +19,6 @@ async function writeWarehouseConfig(projectDir: string): Promise<void> {
await writeFile(
join(projectDir, 'ktx.yaml'),
[
'project: warehouse',
'connections:',
' warehouse:',
' driver: sqlite',
@ -67,7 +66,7 @@ function liveDatabaseAdapter(): SourceAdapter {
}
async function createLiveDatabaseRun(projectDir: string, runId: string) {
await initKtxProject({ projectDir, projectName: 'warehouse' });
await initKtxProject({ projectDir });
await writeWarehouseConfig(projectDir);
const project = await loadKtxProject({ projectDir });
await runLocalStageOnlyIngest({
@ -283,7 +282,7 @@ describe('local scan relationship artifact reader', () => {
it('returns null when the scan run has no report', async () => {
const projectDir = await mkdtemp(join(tmpdir(), 'ktx-relationship-artifacts-missing-run-'));
try {
await initKtxProject({ projectDir, projectName: 'warehouse' });
await initKtxProject({ projectDir });
const project = await loadKtxProject({ projectDir });
await expect(readLocalScanRelationshipArtifacts(project, 'missing-run')).resolves.toBeNull();

View file

@ -243,7 +243,7 @@ function llmProvider(): KtxLlmProvider {
}
function relationshipSettings() {
return buildDefaultKtxProjectConfig('warehouse').scan.relationships;
return buildDefaultKtxProjectConfig().scan.relationships;
}
function llmOnlyRelationshipSnapshot(): KtxSchemaSnapshot {
@ -557,7 +557,7 @@ describe('production relationship discovery', () => {
`);
const settings = {
...buildDefaultKtxProjectConfig('warehouse').scan.relationships,
...buildDefaultKtxProjectConfig().scan.relationships,
acceptThreshold: 0.99,
reviewThreshold: 0.55,
};
@ -633,7 +633,7 @@ describe('production relationship discovery', () => {
schema: snapshotToKtxEnrichedSchema(richSnapshot),
context: { runId: 'candidate-cap' },
settings: {
...buildDefaultKtxProjectConfig('warehouse').scan.relationships,
...buildDefaultKtxProjectConfig().scan.relationships,
maxCandidatesPerColumn: 1,
},
});

View file

@ -202,7 +202,6 @@ async function projectWithDecisions(
const tempDir = await mkdtemp(join(tmpdir(), 'ktx-relationship-review-apply-'));
const project = await initKtxProject({
projectDir: join(tempDir, 'project'),
projectName: 'warehouse',
});
await project.fileStore.writeFile(
'raw-sources/warehouse/live-database/sync-a/enrichment/relationship-review-decisions.json',

View file

@ -19,11 +19,10 @@ async function writeProjectFile(projectDir: string, relativePath: string, conten
}
async function createProject(projectDir: string): Promise<void> {
await initKtxProject({ projectDir, projectName: 'warehouse' });
await initKtxProject({ projectDir });
await writeFile(
join(projectDir, 'ktx.yaml'),
[
'project: warehouse',
'connections:',
' warehouse:',
' driver: sqlite',