Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,28 @@ function handleSyncError(err: unknown, action: string): number {

async function runPull(args: string[]): Promise<number> {
const abort = args.includes('--abort');
const repoArg = args.find((a) => !a.startsWith('--'));
const positional = args.filter((a) => !a.startsWith('--'));
const repoArg = positional[0];
const destFile = positional[1];

// Transitional legacy path: whole-file gRPC pull, behind
// DELTIX_ENABLE_GRPC_TRANSFER. Removed once the native commit-based pull is
// confirmed in production.
if (loadEnv().DELTIX_ENABLE_GRPC_TRANSFER && repoArg && destFile) {
const { createDataflowService } = await import('../contexts/dataflow');
try {
const result = await createDataflowService().pull(repoArg, destFile);
printSuccess(`[legacy gRPC] Pull completed for ${repoArg}`, {
bytesReceived: result.bytesReceived,
checksum: result.checksum,
});
return 0;
} catch (err) {
printError(`Pull failed (legacy gRPC): ${String(err)}`);
return 1;
}
}

const identity = await resolveServerIdentity(repoArg);
if (!identity) {
return 1;
Expand Down
9 changes: 9 additions & 0 deletions src/shared/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ const envSchema = z.object({
// when the host already runs a real MySQL service.
DELTIX_LOCAL_HOST: z.string().min(1).default('127.0.0.1'),
DELTIX_LOCAL_PORT: z.coerce.number().int().positive().default(3306),
// Transitional feature flag (Fase 5.9). `deltix pull` is now commit-based
// over REST (native, git-like). When this is enabled AND a destination file
// is passed, `deltix pull` falls back to the legacy whole-file gRPC transfer
// instead. Off by default; kept only to allow an easy rollback/comparison
// until the native path is fully confirmed, then the gRPC pull path is removed.
DELTIX_ENABLE_GRPC_TRANSFER: z
.enum(['true', 'false', '1', '0'])
.default('false')
.transform((v) => v === 'true' || v === '1'),
});

export type Env = z.infer<typeof envSchema>;
Expand Down