@pipeline-builder/api-core 7.2.7 → 7.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/lib/contracts/pipeline.d.ts +31 -0
- package/lib/contracts/pipeline.js +48 -1
- package/lib/contracts/plugin.d.ts +18 -0
- package/lib/contracts/plugin.js +27 -1
- package/lib/helpers/org-hierarchy-http.d.ts +2 -1
- package/lib/helpers/org-hierarchy-http.js +6 -2
- package/lib/types/pipeline-runners.d.ts +611 -7
- package/lib/types/pipeline-runners.js +367 -8
- package/lib/types/remote-audit-actions.d.ts +1 -1
- package/lib/types/remote-audit-actions.js +18 -1
- package/lib/utils/pipeline-identity.d.ts +27 -0
- package/lib/utils/pipeline-identity.js +50 -1
- package/package.json +1 -1
|
@@ -29,25 +29,75 @@ export type RunnerStatus = (typeof RUNNER_STATUSES)[number];
|
|
|
29
29
|
/** A runner's delivery health: unreachable after consecutive failed deliveries. */
|
|
30
30
|
export declare const RUNNER_HEALTH: readonly ['healthy', 'unreachable'];
|
|
31
31
|
export type RunnerHealth = (typeof RUNNER_HEALTH)[number];
|
|
32
|
-
export declare const RUN_REQUEST_STATUSES: readonly ['queued', 'delivering', 'started', 'stopped', 'failed', 'expired'];
|
|
32
|
+
export declare const RUN_REQUEST_STATUSES: readonly ['queued', 'delivering', 'started', 'stopped', 'failed', 'expired', 'deploying', 'deployed', 'cancelled', 'undeploying', 'undeployed'];
|
|
33
33
|
export type RunRequestStatus = (typeof RUN_REQUEST_STATUSES)[number];
|
|
34
34
|
/** Still waiting to be delivered. */
|
|
35
35
|
export declare const PENDING_RUN_REQUEST_STATUSES: readonly ["queued", "delivering"];
|
|
36
36
|
export type PendingRunRequestStatus = (typeof PENDING_RUN_REQUEST_STATUSES)[number];
|
|
37
|
+
/** Delivered and accepted, a runner job still running (deploy / undeploy only): the status poll decides what follows. */
|
|
38
|
+
export declare const IN_PROGRESS_RUN_REQUEST_STATUSES: readonly ["deploying", "undeploying"];
|
|
39
|
+
export type InProgressRunRequestStatus = (typeof IN_PROGRESS_RUN_REQUEST_STATUSES)[number];
|
|
37
40
|
/** Nothing further happens after these. */
|
|
38
|
-
export declare const TERMINAL_RUN_REQUEST_STATUSES: readonly ["started", "stopped", "failed", "expired"];
|
|
41
|
+
export declare const TERMINAL_RUN_REQUEST_STATUSES: readonly ["started", "stopped", "failed", "expired", "deployed", "cancelled", "undeployed"];
|
|
39
42
|
export type TerminalRunRequestStatus = (typeof TERMINAL_RUN_REQUEST_STATUSES)[number];
|
|
43
|
+
/** Whether `s` is a terminal request status (false for anything unknown). */
|
|
44
|
+
export declare function isTerminalRunRequestStatus(s: unknown): s is TerminalRunRequestStatus;
|
|
40
45
|
/** What a signed request asks the runner to do. */
|
|
41
|
-
export declare const RUNNER_ACTIONS: readonly ['start', 'stop', 'probe', 'ping', 'status'];
|
|
46
|
+
export declare const RUNNER_ACTIONS: readonly ['start', 'stop', 'probe', 'ping', 'status', 'deploy', 'deploy_status', 'deploy_cancel', 'undeploy'];
|
|
42
47
|
export type RunnerAction = (typeof RUNNER_ACTIONS)[number];
|
|
43
|
-
/** The actions recorded as a run request row (a `ping` and a `
|
|
44
|
-
export declare const RUN_REQUEST_ACTIONS: readonly ["start", "stop", "probe"];
|
|
48
|
+
/** The actions recorded as a run request row (a `ping`, a `status` / `deploy_status` read and a `deploy_cancel` never are). */
|
|
49
|
+
export declare const RUN_REQUEST_ACTIONS: readonly ["start", "stop", "probe", "deploy", "undeploy"];
|
|
45
50
|
export type RunRequestAction = (typeof RUN_REQUEST_ACTIONS)[number];
|
|
46
51
|
/** A runner's successful answers (`outcome` of a 200). */
|
|
47
|
-
export declare const RUNNER_OUTCOMES: readonly ['started', 'stopped', 'match', 'no_match', 'pong', 'status'];
|
|
52
|
+
export declare const RUNNER_OUTCOMES: readonly ['started', 'stopped', 'match', 'no_match', 'pong', 'status', 'deploying', 'deploy_status', 'deploy_cancelled', 'undeploying'];
|
|
48
53
|
export type RunnerOutcome = (typeof RUNNER_OUTCOMES)[number];
|
|
49
54
|
/** The outcome a successful answer to each action must carry. */
|
|
50
55
|
export declare const EXPECTED_OUTCOMES: Readonly<Record<RunnerAction, readonly RunnerOutcome[]>>;
|
|
56
|
+
/**
|
|
57
|
+
* What a runner bundle can do beyond start/stop/probe/ping/status. `deploy:1`:
|
|
58
|
+
* the stack was set up with `--enable-deploy` (EnableDeploy=true) and the
|
|
59
|
+
* bundle speaks deploy, deploy_status, deploy_cancel and undeploy. One
|
|
60
|
+
* capability covers undeploy too: it runs the same CodeBuild project.
|
|
61
|
+
*/
|
|
62
|
+
export declare const RUNNER_CAPABILITIES: readonly ['deploy:1'];
|
|
63
|
+
export type RunnerCapability = (typeof RUNNER_CAPABILITIES)[number];
|
|
64
|
+
export declare const DEPLOY_CAPABILITY: "deploy:1";
|
|
65
|
+
/**
|
|
66
|
+
* The capability each gated action needs. The platform checks it BEFORE
|
|
67
|
+
* signing: a bundle without it answers an unknown action 401
|
|
68
|
+
* SIGNATURE_INVALID, which would page RunnerSignatureInvalid.
|
|
69
|
+
*/
|
|
70
|
+
export declare const DEPLOY_ACTION_CAPABILITY: {
|
|
71
|
+
readonly deploy: "deploy:1";
|
|
72
|
+
readonly deploy_status: "deploy:1";
|
|
73
|
+
readonly deploy_cancel: "deploy:1";
|
|
74
|
+
readonly undeploy: "deploy:1";
|
|
75
|
+
};
|
|
76
|
+
/** Whether a runner reporting `capabilities` may be sent `action`. */
|
|
77
|
+
export declare function runnerSupportsAction(capabilities: readonly string[], action: RunnerAction): boolean;
|
|
78
|
+
/** A pong's `capabilities`, kept to the known ones (deduplicated, catalog order); [] for anything malformed. */
|
|
79
|
+
export declare function parseRunnerCapabilities(raw: unknown): RunnerCapability[];
|
|
80
|
+
/** One allowlisted pipeline-name prefix a runner reports: `*` or CodePipeline name characters. */
|
|
81
|
+
export declare const PIPELINE_PREFIX_PATTERN: RegExp;
|
|
82
|
+
/** At most this many prefixes are stored per runner. */
|
|
83
|
+
export declare const MAX_PIPELINE_PREFIXES = 50;
|
|
84
|
+
/** A pong's `pipelinePrefixes`, valid ones only (deduplicated, at most {@link MAX_PIPELINE_PREFIXES}); [] for anything malformed. */
|
|
85
|
+
export declare function parsePipelinePrefixes(raw: unknown): string[];
|
|
86
|
+
/** Whether the runner's prefix allowlist covers `pipelineName` (as the runner's own check does; none reported = no match). */
|
|
87
|
+
export declare function pipelineNameMatchesPrefixes(pipelineName: string, prefixes: readonly string[]): boolean;
|
|
88
|
+
/** An AWS region name (`us-east-1`, `us-gov-west-1`). */
|
|
89
|
+
export declare const AWS_REGION_PATTERN: RegExp;
|
|
90
|
+
/**
|
|
91
|
+
* The details of a `pong` (beside `outcome`), as a runner sends them — raw:
|
|
92
|
+
* parse `capabilities` / `pipelinePrefixes` with {@link parseRunnerCapabilities}
|
|
93
|
+
* / {@link parsePipelinePrefixes} before storing them.
|
|
94
|
+
*/
|
|
95
|
+
export interface RunnerPongDetails {
|
|
96
|
+
regions?: unknown;
|
|
97
|
+
runnerVersion?: unknown;
|
|
98
|
+
capabilities?: unknown;
|
|
99
|
+
pipelinePrefixes?: unknown;
|
|
100
|
+
}
|
|
51
101
|
/**
|
|
52
102
|
* Where a code comes from:
|
|
53
103
|
* - `platform` — the pipeline service answers with it (`code` of the error envelope);
|
|
@@ -183,6 +233,76 @@ export declare const RUNNER_ERRORS: {
|
|
|
183
233
|
readonly retryable: false;
|
|
184
234
|
readonly category: 'platform';
|
|
185
235
|
};
|
|
236
|
+
/** The runner does not list the `deploy:1` capability (an old bundle, or a stack without --enable-deploy): update it with {@link DEPLOY_SETUP_COMMAND}. */
|
|
237
|
+
readonly RUNNER_DEPLOY_UNSUPPORTED: {
|
|
238
|
+
readonly httpStatus: 409;
|
|
239
|
+
readonly retryable: false;
|
|
240
|
+
readonly category: 'platform';
|
|
241
|
+
};
|
|
242
|
+
/** Several runners can deploy this pipeline and none was named (`details.runners`: the deployable ones). */
|
|
243
|
+
readonly DEPLOY_RUNNER_REQUIRED: {
|
|
244
|
+
readonly httpStatus: 409;
|
|
245
|
+
readonly retryable: false;
|
|
246
|
+
readonly category: 'platform';
|
|
247
|
+
};
|
|
248
|
+
/** The runner named (or the only one) cannot deploy this pipeline (`details.reason`: a {@link DeployTargetReason}). */
|
|
249
|
+
readonly RUNNER_NOT_DEPLOYABLE: {
|
|
250
|
+
readonly httpStatus: 409;
|
|
251
|
+
readonly retryable: false;
|
|
252
|
+
readonly category: 'platform';
|
|
253
|
+
};
|
|
254
|
+
/** The pipeline already has a registry row: deploys through a runner are for a never-deployed pipeline only. */
|
|
255
|
+
readonly ALREADY_DEPLOYED: {
|
|
256
|
+
readonly httpStatus: 409;
|
|
257
|
+
readonly retryable: false;
|
|
258
|
+
readonly category: 'platform';
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Another deploy of this pipeline is active (`details.requestId`). Also what a
|
|
262
|
+
* runner answers when its project already builds this pipeline for another
|
|
263
|
+
* request id (the one platform code a runner may send: final, like any 4xx).
|
|
264
|
+
*/
|
|
265
|
+
readonly DEPLOY_IN_PROGRESS: {
|
|
266
|
+
readonly httpStatus: 409;
|
|
267
|
+
readonly retryable: false;
|
|
268
|
+
readonly category: 'platform';
|
|
269
|
+
};
|
|
270
|
+
/** The region asked for is not one of the runner's allowed regions (or several are and none was named). */
|
|
271
|
+
readonly DEPLOY_REGION_NOT_ALLOWED: {
|
|
272
|
+
readonly httpStatus: 409;
|
|
273
|
+
readonly retryable: false;
|
|
274
|
+
readonly category: 'platform';
|
|
275
|
+
};
|
|
276
|
+
/** The pipeline's pinned toolchain release ships no cdk-synth image speaking {@link DEPLOY_JOB_PROTOCOL_VERSION}. */
|
|
277
|
+
readonly TOOLCHAIN_TOO_OLD_FOR_DEPLOY: {
|
|
278
|
+
readonly httpStatus: 409;
|
|
279
|
+
readonly retryable: false;
|
|
280
|
+
readonly category: 'platform';
|
|
281
|
+
};
|
|
282
|
+
/** Cancel of a deploy that already finished. */
|
|
283
|
+
readonly DEPLOY_NOT_CANCELLABLE: {
|
|
284
|
+
readonly httpStatus: 409;
|
|
285
|
+
readonly retryable: false;
|
|
286
|
+
readonly category: 'platform';
|
|
287
|
+
};
|
|
288
|
+
/** DEPLOY_REQUESTS_PER_HOUR for the org. */
|
|
289
|
+
readonly DEPLOY_RATE_LIMITED: {
|
|
290
|
+
readonly httpStatus: 429;
|
|
291
|
+
readonly retryable: false;
|
|
292
|
+
readonly category: 'platform';
|
|
293
|
+
};
|
|
294
|
+
/** MAX_ACTIVE_DEPLOYS_PER_RUNNER deploys already active on the runner. */
|
|
295
|
+
readonly TOO_MANY_DEPLOYS: {
|
|
296
|
+
readonly httpStatus: 429;
|
|
297
|
+
readonly retryable: false;
|
|
298
|
+
readonly category: 'platform';
|
|
299
|
+
};
|
|
300
|
+
/** The deploy job's grant (or session) was refused (`details.reason`: a {@link DeployGrantRejectionReason}). */
|
|
301
|
+
readonly DEPLOY_GRANT_INVALID: {
|
|
302
|
+
readonly httpStatus: 401;
|
|
303
|
+
readonly retryable: false;
|
|
304
|
+
readonly category: 'platform';
|
|
305
|
+
};
|
|
186
306
|
readonly SIGNATURE_INVALID: {
|
|
187
307
|
readonly httpStatus: 401;
|
|
188
308
|
readonly retryable: false;
|
|
@@ -242,6 +362,30 @@ export declare const RUNNER_ERRORS: {
|
|
|
242
362
|
readonly retryable: false;
|
|
243
363
|
readonly category: 'runner';
|
|
244
364
|
};
|
|
365
|
+
/** The stack was not set up with --enable-deploy (the platform clears the runner's stored capabilities). */
|
|
366
|
+
readonly DEPLOY_NOT_ENABLED: {
|
|
367
|
+
readonly httpStatus: 403;
|
|
368
|
+
readonly retryable: false;
|
|
369
|
+
readonly category: 'runner';
|
|
370
|
+
};
|
|
371
|
+
/** A pipeline tagged with this pipeline id already exists in the account (the platform links it instead). */
|
|
372
|
+
readonly PIPELINE_ALREADY_DEPLOYED: {
|
|
373
|
+
readonly httpStatus: 409;
|
|
374
|
+
readonly retryable: false;
|
|
375
|
+
readonly category: 'runner';
|
|
376
|
+
};
|
|
377
|
+
/** The deploy project is at its concurrent build limit (delivered again). */
|
|
378
|
+
readonly DEPLOY_BUSY: {
|
|
379
|
+
readonly httpStatus: 409;
|
|
380
|
+
readonly retryable: true;
|
|
381
|
+
readonly category: 'runner';
|
|
382
|
+
};
|
|
383
|
+
/** deploy_status / deploy_cancel: no such build in the runner's own deploy project. */
|
|
384
|
+
readonly DEPLOY_BUILD_NOT_FOUND: {
|
|
385
|
+
readonly httpStatus: 404;
|
|
386
|
+
readonly retryable: false;
|
|
387
|
+
readonly category: 'runner';
|
|
388
|
+
};
|
|
245
389
|
/** Not delivered within the request's lifetime. */
|
|
246
390
|
readonly RUN_REQUEST_EXPIRED: {
|
|
247
391
|
readonly httpStatus: null;
|
|
@@ -328,8 +472,40 @@ export interface RunClaims {
|
|
|
328
472
|
};
|
|
329
473
|
/** stop and status only. */
|
|
330
474
|
executionId?: string;
|
|
475
|
+
/** deploy and undeploy only: what the runner's CodeBuild job runs. */
|
|
476
|
+
deploy?: RunDeployClaim;
|
|
477
|
+
/** deploy_status and deploy_cancel only: the deploy / undeploy request whose build is asked about (its `jti`). */
|
|
478
|
+
deployRequestId?: string;
|
|
479
|
+
/** deploy_status and deploy_cancel only: the build the runner answered `deploying` / `undeploying` with. */
|
|
480
|
+
buildId?: string;
|
|
331
481
|
requestedBy: string;
|
|
332
482
|
}
|
|
483
|
+
/**
|
|
484
|
+
* The `deploy` claim block (actions `deploy` and `undeploy`). The runner
|
|
485
|
+
* validates every field, KMS-encrypts `grant` under
|
|
486
|
+
* {@link deployGrantEncryptionContext} and hands the job only that ciphertext
|
|
487
|
+
* ({@link DEPLOY_JOB_ENV}.grantCiphertext): the cleartext grant never reaches
|
|
488
|
+
* a CodeBuild env override (visible to BatchGetBuilds and CloudTrail).
|
|
489
|
+
*/
|
|
490
|
+
export interface RunDeployClaim {
|
|
491
|
+
/** The single-use job grant ({@link DEPLOY_GRANT_PATTERN}). Never logged. */
|
|
492
|
+
grant: string;
|
|
493
|
+
/** {@link DEPLOY_JOB_PROTOCOL_VERSION} as the platform speaks it; the job refuses to run on a mismatch. */
|
|
494
|
+
protocol: number;
|
|
495
|
+
mode: DeployJobMode;
|
|
496
|
+
region: string;
|
|
497
|
+
/** The CodePipeline name (pipeline-core `deployedPipelineNames`). */
|
|
498
|
+
pipelineName: string;
|
|
499
|
+
/** The CloudFormation stack name (pipeline-core `deployedPipelineNames`). */
|
|
500
|
+
stackName: string;
|
|
501
|
+
/** The managed cdk-synth image of the pipeline's toolchain release, pinned by digest; the host is the runner stack's. */
|
|
502
|
+
image: {
|
|
503
|
+
repository: typeof DEPLOY_JOB_IMAGE_REPOSITORY;
|
|
504
|
+
digest: string;
|
|
505
|
+
};
|
|
506
|
+
/** The managed toolchain release that image belongs to. */
|
|
507
|
+
toolchainRelease: string;
|
|
508
|
+
}
|
|
333
509
|
/**
|
|
334
510
|
* A signing key's lifecycle (`pipeline_runner_signing_keys.state`):
|
|
335
511
|
* - `next` — published in the JWKS, not signing yet (signs from `activates_at`);
|
|
@@ -417,7 +593,11 @@ export declare const UNREACHABLE_AFTER_FAILURES = 3;
|
|
|
417
593
|
* - MAX_IN_FLIGHT_PER_RUNNER — deliveries in flight to one runner;
|
|
418
594
|
* - RUNNER_HEALTH_PING_INTERVAL_SECONDS — every active runner is pinged this often;
|
|
419
595
|
* - RUNNER_UNHEALTHY_AFTER_PINGS — consecutive failed pings that mark it unreachable (a SIGNATURE_INVALID or RUNNER_REFUSED reply does at once);
|
|
420
|
-
* - RUNNER_KEY_MAX_AGE_DAYS — an active key this old earns an age reminder (and the badge)
|
|
596
|
+
* - RUNNER_KEY_MAX_AGE_DAYS — an active key this old earns an age reminder (and the badge);
|
|
597
|
+
* - DEPLOY_REQUESTS_PER_HOUR — deploys through a runner per org per hour (429 DEPLOY_RATE_LIMITED);
|
|
598
|
+
* - MAX_ACTIVE_DEPLOYS_PER_RUNNER — active (queued|delivering|deploying) deploys per runner (429 TOO_MANY_DEPLOYS);
|
|
599
|
+
* - RUNNER_DEPLOY_DEADLINE_MINUTES — an accepted deploy past this is cancelled and fails DEPLOY_TIMED_OUT;
|
|
600
|
+
* - RUNNER_DEPLOY_STATUS_POLL_SECONDS — each deploying request's build is polled (signed deploy_status) this often.
|
|
421
601
|
*/
|
|
422
602
|
export declare const RUNNER_TUNABLE_DEFAULTS: {
|
|
423
603
|
readonly RUN_REQUESTS_PER_MINUTE: '6';
|
|
@@ -426,6 +606,10 @@ export declare const RUNNER_TUNABLE_DEFAULTS: {
|
|
|
426
606
|
readonly RUNNER_HEALTH_PING_INTERVAL_SECONDS: '60';
|
|
427
607
|
readonly RUNNER_UNHEALTHY_AFTER_PINGS: '2';
|
|
428
608
|
readonly RUNNER_KEY_MAX_AGE_DAYS: '365';
|
|
609
|
+
readonly DEPLOY_REQUESTS_PER_HOUR: '20';
|
|
610
|
+
readonly MAX_ACTIVE_DEPLOYS_PER_RUNNER: '2';
|
|
611
|
+
readonly RUNNER_DEPLOY_DEADLINE_MINUTES: '120';
|
|
612
|
+
readonly RUNNER_DEPLOY_STATUS_POLL_SECONDS: '30';
|
|
429
613
|
};
|
|
430
614
|
export type RunnerTunableEnv = keyof typeof RUNNER_TUNABLE_DEFAULTS;
|
|
431
615
|
/** The smallest value each tunable accepts. */
|
|
@@ -472,6 +656,293 @@ export declare const RUNNER_KEY_METRICS: {
|
|
|
472
656
|
/** Counter `{source}`: cache entries dropped, source `pubsub` | `poll`. */
|
|
473
657
|
readonly invalidations: 'pipeline_runner_signing_key_invalidations_total';
|
|
474
658
|
};
|
|
659
|
+
/** The statuses of a `deploy` request row. */
|
|
660
|
+
export declare const DEPLOY_REQUEST_STATUSES: readonly ["queued", "delivering", "deploying", "deployed", "failed", "expired", "cancelled"];
|
|
661
|
+
export type DeployRequestStatus = (typeof DEPLOY_REQUEST_STATUSES)[number];
|
|
662
|
+
/** The statuses of an `undeploy` request row (sent by the platform on purge; nobody cancels one). */
|
|
663
|
+
export declare const UNDEPLOY_REQUEST_STATUSES: readonly ["queued", "delivering", "undeploying", "undeployed", "failed", "expired"];
|
|
664
|
+
export type UndeployRequestStatus = (typeof UNDEPLOY_REQUEST_STATUSES)[number];
|
|
665
|
+
/** A deploy in one of these is THE active deploy of its pipeline (partial unique index `pipeline_run_requests_one_active_deploy_uq`). */
|
|
666
|
+
export declare const ACTIVE_DEPLOY_STATUSES: readonly ["queued", "delivering", "deploying"];
|
|
667
|
+
export type ActiveDeployStatus = (typeof ACTIVE_DEPLOY_STATUSES)[number];
|
|
668
|
+
/**
|
|
669
|
+
* Where the deploy job is (the job's progress posts and its exported
|
|
670
|
+
* PB_DEPLOY_STAGE; `queued` until the build starts). `cleaning`: deleting this
|
|
671
|
+
* pipeline's own never-completed first stack (ROLLBACK_COMPLETE / DELETE_FAILED)
|
|
672
|
+
* before deploying again. `removing`: an undeploy deleting the stack.
|
|
673
|
+
*/
|
|
674
|
+
export declare const DEPLOY_STAGES: readonly ['queued', 'starting', 'authenticating', 'fetching', 'prechecking', 'cleaning', 'synthesizing', 'deploying', 'registering', 'removing', 'done'];
|
|
675
|
+
export type DeployStage = (typeof DEPLOY_STAGES)[number];
|
|
676
|
+
/** A deploy build's state as a runner reports it (CodeBuild's BuildStatus, normalized). */
|
|
677
|
+
export declare const DEPLOY_BUILD_STATES: readonly ['in_progress', 'succeeded', 'failed', 'stopped', 'timed_out'];
|
|
678
|
+
export type DeployBuildState = (typeof DEPLOY_BUILD_STATES)[number];
|
|
679
|
+
/** CodeBuild's `buildStatus` → {@link DeployBuildState}: absent is still running, an unknown final status is `failed`. */
|
|
680
|
+
export declare function deployBuildState(codebuildStatus: string | null | undefined): DeployBuildState;
|
|
681
|
+
/** What kind of thing made a deploy fail — what the dashboard's next steps are keyed by. */
|
|
682
|
+
export declare const DEPLOY_FAILURE_CLASSES: readonly ['account_setup', 'definition', 'aws_permission', 'cloudformation', 'image', 'platform', 'timeout', 'cancelled', 'unknown'];
|
|
683
|
+
export type DeployFailureClass = (typeof DEPLOY_FAILURE_CLASSES)[number];
|
|
684
|
+
export interface RunnerDeployErrorMeta {
|
|
685
|
+
readonly class: DeployFailureClass;
|
|
686
|
+
/** Sending the same pipeline again (Retry / Change runner) can succeed without editing the pipeline. */
|
|
687
|
+
readonly retryable: boolean;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Every deploy RESULT code: the job's (its result post and exported
|
|
691
|
+
* PB_DEPLOY_RESULT) and the platform's own (grant refusals, deadline, cancel).
|
|
692
|
+
* Recorded as a deploy request's `errorCode`; never an HTTP answer (those are
|
|
693
|
+
* {@link RUNNER_ERRORS}), and no code is in both catalogs.
|
|
694
|
+
*/
|
|
695
|
+
export declare const RUNNER_DEPLOY_ERRORS: {
|
|
696
|
+
/** The job's grant exchange was refused (reused, unknown, wrong state). */
|
|
697
|
+
readonly DEPLOY_GRANT_REJECTED: {
|
|
698
|
+
readonly class: 'platform';
|
|
699
|
+
readonly retryable: false;
|
|
700
|
+
};
|
|
701
|
+
/** The grant expired before the job exchanged it ({@link DEPLOY_GRANT_TTL_MS}): the build queued too long. */
|
|
702
|
+
readonly DEPLOY_GRANT_EXPIRED: {
|
|
703
|
+
readonly class: 'platform';
|
|
704
|
+
readonly retryable: true;
|
|
705
|
+
};
|
|
706
|
+
/** The job could not read the pipeline through its session. */
|
|
707
|
+
readonly PIPELINE_FETCH_FAILED: {
|
|
708
|
+
readonly class: 'platform';
|
|
709
|
+
readonly retryable: true;
|
|
710
|
+
};
|
|
711
|
+
/** A plugin of the pipeline did not resolve (lookup through the session). */
|
|
712
|
+
readonly PLUGIN_RESOLUTION_FAILED: {
|
|
713
|
+
readonly class: 'definition';
|
|
714
|
+
readonly retryable: false;
|
|
715
|
+
};
|
|
716
|
+
/** The synthesized pipeline / stack names or region are not the ones the request named. */
|
|
717
|
+
readonly DEPLOY_TARGET_MISMATCH: {
|
|
718
|
+
readonly class: 'definition';
|
|
719
|
+
readonly retryable: false;
|
|
720
|
+
};
|
|
721
|
+
/** A stack of that name exists and is not this pipeline's (tagged for another pipeline, or untagged). */
|
|
722
|
+
readonly STACK_OWNED_BY_OTHER_PIPELINE: {
|
|
723
|
+
readonly class: 'definition';
|
|
724
|
+
readonly retryable: false;
|
|
725
|
+
};
|
|
726
|
+
/** The target region has no CDK bootstrap (`pipeline-manager bootstrap --region <r>`). */
|
|
727
|
+
readonly CDK_NOT_BOOTSTRAPPED: {
|
|
728
|
+
readonly class: 'account_setup';
|
|
729
|
+
readonly retryable: true;
|
|
730
|
+
};
|
|
731
|
+
/** The region's CDK bootstrap is older than the toolchain needs. */
|
|
732
|
+
readonly CDK_BOOTSTRAP_OUTDATED: {
|
|
733
|
+
readonly class: 'account_setup';
|
|
734
|
+
readonly retryable: true;
|
|
735
|
+
};
|
|
736
|
+
/** Secrets the pipeline needs are not in the account's Secrets Manager. */
|
|
737
|
+
readonly ACCOUNT_SECRETS_MISSING: {
|
|
738
|
+
readonly class: 'account_setup';
|
|
739
|
+
readonly retryable: true;
|
|
740
|
+
};
|
|
741
|
+
/** A bootstrap role refused an AWS call (or the permissions boundary did). */
|
|
742
|
+
readonly DEPLOY_PERMISSION_DENIED: {
|
|
743
|
+
readonly class: 'aws_permission';
|
|
744
|
+
readonly retryable: true;
|
|
745
|
+
};
|
|
746
|
+
/** `cdk deploy` failed in CloudFormation. */
|
|
747
|
+
readonly CFN_DEPLOY_FAILED: {
|
|
748
|
+
readonly class: 'cloudformation';
|
|
749
|
+
readonly retryable: true;
|
|
750
|
+
};
|
|
751
|
+
/** Deleting this pipeline's stack (cleaning a failed first deploy, or an undeploy) did not reach DELETE_COMPLETE. */
|
|
752
|
+
readonly STACK_DELETE_FAILED: {
|
|
753
|
+
readonly class: 'cloudformation';
|
|
754
|
+
readonly retryable: true;
|
|
755
|
+
};
|
|
756
|
+
/** CodeBuild could not pull the cdk-synth image (registry credential or host). */
|
|
757
|
+
readonly DEPLOY_IMAGE_PULL_FAILED: {
|
|
758
|
+
readonly class: 'image';
|
|
759
|
+
readonly retryable: true;
|
|
760
|
+
};
|
|
761
|
+
/** The image's deploy-job protocol is not the claim's ({@link DEPLOY_JOB_PROTOCOL_VERSION}). */
|
|
762
|
+
readonly DEPLOY_JOB_PROTOCOL_MISMATCH: {
|
|
763
|
+
readonly class: 'image';
|
|
764
|
+
readonly retryable: false;
|
|
765
|
+
};
|
|
766
|
+
/**
|
|
767
|
+
* The synthesized stack has Docker image assets: the deploy build is never
|
|
768
|
+
* privileged (no such mode exists on the runner), so a retry fails the same
|
|
769
|
+
* way. A runtime guard — the stacks this product synthesizes carry none.
|
|
770
|
+
*/
|
|
771
|
+
readonly DEPLOY_NEEDS_PRIVILEGED: {
|
|
772
|
+
readonly class: 'image';
|
|
773
|
+
readonly retryable: false;
|
|
774
|
+
};
|
|
775
|
+
/** Past RUNNER_DEPLOY_DEADLINE_MINUTES, or CodeBuild's own timeout. */
|
|
776
|
+
readonly DEPLOY_TIMED_OUT: {
|
|
777
|
+
readonly class: 'timeout';
|
|
778
|
+
readonly retryable: true;
|
|
779
|
+
};
|
|
780
|
+
/** A person cancelled it. */
|
|
781
|
+
readonly DEPLOY_CANCELLED: {
|
|
782
|
+
readonly class: 'cancelled';
|
|
783
|
+
readonly retryable: true;
|
|
784
|
+
};
|
|
785
|
+
/** Anything else inside the job. */
|
|
786
|
+
readonly DEPLOY_JOB_ERROR: {
|
|
787
|
+
readonly class: 'unknown';
|
|
788
|
+
readonly retryable: true;
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
export type RunnerDeployErrorCode = keyof typeof RUNNER_DEPLOY_ERRORS;
|
|
792
|
+
export declare const RUNNER_DEPLOY_ERROR_CODES: readonly RunnerDeployErrorCode[];
|
|
793
|
+
/** Whether `code` is a known deploy result error code. */
|
|
794
|
+
export declare function isRunnerDeployErrorCode(code: unknown): code is RunnerDeployErrorCode;
|
|
795
|
+
/** The job's success result. */
|
|
796
|
+
export declare const DEPLOY_RESULT_OK = "OK";
|
|
797
|
+
/** Everything a job may report as its result (PB_DEPLOY_RESULT / POST result): a fixed list — never a message, log line or ARN. */
|
|
798
|
+
export declare const DEPLOY_JOB_RESULT_CODES: readonly ["OK", ...("ACCOUNT_SECRETS_MISSING" | "CDK_BOOTSTRAP_OUTDATED" | "CDK_NOT_BOOTSTRAPPED" | "CFN_DEPLOY_FAILED" | "DEPLOY_CANCELLED" | "DEPLOY_GRANT_EXPIRED" | "DEPLOY_GRANT_REJECTED" | "DEPLOY_IMAGE_PULL_FAILED" | "DEPLOY_JOB_ERROR" | "DEPLOY_JOB_PROTOCOL_MISMATCH" | "DEPLOY_NEEDS_PRIVILEGED" | "DEPLOY_PERMISSION_DENIED" | "DEPLOY_TARGET_MISMATCH" | "DEPLOY_TIMED_OUT" | "PIPELINE_FETCH_FAILED" | "PLUGIN_RESOLUTION_FAILED" | "STACK_DELETE_FAILED" | "STACK_OWNED_BY_OTHER_PIPELINE")[]];
|
|
799
|
+
export type DeployJobResultCode = typeof DEPLOY_RESULT_OK | RunnerDeployErrorCode;
|
|
800
|
+
export declare function isDeployJobResultCode(code: unknown): code is DeployJobResultCode;
|
|
801
|
+
/** Any code a failed deploy request may record: a deploy result code or a runner catalog code (delivery, refusal). */
|
|
802
|
+
export type DeployErrorCode = RunnerDeployErrorCode | RunnerErrorCode;
|
|
803
|
+
/**
|
|
804
|
+
* A failed deploy's class and retryability from its recorded code: the
|
|
805
|
+
* deploy catalog's own; a runner refusal of the setup is `account_setup`; any
|
|
806
|
+
* other runner catalog code (not delivered, bad signature, …) `platform`; an
|
|
807
|
+
* unknown code `unknown`. Null for no code.
|
|
808
|
+
*/
|
|
809
|
+
export declare function deployFailureOf(code: string | null | undefined): {
|
|
810
|
+
failureClass: DeployFailureClass;
|
|
811
|
+
retryable: boolean;
|
|
812
|
+
} | null;
|
|
813
|
+
/** Why a grant exchange was refused (`details.reason` of 401 DEPLOY_GRANT_INVALID; the rejections metric's `reason` label). */
|
|
814
|
+
export declare const DEPLOY_GRANT_REJECTION_REASONS: readonly ['reused', 'expired', 'unknown', 'wrong_state'];
|
|
815
|
+
export type DeployGrantRejectionReason = (typeof DEPLOY_GRANT_REJECTION_REASONS)[number];
|
|
816
|
+
/** A deploy job grant: this prefix + 32 random bytes, base64url (single use, minted at queue time; only its sha256 is stored in clear). */
|
|
817
|
+
export declare const DEPLOY_GRANT_PREFIX = "pb_dg_";
|
|
818
|
+
/** A deploy session token: this prefix + 32 random bytes, base64url (opaque; body only; valid to the deploy deadline). */
|
|
819
|
+
export declare const DEPLOY_SESSION_PREFIX = "pb_ds_";
|
|
820
|
+
/** Random bytes in a grant / session token. */
|
|
821
|
+
export declare const DEPLOY_TOKEN_RANDOM_BYTES = 32;
|
|
822
|
+
export declare const DEPLOY_GRANT_PATTERN: RegExp;
|
|
823
|
+
export declare const DEPLOY_SESSION_PATTERN: RegExp;
|
|
824
|
+
/** The deploy project's QueuedTimeoutInMinutes (the runner stack's literal must equal it). */
|
|
825
|
+
export declare const DEPLOY_BUILD_QUEUED_TIMEOUT_MINUTES = 30;
|
|
826
|
+
/** Build provisioning (image pull, env start) on top of the queue, inside the grant's life. */
|
|
827
|
+
export declare const DEPLOY_GRANT_PROVISIONING_MARGIN_MS: number;
|
|
828
|
+
/** A grant's life: queue + provisioning, never shorter than the delivery lifetime. */
|
|
829
|
+
export declare function deployGrantTtlMs(queuedTimeoutMinutes?: number): number;
|
|
830
|
+
/** {@link deployGrantTtlMs} for the stack's queue timeout (45 min). */
|
|
831
|
+
export declare const DEPLOY_GRANT_TTL_MS: number;
|
|
832
|
+
/** The runner stack's DeployTimeoutMinutes parameter (CodeBuild TimeoutInMinutes). */
|
|
833
|
+
export declare const DEPLOY_BUILD_TIMEOUT_MINUTES: {
|
|
834
|
+
readonly default: 60;
|
|
835
|
+
readonly min: 10;
|
|
836
|
+
readonly max: 480;
|
|
837
|
+
};
|
|
838
|
+
/** The KMS encryption context `purpose` the grant is wrapped under in the runner's account. */
|
|
839
|
+
export declare const DEPLOY_GRANT_KMS_PURPOSE = "deploy-grant";
|
|
840
|
+
/** The KMS encryption context of a wrapped grant: only the RunnerRole encrypts and only the DeployRole decrypts under it. */
|
|
841
|
+
export declare function deployGrantEncryptionContext(runnerId: string): {
|
|
842
|
+
runnerId: string;
|
|
843
|
+
purpose: typeof DEPLOY_GRANT_KMS_PURPOSE;
|
|
844
|
+
};
|
|
845
|
+
/** The KMS ciphertext blob of a grant, base64 (PB_DEPLOY_GRANT_CIPHERTEXT). */
|
|
846
|
+
export declare const DEPLOY_GRANT_CIPHERTEXT_PATTERN: RegExp;
|
|
847
|
+
/** The managed image the deploy job runs (the pipeline's toolchain cdk-synth, pinned by digest). */
|
|
848
|
+
export declare const DEPLOY_JOB_IMAGE_REPOSITORY = "system/cdk-synth";
|
|
849
|
+
/** An image digest. */
|
|
850
|
+
export declare const DEPLOY_IMAGE_DIGEST_PATTERN: RegExp;
|
|
851
|
+
/**
|
|
852
|
+
* The deploy-job protocol the platform speaks. `pipeline-manager pipeline
|
|
853
|
+
* deploy-job --protocol` prints the image's; a toolchain release records the
|
|
854
|
+
* one its cdk-synth ships; the platform refuses an older release
|
|
855
|
+
* (TOOLCHAIN_TOO_OLD_FOR_DEPLOY) and the job refuses a claim that differs
|
|
856
|
+
* (DEPLOY_JOB_PROTOCOL_MISMATCH). Bump on any incompatible change to the
|
|
857
|
+
* claim, the env, the session facade or the result codes.
|
|
858
|
+
*/
|
|
859
|
+
export declare const DEPLOY_JOB_PROTOCOL_VERSION = 1;
|
|
860
|
+
/**
|
|
861
|
+
* The cdk-synth half's plugin-spec `metadata` key recording the deploy-job
|
|
862
|
+
* protocol its image ships (`pipeline-manager pipeline deploy-job --protocol`).
|
|
863
|
+
* The upload of that half copies it onto the release
|
|
864
|
+
* (`toolchain_release.deploy_job_protocol`); a release without it cannot
|
|
865
|
+
* deploy a pipeline through a runner (TOOLCHAIN_TOO_OLD_FOR_DEPLOY).
|
|
866
|
+
*/
|
|
867
|
+
export declare const DEPLOY_JOB_PROTOCOL_METADATA_KEY = "pb:deploy-job:protocol";
|
|
868
|
+
/** The protocol a cdk-synth row's `metadata` records (a whole number >= 1, as a number or digit string), else null. */
|
|
869
|
+
export declare function deployJobProtocolFromMetadata(metadata: unknown): number | null;
|
|
870
|
+
/** What the job does: deploy the pipeline, or delete its stack (only when tagged for this pipeline). */
|
|
871
|
+
export declare const DEPLOY_JOB_MODES: readonly ['deploy', 'undeploy'];
|
|
872
|
+
export type DeployJobMode = (typeof DEPLOY_JOB_MODES)[number];
|
|
873
|
+
/** Every env name of the deploy job. The runner overrides only {@link DEPLOY_JOB_OVERRIDE_ENV}; the job exports {@link DEPLOY_JOB_EXPORTED_VARIABLES}. */
|
|
874
|
+
export declare const DEPLOY_JOB_ENV: {
|
|
875
|
+
readonly requestId: 'PB_REQUEST_ID';
|
|
876
|
+
readonly pipelineId: 'PB_PIPELINE_ID';
|
|
877
|
+
readonly region: 'PB_TARGET_REGION';
|
|
878
|
+
readonly pipelineName: 'PB_PIPELINE_NAME';
|
|
879
|
+
readonly stackName: 'PB_STACK_NAME';
|
|
880
|
+
readonly grantCiphertext: 'PB_DEPLOY_GRANT_CIPHERTEXT';
|
|
881
|
+
readonly toolchainRelease: 'PB_TOOLCHAIN_RELEASE';
|
|
882
|
+
readonly protocol: 'PB_DEPLOY_PROTOCOL';
|
|
883
|
+
readonly mode: 'PB_JOB_MODE';
|
|
884
|
+
readonly result: 'PB_DEPLOY_RESULT';
|
|
885
|
+
readonly stage: 'PB_DEPLOY_STAGE';
|
|
886
|
+
};
|
|
887
|
+
export type DeployJobEnvName = (typeof DEPLOY_JOB_ENV)[keyof typeof DEPLOY_JOB_ENV];
|
|
888
|
+
/** The job's exported variables (read back through BatchGetBuilds by deploy_status). */
|
|
889
|
+
export declare const DEPLOY_JOB_EXPORTED_VARIABLES: readonly ["PB_DEPLOY_RESULT", "PB_DEPLOY_STAGE"];
|
|
890
|
+
/** The only env overrides the runner passes to StartBuild. */
|
|
891
|
+
export declare const DEPLOY_JOB_OVERRIDE_ENV: readonly ["PB_REQUEST_ID", "PB_PIPELINE_ID", "PB_TARGET_REGION", "PB_PIPELINE_NAME", "PB_STACK_NAME", "PB_DEPLOY_GRANT_CIPHERTEXT", "PB_TOOLCHAIN_RELEASE", "PB_DEPLOY_PROTOCOL", "PB_JOB_MODE"];
|
|
892
|
+
/** The runner stack's deploy CodeBuild project. */
|
|
893
|
+
export declare function deployProjectName(runnerId: string): string;
|
|
894
|
+
/** Its CloudWatch log group. */
|
|
895
|
+
export declare function deployLogGroupName(runnerId: string): string;
|
|
896
|
+
/** Where to look in the runner's account for a deploy's build logs. Never an account id (a build id is `<project>:<uuid>`). */
|
|
897
|
+
export interface DeployLogHint {
|
|
898
|
+
project: string;
|
|
899
|
+
logGroup: string;
|
|
900
|
+
buildId: string | null;
|
|
901
|
+
}
|
|
902
|
+
export declare function deployLogHint(runnerId: string, buildId: string | null): DeployLogHint;
|
|
903
|
+
/** The command that turns deploys on for a runner. */
|
|
904
|
+
export declare const DEPLOY_SETUP_COMMAND = "pipeline-manager infra setup-runner --enable-deploy";
|
|
905
|
+
/** The facade routes under `/api/pipelines/runner/deploys/:requestId/`. `session` exchanges the grant; the rest take the session token. */
|
|
906
|
+
export declare const DEPLOY_SESSION_LEAVES: readonly ['session', 'pipeline', 'plugin-lookup', 'progress', 'registry', 'result'];
|
|
907
|
+
export type DeploySessionLeaf = (typeof DEPLOY_SESSION_LEAVES)[number];
|
|
908
|
+
export declare function runnerDeployPath(requestId: string, leaf: DeploySessionLeaf): string;
|
|
909
|
+
/** `deploying` / `undeploying` (the build started, or the one already running for this request id). */
|
|
910
|
+
export interface RunnerDeployStartedReply {
|
|
911
|
+
buildId: string;
|
|
912
|
+
}
|
|
913
|
+
/** `deploy_status`: state, stage and result code only — never logs, messages or ARNs. */
|
|
914
|
+
export interface RunnerDeployStatusReply {
|
|
915
|
+
buildState: DeployBuildState;
|
|
916
|
+
stage: DeployStage | null;
|
|
917
|
+
resultCode: DeployJobResultCode | null;
|
|
918
|
+
}
|
|
919
|
+
/** `deploy_cancelled` (StopBuild accepted; the final status comes from the poll). */
|
|
920
|
+
export interface RunnerDeployCancelledReply {
|
|
921
|
+
buildState: DeployBuildState;
|
|
922
|
+
}
|
|
923
|
+
/** Why an eligible runner cannot deploy a pipeline (`GET …/deploy-targets`, `details.reason` of RUNNER_NOT_DEPLOYABLE). */
|
|
924
|
+
/**
|
|
925
|
+
* Why a purge left a pipeline's stack in the customer's account instead of
|
|
926
|
+
* asking its runner to remove it (purge result `stackRetained.reason`, the 409's
|
|
927
|
+
* `details.stackRetainedReason`, and the deleted-pipeline row's notice).
|
|
928
|
+
*/
|
|
929
|
+
export declare const STACK_RETAINED_REASONS: readonly ['no_runner', 'runner_not_deploy_capable', 'toolchain_too_old', 'no_stack'];
|
|
930
|
+
export type StackRetainedReason = (typeof STACK_RETAINED_REASONS)[number];
|
|
931
|
+
export declare const DEPLOY_TARGET_REASONS: readonly ['deploy_not_enabled', 'update_required', 'unhealthy', 'prefix_mismatch', 'team_deploys_not_shared', 'region'];
|
|
932
|
+
export type DeployTargetReason = (typeof DEPLOY_TARGET_REASONS)[number];
|
|
933
|
+
/** Metric names the deploy path and its alerts share. */
|
|
934
|
+
export declare const RUNNER_DEPLOY_METRICS: {
|
|
935
|
+
/** Counter `{outcome}`: finished deploys (deployed | failed | expired | cancelled). */
|
|
936
|
+
readonly deploys: 'pipeline_runner_deploys_total';
|
|
937
|
+
/** Counter `{class}`: failed deploys by {@link DeployFailureClass} (RunnerDeployPlatformFailures on class="platform"). */
|
|
938
|
+
readonly failuresByClass: 'pipeline_runner_deploy_failures_total';
|
|
939
|
+
/** Histogram: accepted → finished. */
|
|
940
|
+
readonly duration: 'pipeline_runner_deploy_duration_seconds';
|
|
941
|
+
/** Gauge: deploying requests past their deadline (RunnerDeployStuck). */
|
|
942
|
+
readonly overdue: 'pipeline_runner_deploys_overdue';
|
|
943
|
+
/** Counter `{reason}`: refused grant exchanges by {@link DeployGrantRejectionReason} (RunnerDeployGrantReuse on reason="reused"). */
|
|
944
|
+
readonly grantRejections: 'pipeline_runner_deploy_grant_rejections_total';
|
|
945
|
+
};
|
|
475
946
|
/** One of an org's published keys. Never key material: id, state and dates only. */
|
|
476
947
|
export interface RunnerSigningKeySummary {
|
|
477
948
|
/** RFC 7638 thumbprint (the JWK `kid`). */
|
|
@@ -575,6 +1046,12 @@ export interface PipelineRunnerDto {
|
|
|
575
1046
|
jwksUrl: string;
|
|
576
1047
|
/** Pipelines linked to this runner (`pipeline_registry.runner_id`). */
|
|
577
1048
|
pipelineCount: number;
|
|
1049
|
+
/** What its bundle reported in its last pong (`deploy:1`: deploys enabled). */
|
|
1050
|
+
capabilities: RunnerCapability[];
|
|
1051
|
+
/** Teams this runner is shared with may also DEPLOY through it (off by default; needs shareWithTeams). */
|
|
1052
|
+
shareDeploysWithTeams: boolean;
|
|
1053
|
+
/** The pipeline-name prefixes its stack allows (`*` = all), as its last pong reported them. */
|
|
1054
|
+
pipelinePrefixes: string[];
|
|
578
1055
|
}
|
|
579
1056
|
/** A parent org's runner shared with this team (signed with the parent's effective key). */
|
|
580
1057
|
export interface InheritedPipelineRunnerDto extends PipelineRunnerDto {
|
|
@@ -608,12 +1085,36 @@ export interface RunnerLinkDto {
|
|
|
608
1085
|
lastDeliveryAt: string | null;
|
|
609
1086
|
ownerOrgName: string | null;
|
|
610
1087
|
isOwn: boolean;
|
|
1088
|
+
/** What its bundle reported in its last pong (`deploy:1`: a purge removes the pipeline's stack through it). */
|
|
1089
|
+
capabilities: RunnerCapability[];
|
|
611
1090
|
} | null;
|
|
612
1091
|
checkedAt: string | null;
|
|
613
1092
|
detail: RunnerLinkDetail | null;
|
|
614
1093
|
/** The platform pause toggle is on (the pipeline page's banner). */
|
|
615
1094
|
deliveriesPaused: boolean;
|
|
616
1095
|
}
|
|
1096
|
+
/**
|
|
1097
|
+
* `deployment` on each row of `GET /pipelines/deleted` (the Recently deleted
|
|
1098
|
+
* list): what a PURGE of the tombstone does to its stack. Null when the
|
|
1099
|
+
* pipeline has no registration (nothing deployed, nothing to remove).
|
|
1100
|
+
*/
|
|
1101
|
+
export interface DeletedPipelineDeploymentDto {
|
|
1102
|
+
stackName: string | null;
|
|
1103
|
+
region: string | null;
|
|
1104
|
+
/** The registry row's linked runner (labels only), or null. */
|
|
1105
|
+
runner: {
|
|
1106
|
+
id: string;
|
|
1107
|
+
label: string;
|
|
1108
|
+
capabilities: RunnerCapability[];
|
|
1109
|
+
} | null;
|
|
1110
|
+
/**
|
|
1111
|
+
* A purge sends that runner an `undeploy` and the stack goes with the
|
|
1112
|
+
* pipeline (an active runner listing `deploy:1`, and a stack name and region
|
|
1113
|
+
* to remove). False: the stack stays in the account — remove it with
|
|
1114
|
+
* `cdk destroy` / CloudFormation (and a purge needs `?force=true`).
|
|
1115
|
+
*/
|
|
1116
|
+
stackRemovedOnPurge: boolean;
|
|
1117
|
+
}
|
|
617
1118
|
/** One row of `GET /pipelines/admin/runner-signing-keys` (operators). Never key material. */
|
|
618
1119
|
export interface RunnerKeyStatusRow {
|
|
619
1120
|
orgId: string;
|
|
@@ -665,4 +1166,107 @@ export interface RunnerPublicJwk {
|
|
|
665
1166
|
export interface RunnerJwksDto {
|
|
666
1167
|
keys: RunnerPublicJwk[];
|
|
667
1168
|
}
|
|
1169
|
+
/** One eligible runner on `GET /pipelines/:pipelineId/deploy-targets`. Never an account id or a URL. */
|
|
1170
|
+
export interface DeployTargetRunnerDto {
|
|
1171
|
+
id: string;
|
|
1172
|
+
label: string;
|
|
1173
|
+
/** The caller's org owns it (false for an ancestor's shared runner). */
|
|
1174
|
+
isOwn: boolean;
|
|
1175
|
+
/** Set for every runner that is not the caller's own. */
|
|
1176
|
+
ownerOrgName: string | null;
|
|
1177
|
+
/** Its allowed regions (a deploy into one of them; required in the body when there are several). */
|
|
1178
|
+
regions: string[];
|
|
1179
|
+
deployable: boolean;
|
|
1180
|
+
/** Null when deployable. */
|
|
1181
|
+
reason: DeployTargetReason | null;
|
|
1182
|
+
}
|
|
1183
|
+
/** `GET /pipelines/:pipelineId/deploy-targets`. */
|
|
1184
|
+
export interface DeployTargetsDto {
|
|
1185
|
+
pipelineId: string;
|
|
1186
|
+
available: boolean;
|
|
1187
|
+
unavailableReason: RunnersUnavailableReason | null;
|
|
1188
|
+
/** The pipeline already has a registry row (no deploy through a runner). */
|
|
1189
|
+
alreadyDeployed: boolean;
|
|
1190
|
+
/** The pipeline's active deploy, if any (resume it instead of starting one). */
|
|
1191
|
+
activeRequestId: string | null;
|
|
1192
|
+
/** Every eligible runner, deployable or not. */
|
|
1193
|
+
runners: DeployTargetRunnerDto[];
|
|
1194
|
+
/** The runner used when the body names none: set when exactly one is deployable. */
|
|
1195
|
+
autoRunnerId: string | null;
|
|
1196
|
+
/** {@link DEPLOY_SETUP_COMMAND}, for the "no deployable runner" copy. */
|
|
1197
|
+
setupCommand: string;
|
|
1198
|
+
}
|
|
1199
|
+
/** `POST /pipelines/:pipelineId/deploys` body. */
|
|
1200
|
+
export interface DeployStartBody {
|
|
1201
|
+
runnerId?: string;
|
|
1202
|
+
region?: string;
|
|
1203
|
+
}
|
|
1204
|
+
/** The 202 of `POST /pipelines/:pipelineId/deploys`. `reused`: the pipeline's active deploy on the same runner was returned instead of a new one. */
|
|
1205
|
+
export interface QueuedDeployDto {
|
|
1206
|
+
requestId: string;
|
|
1207
|
+
status: ActiveDeployStatus;
|
|
1208
|
+
runnerLabel: string;
|
|
1209
|
+
region: string;
|
|
1210
|
+
reused: boolean;
|
|
1211
|
+
}
|
|
1212
|
+
/** `GET /pipelines/:pipelineId/deploys/latest` and `GET /pipelines/:pipelineId/deploys/:requestId`. */
|
|
1213
|
+
export interface DeployRequestDto {
|
|
1214
|
+
requestId: string;
|
|
1215
|
+
pipelineId: string;
|
|
1216
|
+
status: DeployRequestStatus;
|
|
1217
|
+
stage: DeployStage;
|
|
1218
|
+
runnerId: string;
|
|
1219
|
+
runnerLabel: string;
|
|
1220
|
+
region: string;
|
|
1221
|
+
/** Set on a failed / expired / cancelled request. */
|
|
1222
|
+
errorCode: DeployErrorCode | null;
|
|
1223
|
+
failureClass: DeployFailureClass | null;
|
|
1224
|
+
/** Whether Retry / Change runner is offered ({@link deployFailureOf}); false while not failed. */
|
|
1225
|
+
retryable: boolean;
|
|
1226
|
+
requestedAt: string;
|
|
1227
|
+
/** When the runner answered `deploying`. */
|
|
1228
|
+
acceptedAt: string | null;
|
|
1229
|
+
finishedAt: string | null;
|
|
1230
|
+
deadlineAt: string | null;
|
|
1231
|
+
/** Where the build logs are in the runner's account ({@link deployLogHint}); null before the runner accepted. */
|
|
1232
|
+
logHint: DeployLogHint | null;
|
|
1233
|
+
}
|
|
1234
|
+
/** `POST …/deploys/:requestId/session` body. */
|
|
1235
|
+
export interface DeploySessionBody {
|
|
1236
|
+
grant: string;
|
|
1237
|
+
}
|
|
1238
|
+
/** The 200 of `POST …/deploys/:requestId/session` (`Cache-Control: no-store`). */
|
|
1239
|
+
export interface DeploySessionDto {
|
|
1240
|
+
/** {@link DEPLOY_SESSION_PATTERN}; sent back as `Authorization: Bearer`. */
|
|
1241
|
+
sessionToken: string;
|
|
1242
|
+
expiresAt: string;
|
|
1243
|
+
requestId: string;
|
|
1244
|
+
pipelineId: string;
|
|
1245
|
+
region: string;
|
|
1246
|
+
pipelineName: string;
|
|
1247
|
+
stackName: string;
|
|
1248
|
+
toolchainRelease: string;
|
|
1249
|
+
protocol: number;
|
|
1250
|
+
}
|
|
1251
|
+
/** `POST …/deploys/:requestId/progress` body. */
|
|
1252
|
+
export interface DeployProgressBody {
|
|
1253
|
+
stage: DeployStage;
|
|
1254
|
+
}
|
|
1255
|
+
/** `POST …/deploys/:requestId/result` body. */
|
|
1256
|
+
export interface DeployResultBody {
|
|
1257
|
+
code: DeployJobResultCode;
|
|
1258
|
+
/** The stage it ended in. */
|
|
1259
|
+
stage?: DeployStage;
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* `POST …/deploys/:requestId/registry` body. The org, pipeline id and runner
|
|
1263
|
+
* come from the session; the names and region must be the deploy's own.
|
|
1264
|
+
*/
|
|
1265
|
+
export interface DeployRegistryBody {
|
|
1266
|
+
pipelineName: string;
|
|
1267
|
+
stackName: string;
|
|
1268
|
+
region: string;
|
|
1269
|
+
/** The synth's step manifest (pipeline-core `StepManifestEntry[]`), as `POST /pipelines/registry` takes it. */
|
|
1270
|
+
steps?: Array<Record<string, unknown>>;
|
|
1271
|
+
}
|
|
668
1272
|
export {};
|