@fabricorg/databricks-testkit 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/{chunk-FBADA7LQ.js → chunk-SCVVMUAF.js} +50 -3
- package/dist/chunk-SCVVMUAF.js.map +1 -0
- package/dist/index.cjs +593 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +241 -2
- package/dist/index.d.ts +241 -2
- package/dist/index.js +529 -5
- package/dist/index.js.map +1 -1
- package/dist/parity.cjs +48 -1
- package/dist/parity.cjs.map +1 -1
- package/dist/parity.js +1 -1
- package/dist/{workspace-context-AIUYISUS.js → workspace-context-VLBKMX3V.js} +3 -3
- package/dist/{workspace-context-AIUYISUS.js.map → workspace-context-VLBKMX3V.js.map} +1 -1
- package/package.json +2 -2
- package/dist/chunk-FBADA7LQ.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -131,7 +131,8 @@ declare function toNamedParameters(sql: string, params: readonly unknown[]): {
|
|
|
131
131
|
declare function parseStatementRows(response: StatementResponse): Record<string, unknown>[];
|
|
132
132
|
/**
|
|
133
133
|
* Auth precedence (ADR-0006): DATABRICKS_BEARER (pre-minted, CI) →
|
|
134
|
-
*
|
|
134
|
+
* explicit env/file OIDC federation → DATABRICKS_CLIENT_ID/SECRET (OAuth
|
|
135
|
+
* M2M) → DATABRICKS_TOKEN (legacy PAT).
|
|
135
136
|
*/
|
|
136
137
|
declare function createClientFromEnv(env: Record<string, string | undefined>, fetchImpl?: typeof fetch): DatabricksRestClient;
|
|
137
138
|
declare function resolveTokenProvider(host: string, env: Record<string, string | undefined>, fetchImpl?: typeof fetch): string | (() => Promise<string>);
|
|
@@ -208,6 +209,23 @@ interface LiveCheckResult {
|
|
|
208
209
|
details?: unknown;
|
|
209
210
|
error?: string;
|
|
210
211
|
}
|
|
212
|
+
type TargetPackMaturity = 'proposed' | 'building' | 'shipped' | 'live-gated' | 'certifying' | 'certified';
|
|
213
|
+
interface TargetPackEvidenceMetadata {
|
|
214
|
+
id: string;
|
|
215
|
+
name: string;
|
|
216
|
+
version: string;
|
|
217
|
+
maturity: TargetPackMaturity;
|
|
218
|
+
capabilities: string[];
|
|
219
|
+
docsUrl?: string;
|
|
220
|
+
certificationScopes: string[];
|
|
221
|
+
target: {
|
|
222
|
+
cloud?: string;
|
|
223
|
+
region?: string;
|
|
224
|
+
workspace?: string;
|
|
225
|
+
runtime?: string;
|
|
226
|
+
compute?: string;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
211
229
|
interface LiveEvidence {
|
|
212
230
|
schemaVersion: 1;
|
|
213
231
|
kind: 'databricks-live-suite';
|
|
@@ -216,6 +234,7 @@ interface LiveEvidence {
|
|
|
216
234
|
success: boolean;
|
|
217
235
|
required: string[];
|
|
218
236
|
results: LiveCheckResult[];
|
|
237
|
+
targetPack?: TargetPackEvidenceMetadata;
|
|
219
238
|
}
|
|
220
239
|
interface LiveSuiteSpec {
|
|
221
240
|
checks: readonly LiveCheck[];
|
|
@@ -223,6 +242,7 @@ interface LiveSuiteSpec {
|
|
|
223
242
|
evidencePath?: string;
|
|
224
243
|
junitPath?: string;
|
|
225
244
|
env?: Record<string, string | undefined>;
|
|
245
|
+
targetPack?: TargetPackEvidenceMetadata;
|
|
226
246
|
}
|
|
227
247
|
interface LiveSuiteRuntime {
|
|
228
248
|
warehouse?: ExecutionContext;
|
|
@@ -350,4 +370,223 @@ declare function serverlessComputeCheck(): LiveCheck;
|
|
|
350
370
|
/** Launch a disposable classic job cluster and require the shared notebook probe to succeed. */
|
|
351
371
|
declare function classicComputeCheck(): LiveCheck;
|
|
352
372
|
|
|
353
|
-
|
|
373
|
+
interface TargetPackRequirement {
|
|
374
|
+
id: string;
|
|
375
|
+
description: string;
|
|
376
|
+
/** At least one named environment variable must be present. */
|
|
377
|
+
anyOf: readonly string[];
|
|
378
|
+
required?: boolean;
|
|
379
|
+
secret?: boolean;
|
|
380
|
+
}
|
|
381
|
+
interface TargetPackSpec {
|
|
382
|
+
id: string;
|
|
383
|
+
name: string;
|
|
384
|
+
description: string;
|
|
385
|
+
version: string;
|
|
386
|
+
maturity: TargetPackMaturity;
|
|
387
|
+
capabilities: readonly string[];
|
|
388
|
+
checks: readonly LiveCheck[] | (() => readonly LiveCheck[]);
|
|
389
|
+
requiredChecks?: readonly string[];
|
|
390
|
+
requirements?: readonly TargetPackRequirement[];
|
|
391
|
+
docsUrl?: string;
|
|
392
|
+
certificationScopes?: readonly string[];
|
|
393
|
+
}
|
|
394
|
+
interface TargetPack extends Omit<TargetPackSpec, 'checks'> {
|
|
395
|
+
checks(): readonly LiveCheck[];
|
|
396
|
+
}
|
|
397
|
+
interface TargetPackDoctorRequirement {
|
|
398
|
+
id: string;
|
|
399
|
+
description: string;
|
|
400
|
+
satisfied: boolean;
|
|
401
|
+
required: boolean;
|
|
402
|
+
variables: string[];
|
|
403
|
+
}
|
|
404
|
+
interface TargetPackDoctorCheck {
|
|
405
|
+
id: string;
|
|
406
|
+
description: string;
|
|
407
|
+
configured: boolean;
|
|
408
|
+
required: boolean;
|
|
409
|
+
}
|
|
410
|
+
interface TargetPackDoctorResult {
|
|
411
|
+
pack: Pick<TargetPack, 'id' | 'name' | 'version' | 'maturity'>;
|
|
412
|
+
ready: boolean;
|
|
413
|
+
requirements: TargetPackDoctorRequirement[];
|
|
414
|
+
checks: TargetPackDoctorCheck[];
|
|
415
|
+
missingRequirements: string[];
|
|
416
|
+
missingRequiredChecks: string[];
|
|
417
|
+
}
|
|
418
|
+
interface RunTargetPackOptions {
|
|
419
|
+
env?: Record<string, string | undefined>;
|
|
420
|
+
requiredChecks?: readonly string[];
|
|
421
|
+
evidencePath?: string;
|
|
422
|
+
junitPath?: string;
|
|
423
|
+
}
|
|
424
|
+
interface DefinedTargetPackRun {
|
|
425
|
+
pack: TargetPack;
|
|
426
|
+
run(runtime?: LiveSuiteRuntime): Promise<LiveEvidence | undefined>;
|
|
427
|
+
}
|
|
428
|
+
declare function defineTargetPack(spec: TargetPackSpec): TargetPack;
|
|
429
|
+
declare function createTargetPackRegistry(packs: readonly TargetPack[]): ReadonlyMap<string, TargetPack>;
|
|
430
|
+
declare function doctorTargetPack(pack: TargetPack, env?: Record<string, string | undefined>, requiredChecks?: readonly string[]): TargetPackDoctorResult;
|
|
431
|
+
declare function defineTargetPackRun(pack: TargetPack, options?: RunTargetPackOptions): DefinedTargetPackRun;
|
|
432
|
+
declare function runTargetPack(pack: TargetPack, options?: RunTargetPackOptions, runtime?: LiveSuiteRuntime): Promise<LiveEvidence | undefined>;
|
|
433
|
+
|
|
434
|
+
declare function createSqlDeltaFoundationPack(): TargetPack;
|
|
435
|
+
declare function createLakeflowFoundationPack(): TargetPack;
|
|
436
|
+
declare function createJobsCodeFoundationPack(): TargetPack;
|
|
437
|
+
declare function createUnityStorageFoundationPack(): TargetPack;
|
|
438
|
+
declare function createAppsOperationalFoundationPack(): TargetPack;
|
|
439
|
+
declare function createFoundationTargetPacks(): readonly TargetPack[];
|
|
440
|
+
declare const foundationTargetPacks: readonly TargetPack[];
|
|
441
|
+
|
|
442
|
+
interface JobTaskDependency {
|
|
443
|
+
task_key: string;
|
|
444
|
+
outcome?: string;
|
|
445
|
+
}
|
|
446
|
+
interface JobTaskBase {
|
|
447
|
+
task_key: string;
|
|
448
|
+
depends_on?: JobTaskDependency[];
|
|
449
|
+
run_if?: 'ALL_SUCCESS' | 'AT_LEAST_ONE_SUCCESS' | 'NONE_FAILED' | 'ALL_DONE' | 'AT_LEAST_ONE_FAILED' | 'ALL_FAILED';
|
|
450
|
+
timeout_seconds?: number;
|
|
451
|
+
max_retries?: number;
|
|
452
|
+
min_retry_interval_millis?: number;
|
|
453
|
+
retry_on_timeout?: boolean;
|
|
454
|
+
existing_cluster_id?: string;
|
|
455
|
+
job_cluster_key?: string;
|
|
456
|
+
environment_key?: string;
|
|
457
|
+
}
|
|
458
|
+
interface NotebookJobTask extends JobTaskBase {
|
|
459
|
+
notebook_task: {
|
|
460
|
+
notebook_path: string;
|
|
461
|
+
base_parameters?: Record<string, string>;
|
|
462
|
+
source?: 'WORKSPACE' | 'GIT';
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
interface PythonWheelJobTask extends JobTaskBase {
|
|
466
|
+
python_wheel_task: {
|
|
467
|
+
package_name: string;
|
|
468
|
+
entry_point: string;
|
|
469
|
+
parameters?: string[];
|
|
470
|
+
named_parameters?: Record<string, string>;
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
interface SparkJarJobTask extends JobTaskBase {
|
|
474
|
+
spark_jar_task: {
|
|
475
|
+
main_class_name: string;
|
|
476
|
+
parameters?: string[];
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
interface SparkPythonJobTask extends JobTaskBase {
|
|
480
|
+
spark_python_task: {
|
|
481
|
+
python_file: string;
|
|
482
|
+
parameters?: string[];
|
|
483
|
+
source?: 'WORKSPACE' | 'GIT';
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
interface SparkSubmitJobTask extends JobTaskBase {
|
|
487
|
+
spark_submit_task: {
|
|
488
|
+
parameters: string[];
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
interface PipelineJobTask extends JobTaskBase {
|
|
492
|
+
pipeline_task: {
|
|
493
|
+
pipeline_id: string;
|
|
494
|
+
full_refresh?: boolean;
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
interface SqlJobTask extends JobTaskBase {
|
|
498
|
+
sql_task: Record<string, unknown> & {
|
|
499
|
+
warehouse_id: string;
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
interface DbtJobTask extends JobTaskBase {
|
|
503
|
+
dbt_task: Record<string, unknown> & {
|
|
504
|
+
commands: string[];
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
interface RunJobTask extends JobTaskBase {
|
|
508
|
+
run_job_task: {
|
|
509
|
+
job_id: number;
|
|
510
|
+
job_parameters?: Record<string, string>;
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
interface ConditionJobTask extends JobTaskBase {
|
|
514
|
+
condition_task: {
|
|
515
|
+
left: string;
|
|
516
|
+
op: 'EQUAL_TO' | 'NOT_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL';
|
|
517
|
+
right: string;
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
interface ForEachJobTask extends JobTaskBase {
|
|
521
|
+
for_each_task: {
|
|
522
|
+
inputs: string;
|
|
523
|
+
concurrency?: number;
|
|
524
|
+
task: Exclude<DatabricksJobTask, ForEachJobTask>;
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
type DatabricksJobTask = NotebookJobTask | PythonWheelJobTask | SparkJarJobTask | SparkPythonJobTask | SparkSubmitJobTask | PipelineJobTask | SqlJobTask | DbtJobTask | RunJobTask | ConditionJobTask | ForEachJobTask;
|
|
528
|
+
interface JobsSubmitRequest {
|
|
529
|
+
run_name: string;
|
|
530
|
+
tasks: DatabricksJobTask[];
|
|
531
|
+
parameters?: Array<{
|
|
532
|
+
name: string;
|
|
533
|
+
default: string;
|
|
534
|
+
}>;
|
|
535
|
+
job_clusters?: Array<Record<string, unknown> & {
|
|
536
|
+
job_cluster_key: string;
|
|
537
|
+
}>;
|
|
538
|
+
environments?: Array<Record<string, unknown> & {
|
|
539
|
+
environment_key: string;
|
|
540
|
+
}>;
|
|
541
|
+
git_source?: Record<string, unknown>;
|
|
542
|
+
timeout_seconds?: number;
|
|
543
|
+
idempotency_token?: string;
|
|
544
|
+
}
|
|
545
|
+
interface JobTaskRunState {
|
|
546
|
+
taskKey: string;
|
|
547
|
+
runId?: number;
|
|
548
|
+
lifeCycleState: string;
|
|
549
|
+
resultState: string;
|
|
550
|
+
stateMessage?: string;
|
|
551
|
+
}
|
|
552
|
+
interface JobOrchestrationRun {
|
|
553
|
+
runId: number;
|
|
554
|
+
lifeCycleState: string;
|
|
555
|
+
resultState: string;
|
|
556
|
+
tasks: JobTaskRunState[];
|
|
557
|
+
raw: Record<string, unknown>;
|
|
558
|
+
}
|
|
559
|
+
interface JobWaitOptions {
|
|
560
|
+
timeoutMs?: number;
|
|
561
|
+
pollIntervalMs?: number;
|
|
562
|
+
}
|
|
563
|
+
interface JobRepairOptions {
|
|
564
|
+
rerunTasks?: string[];
|
|
565
|
+
latestRepairId?: number;
|
|
566
|
+
}
|
|
567
|
+
interface JobOrchestrationLiveSpec {
|
|
568
|
+
request: JobsSubmitRequest;
|
|
569
|
+
expectedResult?: string;
|
|
570
|
+
expectedTasks?: Record<string, string>;
|
|
571
|
+
repairFailedTasks?: boolean;
|
|
572
|
+
}
|
|
573
|
+
declare class DatabricksJobsAdapter {
|
|
574
|
+
private readonly client;
|
|
575
|
+
constructor(client: WorkspaceClientLike);
|
|
576
|
+
submit(request: JobsSubmitRequest): Promise<number>;
|
|
577
|
+
get(runId: number): Promise<JobOrchestrationRun>;
|
|
578
|
+
wait(runId: number, options?: JobWaitOptions): Promise<JobOrchestrationRun>;
|
|
579
|
+
cancel(runId: number): Promise<void>;
|
|
580
|
+
repair(runId: number, options?: JobRepairOptions): Promise<number>;
|
|
581
|
+
}
|
|
582
|
+
declare function validateJobGraph(tasks: readonly DatabricksJobTask[]): void;
|
|
583
|
+
declare function jobsOrchestrationCheck(): LiveCheck;
|
|
584
|
+
declare function parseJobOrchestrationLiveSpec(value: string): JobOrchestrationLiveSpec;
|
|
585
|
+
declare function normalizeJobRun(fallbackRunId: number, raw: Record<string, unknown>): JobOrchestrationRun;
|
|
586
|
+
|
|
587
|
+
declare function createLakeflowJobsTargetPack(): TargetPack;
|
|
588
|
+
|
|
589
|
+
declare function createBuiltinTargetPacks(): readonly TargetPack[];
|
|
590
|
+
declare const builtinTargetPacks: readonly TargetPack[];
|
|
591
|
+
|
|
592
|
+
export { type AppHealthCheckOptions, type AutoLoaderCheckOptions, type ConditionJobTask, type CreateContextOptions, type DatabricksJobTask, DatabricksJobsAdapter, type DbtJobTask, type DefinedLiveSuite, type DefinedTargetPackRun, type DeltaColumnContract, type DuckDbConnectionLike, type DuckDbContextOptions, type EphemeralLakebaseBranch, type ExecutionContext, type ForEachJobTask, type JobOrchestrationLiveSpec, type JobOrchestrationRun, type JobRepairOptions, type JobTaskBase, type JobTaskDependency, type JobTaskRunState, type JobWaitOptions, type JobsSubmitRequest, type LakebaseBranchOptions, type LakebaseCheckOptions, type LakebaseControlClient, type LiveCheck, type LiveCheckContext, type LiveCheckResult, type LiveCheckStatus, type LiveEvidence, type LiveSuiteRuntime, type LiveSuiteSpec, type MockDatabricksClient, type NotebookJobTask, type PipelineJobTask, type PollOptions, type PythonWheelJobTask, type RecordedCall, type RunJobTask, type RunTargetPackOptions, type SecretRotationCheckOptions, type SparkJarJobTask, type SparkPythonJobTask, type SparkSubmitJobTask, type SqlJobTask, TableFixture, type TargetPack, type TargetPackDoctorCheck, type TargetPackDoctorRequirement, type TargetPackDoctorResult, type TargetPackEvidenceMetadata, type TargetPackMaturity, type TargetPackRequirement, type TargetPackSpec, type TestProfile, type VolumeIOCheckOptions, type WorkspaceClientLike, type WorkspaceContextOptions, appHealthCheck, assertDeltaContract, autoLoaderIngestionCheck, backupRestoreCheck, builtinTargetPacks, classicComputeCheck, compareToGolden, createAppsOperationalFoundationPack, createBuiltinTargetPacks, createClientFromEnv, createDuckDbContext, createEphemeralLakebaseBranch, createExecutionContext, createFoundationTargetPacks, createJobsCodeFoundationPack, createLakebaseTestProvider, createLakeflowFoundationPack, createLakeflowJobsTargetPack, createMockDatabricksClient, createSqlDeltaFoundationPack, createTargetPackRegistry, createUnityStorageFoundationPack, createWorkspaceContext, customLiveCheck, dbtBuildCheck, defineLiveSuite, defineTargetPack, defineTargetPackRun, deleteEphemeralLakebaseBranch, deleteVolumeFile, deltaContractCheck, doctorTargetPack, ensureVolumeDirectory, expectQueryToMatchGolden, expectTable, failureRecoveryCheck, foundationTargetPacks, jobRunCheck, jobsOrchestrationCheck, lakebaseCredentialCheck, lakebaseRoundTripCheck, normalizeJobRun, normalizeRow, normalizeVolumeRoot, notebookSubmitCheck, parseJobOrchestrationLiveSpec, parseStatementRows, performanceBudgetCheck, pipelineRefreshCheck, renderJUnit, resolveLakebaseProject, resolveProfile, resolveTokenProvider, restrictedPrincipalCheck, rollbackCheck, runLiveSuite, runTargetPack, secretRotationCheck, secretScopeCheck, serverlessComputeCheck, sqlRoundTripCheck, toLakebaseBranchId, toNamedParameters, unityCatalogAccessCheck, uploadVolumeFile, validateJobGraph, volumeIOCheck, waitForPipelineUpdate };
|
package/dist/index.d.ts
CHANGED
|
@@ -131,7 +131,8 @@ declare function toNamedParameters(sql: string, params: readonly unknown[]): {
|
|
|
131
131
|
declare function parseStatementRows(response: StatementResponse): Record<string, unknown>[];
|
|
132
132
|
/**
|
|
133
133
|
* Auth precedence (ADR-0006): DATABRICKS_BEARER (pre-minted, CI) →
|
|
134
|
-
*
|
|
134
|
+
* explicit env/file OIDC federation → DATABRICKS_CLIENT_ID/SECRET (OAuth
|
|
135
|
+
* M2M) → DATABRICKS_TOKEN (legacy PAT).
|
|
135
136
|
*/
|
|
136
137
|
declare function createClientFromEnv(env: Record<string, string | undefined>, fetchImpl?: typeof fetch): DatabricksRestClient;
|
|
137
138
|
declare function resolveTokenProvider(host: string, env: Record<string, string | undefined>, fetchImpl?: typeof fetch): string | (() => Promise<string>);
|
|
@@ -208,6 +209,23 @@ interface LiveCheckResult {
|
|
|
208
209
|
details?: unknown;
|
|
209
210
|
error?: string;
|
|
210
211
|
}
|
|
212
|
+
type TargetPackMaturity = 'proposed' | 'building' | 'shipped' | 'live-gated' | 'certifying' | 'certified';
|
|
213
|
+
interface TargetPackEvidenceMetadata {
|
|
214
|
+
id: string;
|
|
215
|
+
name: string;
|
|
216
|
+
version: string;
|
|
217
|
+
maturity: TargetPackMaturity;
|
|
218
|
+
capabilities: string[];
|
|
219
|
+
docsUrl?: string;
|
|
220
|
+
certificationScopes: string[];
|
|
221
|
+
target: {
|
|
222
|
+
cloud?: string;
|
|
223
|
+
region?: string;
|
|
224
|
+
workspace?: string;
|
|
225
|
+
runtime?: string;
|
|
226
|
+
compute?: string;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
211
229
|
interface LiveEvidence {
|
|
212
230
|
schemaVersion: 1;
|
|
213
231
|
kind: 'databricks-live-suite';
|
|
@@ -216,6 +234,7 @@ interface LiveEvidence {
|
|
|
216
234
|
success: boolean;
|
|
217
235
|
required: string[];
|
|
218
236
|
results: LiveCheckResult[];
|
|
237
|
+
targetPack?: TargetPackEvidenceMetadata;
|
|
219
238
|
}
|
|
220
239
|
interface LiveSuiteSpec {
|
|
221
240
|
checks: readonly LiveCheck[];
|
|
@@ -223,6 +242,7 @@ interface LiveSuiteSpec {
|
|
|
223
242
|
evidencePath?: string;
|
|
224
243
|
junitPath?: string;
|
|
225
244
|
env?: Record<string, string | undefined>;
|
|
245
|
+
targetPack?: TargetPackEvidenceMetadata;
|
|
226
246
|
}
|
|
227
247
|
interface LiveSuiteRuntime {
|
|
228
248
|
warehouse?: ExecutionContext;
|
|
@@ -350,4 +370,223 @@ declare function serverlessComputeCheck(): LiveCheck;
|
|
|
350
370
|
/** Launch a disposable classic job cluster and require the shared notebook probe to succeed. */
|
|
351
371
|
declare function classicComputeCheck(): LiveCheck;
|
|
352
372
|
|
|
353
|
-
|
|
373
|
+
interface TargetPackRequirement {
|
|
374
|
+
id: string;
|
|
375
|
+
description: string;
|
|
376
|
+
/** At least one named environment variable must be present. */
|
|
377
|
+
anyOf: readonly string[];
|
|
378
|
+
required?: boolean;
|
|
379
|
+
secret?: boolean;
|
|
380
|
+
}
|
|
381
|
+
interface TargetPackSpec {
|
|
382
|
+
id: string;
|
|
383
|
+
name: string;
|
|
384
|
+
description: string;
|
|
385
|
+
version: string;
|
|
386
|
+
maturity: TargetPackMaturity;
|
|
387
|
+
capabilities: readonly string[];
|
|
388
|
+
checks: readonly LiveCheck[] | (() => readonly LiveCheck[]);
|
|
389
|
+
requiredChecks?: readonly string[];
|
|
390
|
+
requirements?: readonly TargetPackRequirement[];
|
|
391
|
+
docsUrl?: string;
|
|
392
|
+
certificationScopes?: readonly string[];
|
|
393
|
+
}
|
|
394
|
+
interface TargetPack extends Omit<TargetPackSpec, 'checks'> {
|
|
395
|
+
checks(): readonly LiveCheck[];
|
|
396
|
+
}
|
|
397
|
+
interface TargetPackDoctorRequirement {
|
|
398
|
+
id: string;
|
|
399
|
+
description: string;
|
|
400
|
+
satisfied: boolean;
|
|
401
|
+
required: boolean;
|
|
402
|
+
variables: string[];
|
|
403
|
+
}
|
|
404
|
+
interface TargetPackDoctorCheck {
|
|
405
|
+
id: string;
|
|
406
|
+
description: string;
|
|
407
|
+
configured: boolean;
|
|
408
|
+
required: boolean;
|
|
409
|
+
}
|
|
410
|
+
interface TargetPackDoctorResult {
|
|
411
|
+
pack: Pick<TargetPack, 'id' | 'name' | 'version' | 'maturity'>;
|
|
412
|
+
ready: boolean;
|
|
413
|
+
requirements: TargetPackDoctorRequirement[];
|
|
414
|
+
checks: TargetPackDoctorCheck[];
|
|
415
|
+
missingRequirements: string[];
|
|
416
|
+
missingRequiredChecks: string[];
|
|
417
|
+
}
|
|
418
|
+
interface RunTargetPackOptions {
|
|
419
|
+
env?: Record<string, string | undefined>;
|
|
420
|
+
requiredChecks?: readonly string[];
|
|
421
|
+
evidencePath?: string;
|
|
422
|
+
junitPath?: string;
|
|
423
|
+
}
|
|
424
|
+
interface DefinedTargetPackRun {
|
|
425
|
+
pack: TargetPack;
|
|
426
|
+
run(runtime?: LiveSuiteRuntime): Promise<LiveEvidence | undefined>;
|
|
427
|
+
}
|
|
428
|
+
declare function defineTargetPack(spec: TargetPackSpec): TargetPack;
|
|
429
|
+
declare function createTargetPackRegistry(packs: readonly TargetPack[]): ReadonlyMap<string, TargetPack>;
|
|
430
|
+
declare function doctorTargetPack(pack: TargetPack, env?: Record<string, string | undefined>, requiredChecks?: readonly string[]): TargetPackDoctorResult;
|
|
431
|
+
declare function defineTargetPackRun(pack: TargetPack, options?: RunTargetPackOptions): DefinedTargetPackRun;
|
|
432
|
+
declare function runTargetPack(pack: TargetPack, options?: RunTargetPackOptions, runtime?: LiveSuiteRuntime): Promise<LiveEvidence | undefined>;
|
|
433
|
+
|
|
434
|
+
declare function createSqlDeltaFoundationPack(): TargetPack;
|
|
435
|
+
declare function createLakeflowFoundationPack(): TargetPack;
|
|
436
|
+
declare function createJobsCodeFoundationPack(): TargetPack;
|
|
437
|
+
declare function createUnityStorageFoundationPack(): TargetPack;
|
|
438
|
+
declare function createAppsOperationalFoundationPack(): TargetPack;
|
|
439
|
+
declare function createFoundationTargetPacks(): readonly TargetPack[];
|
|
440
|
+
declare const foundationTargetPacks: readonly TargetPack[];
|
|
441
|
+
|
|
442
|
+
interface JobTaskDependency {
|
|
443
|
+
task_key: string;
|
|
444
|
+
outcome?: string;
|
|
445
|
+
}
|
|
446
|
+
interface JobTaskBase {
|
|
447
|
+
task_key: string;
|
|
448
|
+
depends_on?: JobTaskDependency[];
|
|
449
|
+
run_if?: 'ALL_SUCCESS' | 'AT_LEAST_ONE_SUCCESS' | 'NONE_FAILED' | 'ALL_DONE' | 'AT_LEAST_ONE_FAILED' | 'ALL_FAILED';
|
|
450
|
+
timeout_seconds?: number;
|
|
451
|
+
max_retries?: number;
|
|
452
|
+
min_retry_interval_millis?: number;
|
|
453
|
+
retry_on_timeout?: boolean;
|
|
454
|
+
existing_cluster_id?: string;
|
|
455
|
+
job_cluster_key?: string;
|
|
456
|
+
environment_key?: string;
|
|
457
|
+
}
|
|
458
|
+
interface NotebookJobTask extends JobTaskBase {
|
|
459
|
+
notebook_task: {
|
|
460
|
+
notebook_path: string;
|
|
461
|
+
base_parameters?: Record<string, string>;
|
|
462
|
+
source?: 'WORKSPACE' | 'GIT';
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
interface PythonWheelJobTask extends JobTaskBase {
|
|
466
|
+
python_wheel_task: {
|
|
467
|
+
package_name: string;
|
|
468
|
+
entry_point: string;
|
|
469
|
+
parameters?: string[];
|
|
470
|
+
named_parameters?: Record<string, string>;
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
interface SparkJarJobTask extends JobTaskBase {
|
|
474
|
+
spark_jar_task: {
|
|
475
|
+
main_class_name: string;
|
|
476
|
+
parameters?: string[];
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
interface SparkPythonJobTask extends JobTaskBase {
|
|
480
|
+
spark_python_task: {
|
|
481
|
+
python_file: string;
|
|
482
|
+
parameters?: string[];
|
|
483
|
+
source?: 'WORKSPACE' | 'GIT';
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
interface SparkSubmitJobTask extends JobTaskBase {
|
|
487
|
+
spark_submit_task: {
|
|
488
|
+
parameters: string[];
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
interface PipelineJobTask extends JobTaskBase {
|
|
492
|
+
pipeline_task: {
|
|
493
|
+
pipeline_id: string;
|
|
494
|
+
full_refresh?: boolean;
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
interface SqlJobTask extends JobTaskBase {
|
|
498
|
+
sql_task: Record<string, unknown> & {
|
|
499
|
+
warehouse_id: string;
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
interface DbtJobTask extends JobTaskBase {
|
|
503
|
+
dbt_task: Record<string, unknown> & {
|
|
504
|
+
commands: string[];
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
interface RunJobTask extends JobTaskBase {
|
|
508
|
+
run_job_task: {
|
|
509
|
+
job_id: number;
|
|
510
|
+
job_parameters?: Record<string, string>;
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
interface ConditionJobTask extends JobTaskBase {
|
|
514
|
+
condition_task: {
|
|
515
|
+
left: string;
|
|
516
|
+
op: 'EQUAL_TO' | 'NOT_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL';
|
|
517
|
+
right: string;
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
interface ForEachJobTask extends JobTaskBase {
|
|
521
|
+
for_each_task: {
|
|
522
|
+
inputs: string;
|
|
523
|
+
concurrency?: number;
|
|
524
|
+
task: Exclude<DatabricksJobTask, ForEachJobTask>;
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
type DatabricksJobTask = NotebookJobTask | PythonWheelJobTask | SparkJarJobTask | SparkPythonJobTask | SparkSubmitJobTask | PipelineJobTask | SqlJobTask | DbtJobTask | RunJobTask | ConditionJobTask | ForEachJobTask;
|
|
528
|
+
interface JobsSubmitRequest {
|
|
529
|
+
run_name: string;
|
|
530
|
+
tasks: DatabricksJobTask[];
|
|
531
|
+
parameters?: Array<{
|
|
532
|
+
name: string;
|
|
533
|
+
default: string;
|
|
534
|
+
}>;
|
|
535
|
+
job_clusters?: Array<Record<string, unknown> & {
|
|
536
|
+
job_cluster_key: string;
|
|
537
|
+
}>;
|
|
538
|
+
environments?: Array<Record<string, unknown> & {
|
|
539
|
+
environment_key: string;
|
|
540
|
+
}>;
|
|
541
|
+
git_source?: Record<string, unknown>;
|
|
542
|
+
timeout_seconds?: number;
|
|
543
|
+
idempotency_token?: string;
|
|
544
|
+
}
|
|
545
|
+
interface JobTaskRunState {
|
|
546
|
+
taskKey: string;
|
|
547
|
+
runId?: number;
|
|
548
|
+
lifeCycleState: string;
|
|
549
|
+
resultState: string;
|
|
550
|
+
stateMessage?: string;
|
|
551
|
+
}
|
|
552
|
+
interface JobOrchestrationRun {
|
|
553
|
+
runId: number;
|
|
554
|
+
lifeCycleState: string;
|
|
555
|
+
resultState: string;
|
|
556
|
+
tasks: JobTaskRunState[];
|
|
557
|
+
raw: Record<string, unknown>;
|
|
558
|
+
}
|
|
559
|
+
interface JobWaitOptions {
|
|
560
|
+
timeoutMs?: number;
|
|
561
|
+
pollIntervalMs?: number;
|
|
562
|
+
}
|
|
563
|
+
interface JobRepairOptions {
|
|
564
|
+
rerunTasks?: string[];
|
|
565
|
+
latestRepairId?: number;
|
|
566
|
+
}
|
|
567
|
+
interface JobOrchestrationLiveSpec {
|
|
568
|
+
request: JobsSubmitRequest;
|
|
569
|
+
expectedResult?: string;
|
|
570
|
+
expectedTasks?: Record<string, string>;
|
|
571
|
+
repairFailedTasks?: boolean;
|
|
572
|
+
}
|
|
573
|
+
declare class DatabricksJobsAdapter {
|
|
574
|
+
private readonly client;
|
|
575
|
+
constructor(client: WorkspaceClientLike);
|
|
576
|
+
submit(request: JobsSubmitRequest): Promise<number>;
|
|
577
|
+
get(runId: number): Promise<JobOrchestrationRun>;
|
|
578
|
+
wait(runId: number, options?: JobWaitOptions): Promise<JobOrchestrationRun>;
|
|
579
|
+
cancel(runId: number): Promise<void>;
|
|
580
|
+
repair(runId: number, options?: JobRepairOptions): Promise<number>;
|
|
581
|
+
}
|
|
582
|
+
declare function validateJobGraph(tasks: readonly DatabricksJobTask[]): void;
|
|
583
|
+
declare function jobsOrchestrationCheck(): LiveCheck;
|
|
584
|
+
declare function parseJobOrchestrationLiveSpec(value: string): JobOrchestrationLiveSpec;
|
|
585
|
+
declare function normalizeJobRun(fallbackRunId: number, raw: Record<string, unknown>): JobOrchestrationRun;
|
|
586
|
+
|
|
587
|
+
declare function createLakeflowJobsTargetPack(): TargetPack;
|
|
588
|
+
|
|
589
|
+
declare function createBuiltinTargetPacks(): readonly TargetPack[];
|
|
590
|
+
declare const builtinTargetPacks: readonly TargetPack[];
|
|
591
|
+
|
|
592
|
+
export { type AppHealthCheckOptions, type AutoLoaderCheckOptions, type ConditionJobTask, type CreateContextOptions, type DatabricksJobTask, DatabricksJobsAdapter, type DbtJobTask, type DefinedLiveSuite, type DefinedTargetPackRun, type DeltaColumnContract, type DuckDbConnectionLike, type DuckDbContextOptions, type EphemeralLakebaseBranch, type ExecutionContext, type ForEachJobTask, type JobOrchestrationLiveSpec, type JobOrchestrationRun, type JobRepairOptions, type JobTaskBase, type JobTaskDependency, type JobTaskRunState, type JobWaitOptions, type JobsSubmitRequest, type LakebaseBranchOptions, type LakebaseCheckOptions, type LakebaseControlClient, type LiveCheck, type LiveCheckContext, type LiveCheckResult, type LiveCheckStatus, type LiveEvidence, type LiveSuiteRuntime, type LiveSuiteSpec, type MockDatabricksClient, type NotebookJobTask, type PipelineJobTask, type PollOptions, type PythonWheelJobTask, type RecordedCall, type RunJobTask, type RunTargetPackOptions, type SecretRotationCheckOptions, type SparkJarJobTask, type SparkPythonJobTask, type SparkSubmitJobTask, type SqlJobTask, TableFixture, type TargetPack, type TargetPackDoctorCheck, type TargetPackDoctorRequirement, type TargetPackDoctorResult, type TargetPackEvidenceMetadata, type TargetPackMaturity, type TargetPackRequirement, type TargetPackSpec, type TestProfile, type VolumeIOCheckOptions, type WorkspaceClientLike, type WorkspaceContextOptions, appHealthCheck, assertDeltaContract, autoLoaderIngestionCheck, backupRestoreCheck, builtinTargetPacks, classicComputeCheck, compareToGolden, createAppsOperationalFoundationPack, createBuiltinTargetPacks, createClientFromEnv, createDuckDbContext, createEphemeralLakebaseBranch, createExecutionContext, createFoundationTargetPacks, createJobsCodeFoundationPack, createLakebaseTestProvider, createLakeflowFoundationPack, createLakeflowJobsTargetPack, createMockDatabricksClient, createSqlDeltaFoundationPack, createTargetPackRegistry, createUnityStorageFoundationPack, createWorkspaceContext, customLiveCheck, dbtBuildCheck, defineLiveSuite, defineTargetPack, defineTargetPackRun, deleteEphemeralLakebaseBranch, deleteVolumeFile, deltaContractCheck, doctorTargetPack, ensureVolumeDirectory, expectQueryToMatchGolden, expectTable, failureRecoveryCheck, foundationTargetPacks, jobRunCheck, jobsOrchestrationCheck, lakebaseCredentialCheck, lakebaseRoundTripCheck, normalizeJobRun, normalizeRow, normalizeVolumeRoot, notebookSubmitCheck, parseJobOrchestrationLiveSpec, parseStatementRows, performanceBudgetCheck, pipelineRefreshCheck, renderJUnit, resolveLakebaseProject, resolveProfile, resolveTokenProvider, restrictedPrincipalCheck, rollbackCheck, runLiveSuite, runTargetPack, secretRotationCheck, secretScopeCheck, serverlessComputeCheck, sqlRoundTripCheck, toLakebaseBranchId, toNamedParameters, unityCatalogAccessCheck, uploadVolumeFile, validateJobGraph, volumeIOCheck, waitForPipelineUpdate };
|