import { type Reporter } from '@quenty/cli-output-helpers/reporting'; import { type BuiltPlace, type Deployment, type DeployPlaceOptions, type JobContext, type RunScriptOptions, type ScriptRunResult, type JobLogs } from './job-context.js'; import { type BuildPlaceOptions } from '../build/build.js'; import { type BatchTarget } from '../batch/changed-packages-utils.js'; import { type BatchDiagnosticLevel, type BatchPackageResult } from '../testing/parsers/batch-log-parser.js'; import { type LogFetchStats } from '../testing/log-fetch-stats.js'; import { type RenderableLogLine } from '../testing/parsers/batch-log-renderer.js'; /** * JobContext wrapper that batches all packages into a single build, and as few * uploads and executions as the place size budget allows — one, unless the * combined place is too big even recompressed, in which case it is split into * chunks that each upload and run on their own, in parallel. Wraps an inner * context (cloud or local) and intercepts all methods using the lazy-promise * pattern: the first concurrent call triggers the shared operation, all others * await the same promise. * * Note that a `basePlace` cannot be honoured here: every package is combined * into one place, so there is no per-package place to merge Studio content * into. Rather than silently drop that content, the constructor warns for any * package configured with one — those belong in `nevermore batch test * --no-aggregated`, or in an integration deploy. */ /** * Everything one aggregated batch produced, as data. * * The execution used to parse, render and print from in here. Printing from a * job context put presentation in the transport, bypassed whatever reporter the * command had chosen — output written straight to the console is invisible to a * SpinnerReporter's capture — and left the whole path untestable without spying * on `console.log`. The context returns this instead, and the command layer * decides what to show. */ export interface BatchExecutionOutcome { results: Map; /** The run's output, typed by severity and not yet rendered. */ lines: RenderableLogLine[]; /** What the fetch had to do to collect it; absent for a transport that cannot say. */ stats?: LogFetchStats; /** What reading the log turned up, to report after the log itself. */ diagnostics: Array<{ level: BatchDiagnosticLevel; message: string; }>; /** Section slug to package name, for whoever titles the sections. */ slugToPackage: Map; } export declare class BatchScriptJobContext implements JobContext { private _inner; private _batchTargets; private _repoRoot; private _batchPlaceId?; private _batchUniverseId?; private _batchTimeoutMs; private _maxChunkBytes?; private _reporter?; private _combinedBuildPromise?; private _chunkRuns?; private _executionPromise?; private _combinedBuildContext?; constructor(inner: JobContext, batchTargets: BatchTarget[], options?: { repoRoot?: string; batchPlaceId?: number; batchUniverseId?: number; batchTimeoutMs?: number; /** * Per-place size budget; see `DEFAULT_MAX_CHUNK_BYTES`. Only an upload * is size-limited, so a local run passes `Infinity`. */ maxChunkBytes?: number; reporter?: Reporter; }); buildPlaceAsync(options: BuildPlaceOptions): Promise; deployBuiltPlaceAsync(options: DeployPlaceOptions): Promise; runScriptAsync(deployment: Deployment, options: RunScriptOptions): Promise; /** * Run the batch if it has not run, and hand back everything it produced. * * Public so the command layer can render the run once, before the * per-package loop asks for results — which is also what keeps the shared * build and upload out of any one package's async context. */ getExecutionOutcomeAsync(): Promise; getLogsAsync(deployment: Deployment): Promise; releaseAsync(_deployment: Deployment): Promise; releaseBuiltPlaceAsync(_builtPlace: BuiltPlace): Promise; disposeAsync(): Promise; private _getCombinedBuildAsync; private _doCombinedBuildAsync; private _getChunkRunsAsync; private _getChunkRunAsync; private _getChunkDeploymentAsync; private _doChunkDeployAsync; private _getBatchExecutionAsync; private _doBatchExecutionAsync; private _getChunkExecutionAsync; private _doChunkExecutionAsync; } //# sourceMappingURL=batch-script-job-context.d.ts.map