@pipeline-builder/api-core 7.3.4 → 7.4.1
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/config.d.ts +126 -0
- package/lib/config.js +120 -0
- package/lib/constants/ai-providers.d.ts +1 -2
- package/lib/constants/ai-providers.js +7 -6
- package/lib/constants/index.d.ts +0 -1
- package/lib/constants/index.js +1 -2
- package/lib/contracts/image-registry.d.ts +5 -0
- package/lib/contracts/image-registry.js +9 -4
- package/lib/contracts/index.d.ts +1 -1
- package/lib/contracts/index.js +2 -2
- package/lib/contracts/pipeline.d.ts +6 -2
- package/lib/contracts/pipeline.js +11 -3
- package/lib/contracts/plugin.js +3 -3
- package/lib/helpers/index.d.ts +1 -1
- package/lib/helpers/index.js +2 -2
- package/lib/helpers/org-hierarchy-http.d.ts +17 -0
- package/lib/helpers/org-hierarchy-http.js +21 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/middleware/client-version.js +3 -2
- package/lib/middleware/deferred-quota-check.js +5 -2
- package/lib/middleware/jwt-verify.js +4 -3
- package/lib/middleware/revocation.js +17 -5
- package/lib/middleware/service-tokens.js +3 -5
- package/lib/middleware/step-up.js +4 -2
- package/lib/services/ai-call-weight.js +3 -2
- package/lib/services/ai-draft-store.d.ts +1 -1
- package/lib/services/ai-draft-store.js +2 -2
- package/lib/services/api-key-exchange.js +4 -3
- package/lib/services/audit-spool.js +4 -3
- package/lib/services/circuit-breaker.js +3 -7
- package/lib/services/compliance-client.js +4 -4
- package/lib/services/durable-event-bus.js +10 -8
- package/lib/services/env-redis.d.ts +1 -1
- package/lib/services/env-redis.js +3 -2
- package/lib/services/http-client.js +5 -5
- package/lib/services/jwks-cache.js +3 -3
- package/lib/services/leader-lock.d.ts +1 -1
- package/lib/services/leader-lock.js +4 -3
- package/lib/services/org-ai-client.js +4 -4
- package/lib/services/pagerduty-inbound.js +3 -4
- package/lib/services/quota-increment-batcher.js +5 -5
- package/lib/services/quota.d.ts +3 -3
- package/lib/services/quota.js +6 -6
- package/lib/services/remote-audit-client.d.ts +2 -2
- package/lib/services/remote-audit-client.js +3 -2
- package/lib/services/retry-strategy.d.ts +1 -1
- package/lib/services/retry-strategy.js +7 -7
- package/lib/services/s3-client.d.ts +11 -11
- package/lib/services/s3-client.js +24 -18
- package/lib/services/scheduler.js +18 -11
- package/lib/types/ai-catalog.d.ts +54 -0
- package/lib/types/ai-catalog.js +68 -1
- package/lib/types/ask-proposals.d.ts +5 -5
- package/lib/types/ask-proposals.js +6 -12
- package/lib/types/build-catalog.d.ts +8 -0
- package/lib/types/build-catalog.js +13 -1
- package/lib/types/common.js +1 -1
- package/lib/types/ecosystem-notifications.d.ts +2 -0
- package/lib/types/ecosystem-notifications.js +3 -2
- package/lib/types/ecosystem.d.ts +6 -0
- package/lib/types/ecosystem.js +8 -13
- package/lib/types/error-codes.d.ts +39 -0
- package/lib/types/error-codes.js +53 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/types/index.js +4 -2
- package/lib/types/pipeline-naming.d.ts +117 -0
- package/lib/types/pipeline-naming.js +157 -0
- package/lib/types/pipeline-runners.d.ts +193 -8
- package/lib/types/pipeline-runners.js +172 -21
- package/lib/types/pipeline-source.d.ts +107 -0
- package/lib/types/pipeline-source.js +184 -0
- package/lib/types/plan-tiers.d.ts +1 -1
- package/lib/types/plan-tiers.js +15 -12
- package/lib/types/plugin-remediation.d.ts +30 -10
- package/lib/types/plugin-remediation.js +29 -30
- package/lib/types/plugin-scan.d.ts +3 -2
- package/lib/types/plugin-scan.js +17 -6
- package/lib/types/toolchain-remediation.d.ts +0 -7
- package/lib/types/toolchain-remediation.js +1 -16
- package/lib/types/wire-vocabulary.d.ts +10 -0
- package/lib/types/wire-vocabulary.js +9 -1
- package/lib/utils/alias-resolver.js +3 -6
- package/lib/utils/concurrency-gate.js +13 -7
- package/lib/utils/env.d.ts +69 -5
- package/lib/utils/env.js +204 -16
- package/lib/utils/logger.js +20 -9
- package/lib/utils/pipeline-identity.d.ts +15 -5
- package/lib/utils/pipeline-identity.js +19 -21
- package/lib/utils/secret-encryption.d.ts +11 -10
- package/lib/utils/secret-encryption.js +16 -15
- package/lib/validation/ai-schemas.d.ts +6 -0
- package/lib/validation/ai-schemas.js +30 -3
- package/lib/validation/common-schemas.js +5 -5
- package/lib/validation/message-schemas.js +3 -3
- package/lib/validation/pipeline-schemas.d.ts +3 -3
- package/lib/validation/pipeline-schemas.js +19 -3
- package/lib/validation/pipeline-template-schemas.d.ts +1 -1
- package/lib/validation/pipeline-template-schemas.js +7 -2
- package/package.json +15 -1
- package/lib/constants/ai-draft.d.ts +0 -37
- package/lib/constants/ai-draft.js +0 -38
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Copyright 2026 Pipeline Builder Contributors
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* The naming LIMITS a pipeline's identity must satisfy, as one dependency-free
|
|
5
|
+
* module: the pipeline service enforces them at create, and the browser imports
|
|
6
|
+
* them (`@pipeline-builder/api-core/pipeline-naming`) to validate the Project
|
|
7
|
+
* field as it is typed. The derivations themselves (`defaultPipelineName`,
|
|
8
|
+
* `pipelineStackName`, which hash with node's `crypto`) live in
|
|
9
|
+
* `utils/pipeline-identity.ts` and read their rules from here, so the length a
|
|
10
|
+
* check predicts is the length the derivation produces.
|
|
11
|
+
*
|
|
12
|
+
* A pipeline deploys as two AWS names, both derived from its (project,
|
|
13
|
+
* organization) pair:
|
|
14
|
+
* - the CodePipeline `<org>-<project>-pipeline[-<hash>]`, at most
|
|
15
|
+
* {@link CODEPIPELINE_NAME_MAX_LENGTH} characters — the binding limit;
|
|
16
|
+
* - the CloudFormation stack `<project>-<org>[-<hash>]`, at most
|
|
17
|
+
* {@link STACK_NAME_MAX_LENGTH}, which the derivation truncates to fit.
|
|
18
|
+
*/
|
|
19
|
+
/** CodePipeline's pipeline-name length limit. */
|
|
20
|
+
export const CODEPIPELINE_NAME_MAX_LENGTH = 100;
|
|
21
|
+
/** CloudFormation's stack-name length limit. */
|
|
22
|
+
export const STACK_NAME_MAX_LENGTH = 128;
|
|
23
|
+
/** CodePipeline's pipeline-name character rule. */
|
|
24
|
+
export const CODEPIPELINE_NAME_PATTERN = /^[A-Za-z0-9.@_-]+$/;
|
|
25
|
+
/**
|
|
26
|
+
* What a project may be called: a letter or digit, then letters, digits,
|
|
27
|
+
* hyphens, underscores and dots. Anything else (spaces, slashes, `{{ }}` left
|
|
28
|
+
* unresolved …) would be rewritten beyond recognition by the derivations.
|
|
29
|
+
*/
|
|
30
|
+
export const PROJECT_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
31
|
+
/** Said when a project breaks {@link PROJECT_NAME_PATTERN}. */
|
|
32
|
+
export const PROJECT_NAME_PATTERN_MESSAGE = 'Project must start with a letter or digit and use only letters, digits, hyphens (-), underscores (_) and dots (.)';
|
|
33
|
+
/**
|
|
34
|
+
* Characters a (project, organization) name may hold and still derive its
|
|
35
|
+
* pipeline and stack names WITHOUT a disambiguating hash: letters, digits and
|
|
36
|
+
* hyphens (see `pipelineIdentityHash`).
|
|
37
|
+
*/
|
|
38
|
+
export const CLEAN_NAME_PATTERN = /^[A-Za-z0-9-]*$/;
|
|
39
|
+
/** `-<8 hex>`: the disambiguating suffix a lossy derivation appends. */
|
|
40
|
+
export const IDENTITY_HASH_SUFFIX_LENGTH = 9;
|
|
41
|
+
/** The fixed tail of a derived CodePipeline name. */
|
|
42
|
+
const PIPELINE_SUFFIX = '-pipeline';
|
|
43
|
+
/**
|
|
44
|
+
* The pipeline-name segment a PROJECT becomes: non-alphanumerics -> `_`,
|
|
45
|
+
* lowercased. A project's hyphens become `_` too, so the name splits back into
|
|
46
|
+
* one (organization, project) pair: everything before the last `-` ahead of
|
|
47
|
+
* `-pipeline` is the organization.
|
|
48
|
+
*/
|
|
49
|
+
export function pipelineNameSegment(value) {
|
|
50
|
+
return value.replace(/[^a-zA-Z0-9]/g, '_').toLowerCase();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The pipeline-name segment an ORGANIZATION becomes: lowercased, with every
|
|
54
|
+
* character but letters, digits and HYPHENS -> `_`. Hyphens are kept because
|
|
55
|
+
* an organization identity is a slug, and a team's is `<root-slug>-<team-slug>`:
|
|
56
|
+
* its pipelines must start with `<root-slug>-` so a runner its root org shares
|
|
57
|
+
* (pipeline prefix `<root-slug>-`) admits them.
|
|
58
|
+
*/
|
|
59
|
+
export function organizationNameSegment(value) {
|
|
60
|
+
return value.replace(/[^a-zA-Z0-9-]/g, '_').toLowerCase();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The longest org slug. A team's organization identity is two slugs joined
|
|
64
|
+
* by `-` (at most 41 characters), which leaves a clean project at least 49
|
|
65
|
+
* characters in the 100-character CodePipeline name
|
|
66
|
+
* (`<identity>-<project>-pipeline`), and 40 for one that derives the hash.
|
|
67
|
+
*/
|
|
68
|
+
export const ORG_SLUG_MAX_LENGTH = 20;
|
|
69
|
+
/** The shortest org slug. */
|
|
70
|
+
export const ORG_SLUG_MIN_LENGTH = 2;
|
|
71
|
+
/**
|
|
72
|
+
* An org slug (root or team): a lowercase letter, then lowercase letters and
|
|
73
|
+
* digits — NO hyphen and no underscore. Runner prefixes match by `startsWith`
|
|
74
|
+
* and `-` is the separator, so a slug holding `-` would let one org's prefix
|
|
75
|
+
* match another's pipelines (`acme-` admitting `acme-corp`'s, a team `front`'s
|
|
76
|
+
* `acme-front-` admitting team `front-end`'s). Without it every `-` in an
|
|
77
|
+
* identity is a real level boundary.
|
|
78
|
+
*/
|
|
79
|
+
export const ORG_SLUG_PATTERN = /^[a-z][a-z0-9]{1,19}$/;
|
|
80
|
+
/** Said when a slug breaks {@link ORG_SLUG_PATTERN}. */
|
|
81
|
+
export const ORG_SLUG_PATTERN_MESSAGE = `Slug must be ${ORG_SLUG_MIN_LENGTH}-${ORG_SLUG_MAX_LENGTH} lowercase letters and digits, starting with a letter (no hyphens or underscores)`;
|
|
82
|
+
/**
|
|
83
|
+
* The organization IDENTITY a pipeline of an org carries — what names its
|
|
84
|
+
* CodePipeline (`<identity>-<project>-pipeline`) and its stack. A top-level
|
|
85
|
+
* org's is its slug; a team's (an org with a parent) is
|
|
86
|
+
* `<root-slug>-<team-slug>` — exactly one hyphen per level, since slugs hold
|
|
87
|
+
* none and a project segment holds none either. So a root runner's default
|
|
88
|
+
* prefix `<root-slug>-` matches every pipeline of the account (its teams'
|
|
89
|
+
* included) and nobody else's, and a team runner's `<root-slug>-<team-slug>-`
|
|
90
|
+
* matches only that team's.
|
|
91
|
+
* Slugs are immutable, so the identity never changes under a deployed stack.
|
|
92
|
+
*/
|
|
93
|
+
export function pipelineOrganizationIdentity(slug, rootSlug) {
|
|
94
|
+
return rootSlug ? `${rootSlug}-${slug}` : slug;
|
|
95
|
+
}
|
|
96
|
+
/** Whether the (project, organization) pair derives its names with the disambiguating hash. */
|
|
97
|
+
export function pipelineIdentityIsLossy(project, organization) {
|
|
98
|
+
return !(CLEAN_NAME_PATTERN.test(project) && CLEAN_NAME_PATTERN.test(organization));
|
|
99
|
+
}
|
|
100
|
+
/** The length of the CodePipeline name `defaultPipelineName(organization, project)` derives. */
|
|
101
|
+
export function derivedPipelineNameLength(organization, project) {
|
|
102
|
+
return organization.length + 1 + project.length + PIPELINE_SUFFIX.length
|
|
103
|
+
+ (pipelineIdentityIsLossy(project, organization) ? IDENTITY_HASH_SUFFIX_LENGTH : 0);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The longest project `organization` admits, for a project of `project`'s
|
|
107
|
+
* kind (a clean one derives without the hash, so it may be 9 characters longer).
|
|
108
|
+
* Pass no project for the conservative bound (assumes the hash).
|
|
109
|
+
*/
|
|
110
|
+
export function maxProjectLength(organization, project) {
|
|
111
|
+
const lossy = project === undefined || pipelineIdentityIsLossy(project, organization);
|
|
112
|
+
return CODEPIPELINE_NAME_MAX_LENGTH - organization.length - 1 - PIPELINE_SUFFIX.length
|
|
113
|
+
- (lossy ? IDENTITY_HASH_SUFFIX_LENGTH : 0);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Why `project` cannot name a pipeline of `organization`, or null when it can.
|
|
117
|
+
* Checks the characters ({@link PROJECT_NAME_PATTERN}) and that the derived
|
|
118
|
+
* CodePipeline name fits {@link CODEPIPELINE_NAME_MAX_LENGTH} (the stack name
|
|
119
|
+
* always fits: its derivation truncates). The message names the limit.
|
|
120
|
+
*/
|
|
121
|
+
export function projectNameError(project, organization) {
|
|
122
|
+
const value = project.trim();
|
|
123
|
+
if (!value)
|
|
124
|
+
return 'Project is required';
|
|
125
|
+
if (!PROJECT_NAME_PATTERN.test(value))
|
|
126
|
+
return PROJECT_NAME_PATTERN_MESSAGE;
|
|
127
|
+
const max = maxProjectLength(organization, value);
|
|
128
|
+
if (max < 1) {
|
|
129
|
+
return `Organization "${organization}" is too long to derive a pipeline name: CodePipeline names are at most `
|
|
130
|
+
+ `${CODEPIPELINE_NAME_MAX_LENGTH} characters.`;
|
|
131
|
+
}
|
|
132
|
+
if (value.length > max) {
|
|
133
|
+
return `Project is too long: at most ${max} characters in organization "${organization}" (it is ${value.length}), `
|
|
134
|
+
+ 'because the pipeline name "<organization>-<project>-pipeline" must fit CodePipeline\'s '
|
|
135
|
+
+ `${CODEPIPELINE_NAME_MAX_LENGTH}-character limit.`;
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
/** Why `name` cannot be a CodePipeline name, or null when it can. */
|
|
140
|
+
export function pipelineNameError(name) {
|
|
141
|
+
if (!name)
|
|
142
|
+
return 'Pipeline name must not be empty';
|
|
143
|
+
if (name.length > CODEPIPELINE_NAME_MAX_LENGTH) {
|
|
144
|
+
return `Pipeline name is too long: at most ${CODEPIPELINE_NAME_MAX_LENGTH} characters (it is ${name.length}).`;
|
|
145
|
+
}
|
|
146
|
+
if (!CODEPIPELINE_NAME_PATTERN.test(name)) {
|
|
147
|
+
return 'Pipeline name may use only letters, digits and . @ _ -';
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The create-time checks `POST /pipelines/validate` runs, in the order it runs
|
|
153
|
+
* them — the `stage` each problem or warning in its report names. The pipeline
|
|
154
|
+
* service tags its findings with these and the create modal's Check reads them.
|
|
155
|
+
*/
|
|
156
|
+
export const PIPELINE_CHECK_STAGES = ['schema', 'name', 'source', 'template', 'contract', 'plugin', 'compliance', 'quota'];
|
|
157
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGlwZWxpbmUtbmFtaW5nLmpzIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwZXMvcGlwZWxpbmUtbmFtaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLCtDQUErQztBQUMvQyxzQ0FBc0M7QUFFdEM7Ozs7Ozs7Ozs7Ozs7OztHQWVHO0FBRUgsaURBQWlEO0FBQ2pELE1BQU0sQ0FBQyxNQUFNLDRCQUE0QixHQUFHLEdBQUcsQ0FBQztBQUVoRCxnREFBZ0Q7QUFDaEQsTUFBTSxDQUFDLE1BQU0scUJBQXFCLEdBQUcsR0FBRyxDQUFDO0FBRXpDLG1EQUFtRDtBQUNuRCxNQUFNLENBQUMsTUFBTSx5QkFBeUIsR0FBRyxvQkFBb0IsQ0FBQztBQUU5RDs7OztHQUlHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sb0JBQW9CLEdBQUcsOEJBQThCLENBQUM7QUFFbkUsK0RBQStEO0FBQy9ELE1BQU0sQ0FBQyxNQUFNLDRCQUE0QixHQUN2QyxtSEFBbUgsQ0FBQztBQUV0SDs7OztHQUlHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sa0JBQWtCLEdBQUcsaUJBQWlCLENBQUM7QUFFcEQsd0VBQXdFO0FBQ3hFLE1BQU0sQ0FBQyxNQU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ZvdW5kIGl0LiAqL1xuZXhwb3J0IGludGVyZmFjZSBQaXBlbGluZUNoZWNrRmluZGluZyB7XG4gIHN0YWdlOiBQaXBlbGluZUNoZWNrU3RhZ2U7XG4gIG1lc3NhZ2U6IHN0cmluZztcbiAgZGV0YWlscz86IFJlY29yZDxzdHJpbmcsIHVua25vd24+O1xufVxuIl19
|
|
@@ -87,6 +87,96 @@ export declare function parsePipelinePrefixes(raw: unknown): string[];
|
|
|
87
87
|
export declare function pipelineNameMatchesPrefixes(pipelineName: string, prefixes: readonly string[]): boolean;
|
|
88
88
|
/** An AWS region name (`us-east-1`, `us-gov-west-1`). */
|
|
89
89
|
export declare const AWS_REGION_PATTERN: RegExp;
|
|
90
|
+
/**
|
|
91
|
+
* A runner's label: ONE rule for `setup-runner --label`, the register / rename
|
|
92
|
+
* API and the dashboard's rename. 1-32 lowercase letters, digits or '-',
|
|
93
|
+
* starting with a letter or digit — what the CLI can type back to find the
|
|
94
|
+
* runner (its by-label lookup), so a rename can never strand a runner from it.
|
|
95
|
+
* Unique per org among non-revoked runners (409 RUNNER_LABEL_TAKEN; a partial
|
|
96
|
+
* unique index in the database).
|
|
97
|
+
*/
|
|
98
|
+
export declare const RUNNER_LABEL_PATTERN: RegExp;
|
|
99
|
+
/** {@link RUNNER_LABEL_PATTERN}'s length limit. */
|
|
100
|
+
export declare const RUNNER_LABEL_MAX_LENGTH = 32;
|
|
101
|
+
/** What a label breaking {@link RUNNER_LABEL_PATTERN} is told (after `label "<value>" `). */
|
|
102
|
+
export declare const RUNNER_LABEL_MESSAGE = "must be 1-32 lowercase letters, digits or '-' (starting with a letter or digit)";
|
|
103
|
+
/** Why `label` is not a valid runner label (`label "<label>" must be …`), or null when it is. */
|
|
104
|
+
export declare function runnerLabelError(label: string): string | null;
|
|
105
|
+
/** Every runner stack's name starts with this (setup-runner lists the account's stacks by it). */
|
|
106
|
+
export declare const RUNNER_STACK_PREFIX = "pipeline-builder-runner-";
|
|
107
|
+
/**
|
|
108
|
+
* CloudFormation stack name for a runner: `pipeline-builder-runner-<runnerId>`.
|
|
109
|
+
* Named by the runner id, not its label, so two organizations' runners in one
|
|
110
|
+
* AWS account never collide.
|
|
111
|
+
*/
|
|
112
|
+
export declare function runnerStackName(runnerId: string): string;
|
|
113
|
+
/**
|
|
114
|
+
* The region a runner's stack lives in, read from its endpoint (a Lambda
|
|
115
|
+
* Function URL `https://<id>.lambda-url.<region>.on.aws/` or an API Gateway
|
|
116
|
+
* stage `https://<id>.execute-api.<region>.amazonaws.com/…`). Null for any
|
|
117
|
+
* other URL (and for none).
|
|
118
|
+
*/
|
|
119
|
+
export declare function runnerStackRegion(endpointUrl: string | null | undefined): string | null;
|
|
120
|
+
/** The secret (in the stack region) holding an org's registry pull credential, as `infra store-token --scope registry:push` names it. */
|
|
121
|
+
export declare function registryPullSecretName(orgId: string): string;
|
|
122
|
+
/** The command that stores an org's registry pull credential in a region (what `setup-runner --enable-deploy` checks first). */
|
|
123
|
+
export declare function registryPullCredentialCommand(region: string): string;
|
|
124
|
+
/**
|
|
125
|
+
* The oldest CDK bootstrap a deploy through a runner works with: version 21
|
|
126
|
+
* gave the deploy role the CLI permissions (DescribeStackEvents, DeleteStack,
|
|
127
|
+
* GetTemplate) the job's stack-state check, its cleanup of a failed first
|
|
128
|
+
* deploy and an undeploy use through that role.
|
|
129
|
+
*/
|
|
130
|
+
export declare const MIN_CDK_BOOTSTRAP_VERSION = 21;
|
|
131
|
+
/** The command an operator runs to bootstrap a region for deploys (the CLI's own). */
|
|
132
|
+
export declare function cdkBootstrapCommand(region: string, qualifier?: string): string;
|
|
133
|
+
/**
|
|
134
|
+
* How to turn deploys on for one of the caller's own runners without the CLI
|
|
135
|
+
* (`enableDeploy` on a runner without `deploy:1`): the CloudFormation console
|
|
136
|
+
* page that updates its stack, the parameters it sets, and what
|
|
137
|
+
* `setup-runner --enable-deploy` would check first — the registry pull
|
|
138
|
+
* credential in the stack region and a current CDK bootstrap in every region
|
|
139
|
+
* the runner deploys to. Null for another org's runner (its owner's admins
|
|
140
|
+
* update it) and when the stack's region can't be told.
|
|
141
|
+
*/
|
|
142
|
+
export interface EnableDeployLinkDto {
|
|
143
|
+
consoleUrl: string;
|
|
144
|
+
stackName: string;
|
|
145
|
+
region: string;
|
|
146
|
+
parameters: Record<string, string>;
|
|
147
|
+
/** The Secrets Manager secret the deploy build pulls with (in {@link region}). */
|
|
148
|
+
registrySecretName: string;
|
|
149
|
+
/** Each needs a CDK bootstrap of {@link MIN_CDK_BOOTSTRAP_VERSION}+. */
|
|
150
|
+
bootstrapRegions: string[];
|
|
151
|
+
}
|
|
152
|
+
/** The registry pull host (`host` or `host:port`) for a platform base URL, as setup-runner derives it; null for no / a malformed URL. */
|
|
153
|
+
export declare function registryPullHostOf(platformBaseUrl: string | null | undefined): string | null;
|
|
154
|
+
/** {@link EnableDeployLinkDto} for a runner, or null when its stack's region can't be told (or there is no platform URL). */
|
|
155
|
+
export declare function enableDeployLink(a: {
|
|
156
|
+
runnerId: string;
|
|
157
|
+
orgId: string;
|
|
158
|
+
functionUrl: string | null;
|
|
159
|
+
regions: readonly string[];
|
|
160
|
+
platformBaseUrl: string | null | undefined;
|
|
161
|
+
}): EnableDeployLinkDto | null;
|
|
162
|
+
/** The stack parameters `setup-runner --enable-deploy` sets to turn deploys on (the rest keep their defaults). */
|
|
163
|
+
export declare function enableDeployStackParameters(a: {
|
|
164
|
+
orgId: string;
|
|
165
|
+
registryPullHost: string;
|
|
166
|
+
}): Record<string, string>;
|
|
167
|
+
/**
|
|
168
|
+
* The CloudFormation console's Update stack page for a runner's stack, with
|
|
169
|
+
* {@link enableDeployStackParameters} as `param_<Key>` values (the console
|
|
170
|
+
* prefills them; the page states them too, for a console that does not).
|
|
171
|
+
* The platform holds no AWS access: the operator applies the update in their
|
|
172
|
+
* own account, and the runner reports `deploy:1` on its next pong.
|
|
173
|
+
*/
|
|
174
|
+
export declare function enableDeployConsoleUrl(a: {
|
|
175
|
+
runnerId: string;
|
|
176
|
+
region: string;
|
|
177
|
+
orgId: string;
|
|
178
|
+
registryPullHost: string;
|
|
179
|
+
}): string;
|
|
90
180
|
/**
|
|
91
181
|
* The details of a `pong` (beside `outcome`), as a runner sends them — raw:
|
|
92
182
|
* parse `capabilities` / `pipelinePrefixes` with {@link parseRunnerCapabilities}
|
|
@@ -159,6 +249,12 @@ export declare const RUNNER_ERRORS: {
|
|
|
159
249
|
readonly retryable: false;
|
|
160
250
|
readonly category: 'platform';
|
|
161
251
|
};
|
|
252
|
+
/** Another non-revoked runner of the org already has this label (labels are how the CLI finds a runner). */
|
|
253
|
+
readonly RUNNER_LABEL_TAKEN: {
|
|
254
|
+
readonly httpStatus: 409;
|
|
255
|
+
readonly retryable: false;
|
|
256
|
+
readonly category: 'platform';
|
|
257
|
+
};
|
|
162
258
|
readonly RUN_REQUEST_RATE_LIMITED: {
|
|
163
259
|
readonly httpStatus: 429;
|
|
164
260
|
readonly retryable: false;
|
|
@@ -437,10 +533,14 @@ export declare function runnerErrorStatus(code: RunnerApiErrorCode | RunnerReply
|
|
|
437
533
|
*/
|
|
438
534
|
export declare const RUNNER_DELIVERY_FAILURE_CLASSES: readonly ['dns_nxdomain', 'aws_403_url_gone', 'conn_refused', 'timeout', 'http_5xx', 'http_429'];
|
|
439
535
|
export type RunnerDeliveryFailureClass = (typeof RUNNER_DELIVERY_FAILURE_CLASSES)[number];
|
|
536
|
+
/** The execution states a Stop ends in (normalized: lower-case, no separators). */
|
|
537
|
+
export declare const STOPPED_EXECUTION_STATUSES: readonly ['stopped', 'canceled', 'cancelled'];
|
|
440
538
|
/** Execution states nothing further happens after (normalized: lower-case, no separators). */
|
|
441
|
-
export declare const TERMINAL_EXECUTION_STATUSES: readonly [
|
|
539
|
+
export declare const TERMINAL_EXECUTION_STATUSES: readonly ["succeeded", "failed", "stopped", "canceled", "cancelled", "superseded"];
|
|
442
540
|
/** Whether a started run's `executionStatus` is final (case/dash-insensitive). */
|
|
443
541
|
export declare function isTerminalExecutionStatus(s: string | null | undefined): boolean;
|
|
542
|
+
/** Whether a started run's `executionStatus` is one a Stop ends in (case/dash-insensitive). */
|
|
543
|
+
export declare function isStoppedExecutionStatus(s: string | null | undefined): boolean;
|
|
444
544
|
/** JWS header `typ`. */
|
|
445
545
|
export declare const RUN_REQUEST_TYP = "pb-run+jwt";
|
|
446
546
|
/** JWS header `alg`. */
|
|
@@ -685,7 +785,11 @@ export interface RunnerDeployErrorMeta {
|
|
|
685
785
|
readonly class: DeployFailureClass;
|
|
686
786
|
/** Sending the same pipeline again (Retry / Change runner) can succeed without editing the pipeline. */
|
|
687
787
|
readonly retryable: boolean;
|
|
788
|
+
/** The failure's headline, one sentence — the dashboard's bold line and the deploy notification's subject. */
|
|
789
|
+
readonly title: string;
|
|
688
790
|
}
|
|
791
|
+
/** A short name per failure class (the dashboard's fallback headline, a notification without a code's own title). */
|
|
792
|
+
export declare const DEPLOY_FAILURE_CLASS_LABELS: Readonly<Record<DeployFailureClass, string>>;
|
|
689
793
|
/**
|
|
690
794
|
* Every deploy RESULT code: the job's (its result post and exported
|
|
691
795
|
* PB_DEPLOY_RESULT) and the platform's own (grant refusals, deadline, cancel).
|
|
@@ -697,71 +801,85 @@ export declare const RUNNER_DEPLOY_ERRORS: {
|
|
|
697
801
|
readonly DEPLOY_GRANT_REJECTED: {
|
|
698
802
|
readonly class: 'platform';
|
|
699
803
|
readonly retryable: false;
|
|
804
|
+
readonly title: 'The deploy job\'s one-time credential was refused.';
|
|
700
805
|
};
|
|
701
806
|
/** The grant expired before the job exchanged it ({@link DEPLOY_GRANT_TTL_MS}): the build queued too long. */
|
|
702
807
|
readonly DEPLOY_GRANT_EXPIRED: {
|
|
703
808
|
readonly class: 'platform';
|
|
704
809
|
readonly retryable: true;
|
|
810
|
+
readonly title: 'The deploy job started too late to use its credential.';
|
|
705
811
|
};
|
|
706
812
|
/** The job could not read the pipeline through its session. */
|
|
707
813
|
readonly PIPELINE_FETCH_FAILED: {
|
|
708
814
|
readonly class: 'platform';
|
|
709
815
|
readonly retryable: true;
|
|
816
|
+
readonly title: 'The deploy job could not read this pipeline from the platform.';
|
|
710
817
|
};
|
|
711
818
|
/** A plugin of the pipeline did not resolve (lookup through the session). */
|
|
712
819
|
readonly PLUGIN_RESOLUTION_FAILED: {
|
|
713
820
|
readonly class: 'definition';
|
|
714
821
|
readonly retryable: false;
|
|
822
|
+
readonly title: 'A plugin this pipeline uses could not be resolved.';
|
|
715
823
|
};
|
|
716
824
|
/** The synthesized pipeline / stack names or region are not the ones the request named. */
|
|
717
825
|
readonly DEPLOY_TARGET_MISMATCH: {
|
|
718
826
|
readonly class: 'definition';
|
|
719
827
|
readonly retryable: false;
|
|
828
|
+
readonly title: 'The synthesized pipeline is not the one this deploy named.';
|
|
720
829
|
};
|
|
721
830
|
/** A stack of that name exists and is not this pipeline's (tagged for another pipeline, or untagged). */
|
|
722
831
|
readonly STACK_OWNED_BY_OTHER_PIPELINE: {
|
|
723
832
|
readonly class: 'definition';
|
|
724
833
|
readonly retryable: false;
|
|
834
|
+
readonly title: 'A stack with this pipeline\'s name already belongs to something else.';
|
|
725
835
|
};
|
|
726
836
|
/** The target region has no CDK bootstrap (`pipeline-manager bootstrap --region <r>`). */
|
|
727
837
|
readonly CDK_NOT_BOOTSTRAPPED: {
|
|
728
838
|
readonly class: 'account_setup';
|
|
729
839
|
readonly retryable: true;
|
|
840
|
+
readonly title: 'The target region has no CDK bootstrap.';
|
|
730
841
|
};
|
|
731
842
|
/** The region's CDK bootstrap is older than the toolchain needs. */
|
|
732
843
|
readonly CDK_BOOTSTRAP_OUTDATED: {
|
|
733
844
|
readonly class: 'account_setup';
|
|
734
845
|
readonly retryable: true;
|
|
846
|
+
readonly title: 'The target region\'s CDK bootstrap is too old for this pipeline.';
|
|
735
847
|
};
|
|
736
848
|
/** Secrets the pipeline needs are not in the account's Secrets Manager. */
|
|
737
849
|
readonly ACCOUNT_SECRETS_MISSING: {
|
|
738
850
|
readonly class: 'account_setup';
|
|
739
851
|
readonly retryable: true;
|
|
852
|
+
readonly title: 'Secrets this pipeline needs are not in the runner\'s AWS account.';
|
|
740
853
|
};
|
|
741
854
|
/** A bootstrap role refused an AWS call (or the permissions boundary did). */
|
|
742
855
|
readonly DEPLOY_PERMISSION_DENIED: {
|
|
743
856
|
readonly class: 'aws_permission';
|
|
744
857
|
readonly retryable: true;
|
|
858
|
+
readonly title: 'AWS refused an action the deploy needed.';
|
|
745
859
|
};
|
|
746
860
|
/** `cdk deploy` failed in CloudFormation. */
|
|
747
861
|
readonly CFN_DEPLOY_FAILED: {
|
|
748
862
|
readonly class: 'cloudformation';
|
|
749
863
|
readonly retryable: true;
|
|
864
|
+
readonly title: 'CloudFormation could not deploy the pipeline\'s stack.';
|
|
750
865
|
};
|
|
751
866
|
/** Deleting this pipeline's stack (cleaning a failed first deploy, or an undeploy) did not reach DELETE_COMPLETE. */
|
|
752
867
|
readonly STACK_DELETE_FAILED: {
|
|
753
868
|
readonly class: 'cloudformation';
|
|
754
869
|
readonly retryable: true;
|
|
870
|
+
readonly title: 'This pipeline\'s old stack could not be deleted.';
|
|
755
871
|
};
|
|
756
872
|
/** CodeBuild could not pull the cdk-synth image (registry credential or host). */
|
|
757
873
|
readonly DEPLOY_IMAGE_PULL_FAILED: {
|
|
758
874
|
readonly class: 'image';
|
|
759
875
|
readonly retryable: true;
|
|
876
|
+
readonly title: 'The runner\'s deploy project could not pull the deploy image.';
|
|
760
877
|
};
|
|
761
878
|
/** The image's deploy-job protocol is not the claim's ({@link DEPLOY_JOB_PROTOCOL_VERSION}). */
|
|
762
879
|
readonly DEPLOY_JOB_PROTOCOL_MISMATCH: {
|
|
763
880
|
readonly class: 'image';
|
|
764
881
|
readonly retryable: false;
|
|
882
|
+
readonly title: 'The deploy image speaks a different deploy protocol than the platform.';
|
|
765
883
|
};
|
|
766
884
|
/**
|
|
767
885
|
* The synthesized stack has Docker image assets: the deploy build is never
|
|
@@ -771,21 +889,25 @@ export declare const RUNNER_DEPLOY_ERRORS: {
|
|
|
771
889
|
readonly DEPLOY_NEEDS_PRIVILEGED: {
|
|
772
890
|
readonly class: 'image';
|
|
773
891
|
readonly retryable: false;
|
|
892
|
+
readonly title: 'This pipeline\'s stack carries a Docker image asset, which a runner cannot deploy.';
|
|
774
893
|
};
|
|
775
894
|
/** Past RUNNER_DEPLOY_DEADLINE_MINUTES, or CodeBuild's own timeout. */
|
|
776
895
|
readonly DEPLOY_TIMED_OUT: {
|
|
777
896
|
readonly class: 'timeout';
|
|
778
897
|
readonly retryable: true;
|
|
898
|
+
readonly title: 'The deploy did not finish in time.';
|
|
779
899
|
};
|
|
780
900
|
/** A person cancelled it. */
|
|
781
901
|
readonly DEPLOY_CANCELLED: {
|
|
782
902
|
readonly class: 'cancelled';
|
|
783
903
|
readonly retryable: true;
|
|
904
|
+
readonly title: 'The deploy was cancelled.';
|
|
784
905
|
};
|
|
785
906
|
/** Anything else inside the job. */
|
|
786
907
|
readonly DEPLOY_JOB_ERROR: {
|
|
787
908
|
readonly class: 'unknown';
|
|
788
909
|
readonly retryable: true;
|
|
910
|
+
readonly title: 'The deploy job failed.';
|
|
789
911
|
};
|
|
790
912
|
};
|
|
791
913
|
export type RunnerDeployErrorCode = keyof typeof RUNNER_DEPLOY_ERRORS;
|
|
@@ -812,6 +934,14 @@ export declare function deployFailureOf(code: string | null | undefined): {
|
|
|
812
934
|
failureClass: DeployFailureClass;
|
|
813
935
|
retryable: boolean;
|
|
814
936
|
} | null;
|
|
937
|
+
/** The title of a deploy that was never delivered (RUN_REQUEST_EXPIRED). */
|
|
938
|
+
export declare const DEPLOY_EXPIRED_TITLE = "The deploy was not delivered to the pipeline runner within 10 minutes, so it expired.";
|
|
939
|
+
/**
|
|
940
|
+
* A failed deploy's one-line headline: the deploy result code's own title; an
|
|
941
|
+
* expiry's; else the failure class's label; else a plain "failed". The
|
|
942
|
+
* dashboard refines runner catalog codes with the runner banner's copy.
|
|
943
|
+
*/
|
|
944
|
+
export declare function deployFailureTitle(code: string | null | undefined, failureClass: DeployFailureClass | null | undefined): string;
|
|
815
945
|
/** Why a grant exchange was refused (`details.reason` of 401 DEPLOY_GRANT_INVALID; the rejections metric's `reason` label). */
|
|
816
946
|
export declare const DEPLOY_GRANT_REJECTION_REASONS: readonly ['reused', 'expired', 'unknown', 'wrong_state'];
|
|
817
947
|
export type DeployGrantRejectionReason = (typeof DEPLOY_GRANT_REJECTION_REASONS)[number];
|
|
@@ -1069,6 +1199,8 @@ export interface PipelineRunnerDto {
|
|
|
1069
1199
|
shareDeploysWithTeams: boolean;
|
|
1070
1200
|
/** The pipeline-name prefixes its stack allows (`*` = all), as its last pong reported them. */
|
|
1071
1201
|
pipelinePrefixes: string[];
|
|
1202
|
+
/** For the owning org's admins, on an active runner without `deploy:1`: turn deploys on in the AWS console. */
|
|
1203
|
+
enableDeploy: EnableDeployLinkDto | null;
|
|
1072
1204
|
}
|
|
1073
1205
|
/** A parent org's runner shared with this team (signed with the parent's effective key). */
|
|
1074
1206
|
export interface InheritedPipelineRunnerDto extends PipelineRunnerDto {
|
|
@@ -1183,6 +1315,39 @@ export interface RunnerPublicJwk {
|
|
|
1183
1315
|
export interface RunnerJwksDto {
|
|
1184
1316
|
keys: RunnerPublicJwk[];
|
|
1185
1317
|
}
|
|
1318
|
+
/** One runner on `GET /pipelines/:pipelineId/register-runners`. Never an account id or a URL. */
|
|
1319
|
+
export interface RegisterRunnerDto {
|
|
1320
|
+
id: string;
|
|
1321
|
+
label: string;
|
|
1322
|
+
/** The caller's org owns it (false for an ancestor's shared runner). */
|
|
1323
|
+
isOwn: boolean;
|
|
1324
|
+
/** Set for every runner that is not the caller's own. */
|
|
1325
|
+
ownerOrgName: string | null;
|
|
1326
|
+
/** Its allowed regions (the dialog fills the Region field from a single one). */
|
|
1327
|
+
regions: string[];
|
|
1328
|
+
/** `unreachable`: a link probe through it fails until it answers again. */
|
|
1329
|
+
health: RunnerHealth;
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* `GET /pipelines/:pipelineId/register-runners` (`pipelines:read`) — what the
|
|
1333
|
+
* Register deployment dialog needs: every runner the org can register the
|
|
1334
|
+
* pipeline with (deploys enabled or not — registering only links), and the
|
|
1335
|
+
* pipeline's registration state.
|
|
1336
|
+
*/
|
|
1337
|
+
export interface RegisterRunnersDto {
|
|
1338
|
+
pipelineId: string;
|
|
1339
|
+
/** False when deliveries are paused or runner secrets are not set up: no runner can link it. */
|
|
1340
|
+
available: boolean;
|
|
1341
|
+
unavailableReason: RunnersUnavailableReason | null;
|
|
1342
|
+
/** Empty when not `available`. */
|
|
1343
|
+
runners: RegisterRunnerDto[];
|
|
1344
|
+
/** It has a registry row now. */
|
|
1345
|
+
registered: boolean;
|
|
1346
|
+
/** Any pipeline event was ever ingested for it — false and not registered: never deployed. */
|
|
1347
|
+
hasEvents: boolean;
|
|
1348
|
+
/** The runner it is linked to now — only while the link status is `linked` (null otherwise). */
|
|
1349
|
+
linkedRunnerId: string | null;
|
|
1350
|
+
}
|
|
1186
1351
|
/** One eligible runner on `GET /pipelines/:pipelineId/deploy-targets`. Never an account id or a URL. */
|
|
1187
1352
|
export interface DeployTargetRunnerDto {
|
|
1188
1353
|
id: string;
|
|
@@ -1196,23 +1361,43 @@ export interface DeployTargetRunnerDto {
|
|
|
1196
1361
|
deployable: boolean;
|
|
1197
1362
|
/** Null when deployable. */
|
|
1198
1363
|
reason: DeployTargetReason | null;
|
|
1364
|
+
/** The caller's own runner with deploys off (`deploy_not_enabled`): turn them on in the AWS console. */
|
|
1365
|
+
enableDeploy: EnableDeployLinkDto | null;
|
|
1199
1366
|
}
|
|
1200
|
-
/**
|
|
1201
|
-
export interface
|
|
1202
|
-
pipelineId: string;
|
|
1367
|
+
/** What both deploy-target listings answer: the eligible runners for a pipeline name. */
|
|
1368
|
+
export interface DeployTargetsBaseDto {
|
|
1203
1369
|
available: boolean;
|
|
1204
1370
|
unavailableReason: RunnersUnavailableReason | null;
|
|
1205
|
-
/** The pipeline already has a registry row (no deploy through a runner). */
|
|
1206
|
-
alreadyDeployed: boolean;
|
|
1207
|
-
/** The pipeline's active deploy, if any (resume it instead of starting one). */
|
|
1208
|
-
activeRequestId: string | null;
|
|
1209
1371
|
/** Every eligible runner, deployable or not. */
|
|
1210
1372
|
runners: DeployTargetRunnerDto[];
|
|
1211
1373
|
/** The runner used when the body names none: set when exactly one is deployable. */
|
|
1212
1374
|
autoRunnerId: string | null;
|
|
1375
|
+
/**
|
|
1376
|
+
* The runner the CALLER last deployed through (their most recent deploy
|
|
1377
|
+
* request in this org), while it is deployable here: the default of a
|
|
1378
|
+
* several-runner choice. Null otherwise.
|
|
1379
|
+
*/
|
|
1380
|
+
lastUsedRunnerId: string | null;
|
|
1213
1381
|
/** {@link DEPLOY_SETUP_COMMAND}, for the "no deployable runner" copy. */
|
|
1214
1382
|
setupCommand: string;
|
|
1215
1383
|
}
|
|
1384
|
+
/** `GET /pipelines/:pipelineId/deploy-targets`. */
|
|
1385
|
+
export interface DeployTargetsDto extends DeployTargetsBaseDto {
|
|
1386
|
+
pipelineId: string;
|
|
1387
|
+
/** The pipeline already has a registry row (no deploy through a runner). */
|
|
1388
|
+
alreadyDeployed: boolean;
|
|
1389
|
+
/** The pipeline's active deploy, if any (resume it instead of starting one). */
|
|
1390
|
+
activeRequestId: string | null;
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* `GET /pipelines/deploy-targets?project=…[&pipelineName=…]`: the targets of a
|
|
1394
|
+
* pipeline NOT CREATED YET (the create form's "Deploy with"), for the
|
|
1395
|
+
* CodePipeline name it will get under the caller's organization identity.
|
|
1396
|
+
*/
|
|
1397
|
+
export interface NewPipelineDeployTargetsDto extends DeployTargetsBaseDto {
|
|
1398
|
+
/** The CodePipeline name the runners' prefix allowlists were checked against. */
|
|
1399
|
+
pipelineName: string;
|
|
1400
|
+
}
|
|
1216
1401
|
/** `POST /pipelines/:pipelineId/deploys` body. */
|
|
1217
1402
|
export interface DeployStartBody {
|
|
1218
1403
|
runnerId?: string;
|