@grepr/cli 1.14.13-15e1f25 → 1.15.0-e33385d
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/build/dist/commands/job-draft-command.d.ts.map +1 -1
- package/build/dist/commands/job-draft-command.js +6 -71
- package/build/dist/commands/job-draft-command.js.map +1 -1
- package/build/dist/docs-index/index.json +1 -1
- package/build/dist/grepr.d.ts.map +1 -1
- package/build/dist/grepr.js +0 -2
- package/build/dist/grepr.js.map +1 -1
- package/build/dist/lib/backfill.js +4 -8
- package/build/dist/lib/backfill.js.map +1 -1
- package/build/dist/lib/job-patch.d.ts +15 -31
- package/build/dist/lib/job-patch.d.ts.map +1 -1
- package/build/dist/lib/job-patch.js +39 -709
- package/build/dist/lib/job-patch.js.map +1 -1
- package/build/dist/lib/job-plan.d.ts +3 -6
- package/build/dist/lib/job-plan.d.ts.map +1 -1
- package/build/dist/lib/job-plan.js +5 -55
- package/build/dist/lib/job-plan.js.map +1 -1
- package/build/dist/lib/option-parsers.d.ts +0 -5
- package/build/dist/lib/option-parsers.d.ts.map +1 -1
- package/build/dist/lib/option-parsers.js +0 -7
- package/build/dist/lib/option-parsers.js.map +1 -1
- package/build/dist/lib/signal-source.d.ts +1 -1
- package/build/dist/lib/signal-source.d.ts.map +1 -1
- package/build/dist/lib/signal-source.js +10 -69
- package/build/dist/lib/signal-source.js.map +1 -1
- package/build/dist/types.d.ts +8 -37
- package/build/dist/types.d.ts.map +1 -1
- package/build/dist/types.js +0 -69
- package/build/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/build/dist/commands/job-to-test-command.d.ts +0 -74
- package/build/dist/commands/job-to-test-command.d.ts.map +0 -1
- package/build/dist/commands/job-to-test-command.js +0 -161
- package/build/dist/commands/job-to-test-command.js.map +0 -1
- package/build/dist/lib/job-graph-log-pipeline-constants.d.ts +0 -12
- package/build/dist/lib/job-graph-log-pipeline-constants.d.ts.map +0 -1
- package/build/dist/lib/job-graph-log-pipeline-constants.js +0 -16
- package/build/dist/lib/job-graph-log-pipeline-constants.js.map +0 -1
- package/build/dist/lib/job-graph-transformer.d.ts +0 -119
- package/build/dist/lib/job-graph-transformer.d.ts.map +0 -1
- package/build/dist/lib/job-graph-transformer.js +0 -767
- package/build/dist/lib/job-graph-transformer.js.map +0 -1
- package/build/dist/lib/job-graph-utils.d.ts +0 -50
- package/build/dist/lib/job-graph-utils.d.ts.map +0 -1
- package/build/dist/lib/job-graph-utils.js +0 -90
- package/build/dist/lib/job-graph-utils.js.map +0 -1
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Job graph transformation utilities for converting production jobs to test configurations.
|
|
3
|
-
*
|
|
4
|
-
* This module provides functions to transform a production job definition into a test job
|
|
5
|
-
* by replacing sources, sinks, and adding test-specific tagging. The transformations are
|
|
6
|
-
* purely functional - they do not make any API calls or create resources.
|
|
7
|
-
*
|
|
8
|
-
* Key transformations:
|
|
9
|
-
* - Source replacement: Replace vendor sources with dataset queries or keep originals with limits
|
|
10
|
-
* - Sink replacement: Replace vendor sinks with synchronous test sinks or test dataset sinks
|
|
11
|
-
* - Test tagging: Add test run ID and sink name tags to track test data
|
|
12
|
-
*
|
|
13
|
-
* The transformed job can then be executed using the standard job:create command.
|
|
14
|
-
*/
|
|
15
|
-
import { JobExecution, JobProcessing } from '../types.js';
|
|
16
|
-
import { SchemaCreateJob } from '../openapi/openApiTypes.js';
|
|
17
|
-
/**
|
|
18
|
-
* Options for transforming a job to a test configuration.
|
|
19
|
-
*/
|
|
20
|
-
export interface JobToTestOptions {
|
|
21
|
-
/** Target execution type (default: keep original) */
|
|
22
|
-
execution?: JobExecution;
|
|
23
|
-
/** Target processing type (default: keep original) */
|
|
24
|
-
processing?: JobProcessing;
|
|
25
|
-
/** Path to sample data file (not yet implemented) */
|
|
26
|
-
sampleDataFile?: string;
|
|
27
|
-
/** Dataset ID to use as data source (requires start and end) */
|
|
28
|
-
datasetId?: string;
|
|
29
|
-
/** Query to filter dataset source data (optional, requires datasetId) */
|
|
30
|
-
query?: string;
|
|
31
|
-
/** Start time for dataset query (ISO 8601 format) */
|
|
32
|
-
start?: string;
|
|
33
|
-
/** End time for dataset query (ISO 8601 format) */
|
|
34
|
-
end?: string;
|
|
35
|
-
/** Record limit for batch sources (default: 1000) */
|
|
36
|
-
limitRecords?: number;
|
|
37
|
-
/** Dataset ID for async test output (enables tagging) */
|
|
38
|
-
testDataset?: string;
|
|
39
|
-
/** Custom test run identifier (default: auto-generated) */
|
|
40
|
-
testTag?: string;
|
|
41
|
-
/** Custom test job name (default: {original}_test) */
|
|
42
|
-
testName?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Tuning for the logs-event-sampler inserted after each live source in a
|
|
45
|
-
* source-preserving draft. Omitted fields fall back to the UI's draft
|
|
46
|
-
* defaults (see {@link DEFAULT_DRAFT_SAMPLER_BURST}).
|
|
47
|
-
*/
|
|
48
|
-
sampler?: DraftSamplerOptions;
|
|
49
|
-
}
|
|
50
|
-
/** Sampler knobs for a source-preserving draft, mirroring the UI's logs-event-sampler. */
|
|
51
|
-
export interface DraftSamplerOptions {
|
|
52
|
-
/** `maxAllowedRate` in messages/sec; omitted -> server default applies. */
|
|
53
|
-
maxAllowedRate?: number;
|
|
54
|
-
/** `maxBurstLimit` in messages; omitted -> {@link DEFAULT_DRAFT_SAMPLER_BURST}. */
|
|
55
|
-
maxBurstLimit?: number;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Default `maxBurstLimit` for a draft logs-event-sampler. Matches the UI's
|
|
59
|
-
* template-draft fallback (`logSampler?.maxBurstLimit ?? 1000`) so CLI raw-job
|
|
60
|
-
* drafts sample at the same rate as the UI's template drafts. `maxAllowedRate`
|
|
61
|
-
* has no CLI default: when unset we omit it and let the server default apply,
|
|
62
|
-
* exactly as the UI does.
|
|
63
|
-
*/
|
|
64
|
-
export declare const DEFAULT_DRAFT_SAMPLER_BURST = 1000;
|
|
65
|
-
/**
|
|
66
|
-
* Transforms a production job configuration into a test job configuration.
|
|
67
|
-
*
|
|
68
|
-
* This is the main entry point for job transformation. It applies the following changes:
|
|
69
|
-
* 1. Renames the job (appends "_test" or uses custom name)
|
|
70
|
-
* 2. Updates execution and processing types if specified
|
|
71
|
-
* 3. Adds test run ID tag to job tags
|
|
72
|
-
* 4. Transforms sources (replace with dataset query, sample data, or add limits)
|
|
73
|
-
* 5. Transforms sinks (replace with sync sink or test dataset sinks)
|
|
74
|
-
* 6. Adds test tagging operations before sinks
|
|
75
|
-
*
|
|
76
|
-
* The transformation is purely functional and does not make any API calls.
|
|
77
|
-
*
|
|
78
|
-
* @param originalJob - The production job to transform
|
|
79
|
-
* @param options - Transformation options
|
|
80
|
-
* @returns A new job configuration suitable for testing
|
|
81
|
-
* @throws Error if job graph is missing or invalid
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* const testJob = transformJobToTest(prodJob, {
|
|
85
|
-
* execution: 'SYNCHRONOUS',
|
|
86
|
-
* processing: 'BATCH',
|
|
87
|
-
* datasetId: 'my_dataset',
|
|
88
|
-
* start: '2025-01-01T00:00:00Z',
|
|
89
|
-
* end: '2025-01-01T01:00:00Z',
|
|
90
|
-
* limitRecords: 100
|
|
91
|
-
* });
|
|
92
|
-
*/
|
|
93
|
-
export declare function transformJobToTest(originalJob: SchemaCreateJob, options: JobToTestOptions): SchemaCreateJob;
|
|
94
|
-
/**
|
|
95
|
-
* Build a source-preserving draft from a job-graph pipeline: keep the proposed
|
|
96
|
-
* source vertices streaming live (so add/remove-source edits are exercised),
|
|
97
|
-
* interpose a logs-event-sampler after each live source to bound per-source
|
|
98
|
-
* volume, strip production sinks, and fan output into a shared logs-sync-sink.
|
|
99
|
-
* Mirrors the UI's template draft mode for raw (non-templated) jobs. Verifies
|
|
100
|
-
* the graph runs, not external sink delivery.
|
|
101
|
-
*/
|
|
102
|
-
export declare function transformJobGraphToSourcePreservingDraft(originalJob: SchemaCreateJob, options?: JobToTestOptions): SchemaCreateJob;
|
|
103
|
-
/**
|
|
104
|
-
* Displays a summary of the transformations applied to a job.
|
|
105
|
-
*
|
|
106
|
-
* This shows a before/after comparison including:
|
|
107
|
-
* - Job name changes
|
|
108
|
-
* - Execution type changes
|
|
109
|
-
* - Processing type changes
|
|
110
|
-
* - operation and edge changes
|
|
111
|
-
* - Test run ID
|
|
112
|
-
*
|
|
113
|
-
* The output is formatted for console display.
|
|
114
|
-
*
|
|
115
|
-
* @param originalJob - The original production job
|
|
116
|
-
* @param transformedJob - The transformed test job
|
|
117
|
-
*/
|
|
118
|
-
export declare function showDiff(originalJob: SchemaCreateJob, transformedJob: SchemaCreateJob): void;
|
|
119
|
-
//# sourceMappingURL=job-graph-transformer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job-graph-transformer.d.ts","sourceRoot":"","sources":["../../../src/main/typescript/lib/job-graph-transformer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAiC,YAAY,EAAE,aAAa,EAAyB,MAAM,aAAa,CAAC;AAChH,OAAO,EAGL,eAAe,EAmBhB,MAAM,wBAAwB,CAAC;AAchC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB,sDAAsD;IACtD,UAAU,CAAC,EAAE,aAAa,CAAC;IAE3B,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,mDAAmD;IACnD,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,2DAA2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