fix(cli): remove primary-source wording from setup output

This commit is contained in:
Andrey Avtomonov 2026-05-13 21:18:18 +02:00
parent efef54a52d
commit bf581b9225
6 changed files with 9 additions and 6 deletions

View file

@ -298,7 +298,7 @@ export function registerSetupCommands(program: Command, context: KtxCliCommandCo
(value, previous: string[]) => [...previous, value],
[],
)
.option('--skip-databases', 'Leave database setup incomplete; KTX cannot work until a primary source is added', false)
.option('--skip-databases', 'Leave database setup incomplete; KTX cannot work until a database is added', false)
.addOption(new Option('--source <type>', 'Source connector type').argParser(sourceType))
.option('--source-connection-id <id>', 'Connection id for source setup')
.option('--source-path <path>', 'Local source path for dbt, MetricFlow, or LookML')

View file

@ -453,6 +453,9 @@ describe('runKtxCli', () => {
]) {
expect(testIo.stdout()).toContain(expected);
}
expect(testIo.stdout()).toContain('KTX cannot work until a database is added');
expect(testIo.stdout()).not.toContain('primary source');
expect(testIo.stdout()).not.toContain('primary sources');
expect(testIo.stdout()).not.toContain('--enable-historic-sql');
expect(testIo.stdout()).not.toContain('--historic-sql-window-days');
expect(testIo.stderr()).toBe('');

View file

@ -621,7 +621,7 @@ describe('setup context build state', () => {
),
).resolves.toEqual({ status: 'failed', projectDir: tempDir });
expect(io.stderr()).toContain('No primary or context sources are configured for a KTX context build.');
expect(io.stderr()).toContain('No databases or context sources are configured for a KTX context build.');
});
it('normalizes legacy detached and paused setup context states to stale', async () => {

View file

@ -788,7 +788,7 @@ export async function runKtxSetupContextStep(
if (args.allowEmpty === true) {
return { status: 'skipped', projectDir: args.projectDir };
}
io.stderr.write('No primary or context sources are configured for a KTX context build.\n');
io.stderr.write('No databases or context sources are configured for a KTX context build.\n');
return { status: 'failed', projectDir: args.projectDir };
}

View file

@ -1190,7 +1190,7 @@ describe('setup sources step', () => {
}
});
it('does not offer context sources until a primary source exists', async () => {
it('does not offer context sources until a database exists', async () => {
const io = makeIo();
const testPrompts = prompts({ multiselect: [['notion']] });
@ -1203,7 +1203,7 @@ describe('setup sources step', () => {
).resolves.toEqual({ status: 'skipped', projectDir });
expect(testPrompts.multiselect).not.toHaveBeenCalled();
expect(io.stdout()).toContain('Connect a primary source before adding context sources.');
expect(io.stdout()).toContain('Connect a database before adding context sources.');
expect(await readFile(join(projectDir, 'ktx.yaml'), 'utf-8')).not.toContain('completed_steps:');
});

View file

@ -1417,7 +1417,7 @@ export async function runKtxSetupSourcesStep(
const prompts = deps.prompts ?? createPromptAdapter();
const project = await loadKtxProject({ projectDir: args.projectDir });
if (!hasPrimarySource(project.config)) {
const message = 'Connect a primary source before adding context sources.';
const message = 'Connect a database before adding context sources.';
if (args.source) {
io.stderr.write(`${message}\n`);
return { status: 'failed', projectDir: args.projectDir };