@ship.zone/ci-spec 2.0.0 → 2.1.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/changelog.md +18 -0
- package/conformance/compile-cases.json +2 -2
- package/conformance/runner-job-cases.json +703 -0
- package/conformance/runner-job-cases.schema.json +134 -0
- package/conformance/runner-jobs/incoherent/artifact-maximum-above-limit.json +91 -0
- package/conformance/runner-jobs/incoherent/build-secret-unknown-target.json +104 -0
- package/conformance/runner-jobs/incoherent/cache-count-above-limit.json +91 -0
- package/conformance/runner-jobs/incoherent/environment-above-limit.json +206 -0
- package/conformance/runner-jobs/incoherent/plan-digest-mismatch.json +70 -0
- package/conformance/runner-jobs/incoherent/precedence-limit-before-digest.json +70 -0
- package/conformance/runner-jobs/incoherent/reserved-prefix-environment.json +71 -0
- package/conformance/runner-jobs/incoherent/reserved-prefix-secret-target.json +72 -0
- package/conformance/runner-jobs/incoherent/reserved-variable-missing.json +69 -0
- package/conformance/runner-jobs/incoherent/reserved-variable-not-canonical.json +70 -0
- package/conformance/runner-jobs/incoherent/secret-target-environment-duplicate.json +72 -0
- package/conformance/runner-jobs/incoherent/secret-target-without-build-secret.json +101 -0
- package/conformance/runner-jobs/incoherent/secret-value-too-short.json +72 -0
- package/conformance/runner-jobs/incoherent/shared-memory-above-memory.json +71 -0
- package/conformance/runner-jobs/incoherent/source-above-limit.json +70 -0
- package/conformance/runner-jobs/invalid/artifacts-feature-missing.json +91 -0
- package/conformance/runner-jobs/invalid/artifacts-none-permission.json +91 -0
- package/conformance/runner-jobs/invalid/build-without-push-permission.json +100 -0
- package/conformance/runner-jobs/invalid/read-write-cache-read-permission.json +91 -0
- package/conformance/runner-jobs/invalid/source-feature-missing.json +70 -0
- package/conformance/runner-jobs/invalid/vm-without-platform.json +81 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/constants.d.ts +42 -0
- package/dist_ts/constants.js +57 -1
- package/package.json +4 -2
- package/readme.md +13 -4
- package/spec/runner-protocol.md +31 -1
- package/spec/runner.openapi.json +1 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/constants.ts +65 -0
package/dist_ts/constants.d.ts
CHANGED
|
@@ -181,6 +181,46 @@ export declare const compilationFailureCodes: readonly [{
|
|
|
181
181
|
readonly code: "secret_too_short";
|
|
182
182
|
readonly layer: "run";
|
|
183
183
|
}];
|
|
184
|
+
/**
|
|
185
|
+
* The prefix of every environment name the specification reserves (spec/ci-actions.md, Jobs and
|
|
186
|
+
* Steps; spec/runner-protocol.md, OCI Container Profile): workflow authors cannot define a name
|
|
187
|
+
* with it, and a compiled job carries only the reserved step variables with it.
|
|
188
|
+
*/
|
|
189
|
+
export declare const reservedEnvironmentPrefix: "SHIPZONE_CI_";
|
|
190
|
+
/** The matrix values of a compiled step, as RFC 8785 JSON object text (spec/ci-actions.md, Matrix). */
|
|
191
|
+
export declare const matrixEnvironmentName: "SHIPZONE_CI_MATRIX_JSON";
|
|
192
|
+
/** The manual inputs of a run, as RFC 8785 JSON object text (spec/ci-actions.md, Matrix). */
|
|
193
|
+
export declare const inputsEnvironmentName: "SHIPZONE_CI_INPUTS_JSON";
|
|
194
|
+
/**
|
|
195
|
+
* The reserved variables every compiled `oci` and `vm` step carries (spec/runner-protocol.md, OCI
|
|
196
|
+
* Container Profile).
|
|
197
|
+
*/
|
|
198
|
+
export declare const reservedStepEnvironmentNames: readonly ["SHIPZONE_CI_MATRIX_JSON", "SHIPZONE_CI_INPUTS_JSON"];
|
|
199
|
+
/**
|
|
200
|
+
* The environment name through which a runner delivers npm read grants to `oci` and `vm` steps,
|
|
201
|
+
* reserved in a job with `npmRead` (spec/runner-protocol.md, npm Read Grants).
|
|
202
|
+
*/
|
|
203
|
+
export declare const npmUserConfigEnvironmentName: "NPM_CONFIG_USERCONFIG";
|
|
204
|
+
/**
|
|
205
|
+
* The BuildKit secret id through which a runner delivers npm read grants to an `oci-image` build,
|
|
206
|
+
* reserved in a job with `npmRead` (spec/runner-protocol.md, npm Read Grants).
|
|
207
|
+
*/
|
|
208
|
+
export declare const npmBuildSecretId: "npmrc";
|
|
209
|
+
/** The prefix of the image label keys reserved for the coordinator (spec/ci-actions.md, Image Builds). */
|
|
210
|
+
export declare const reservedImageLabelPrefix: "zone.ship.ci.";
|
|
211
|
+
/**
|
|
212
|
+
* The image label keys reserved for the coordinator besides the reserved prefix (spec/ci-actions.md,
|
|
213
|
+
* Image Builds). The coordinator compiles `revision` and `source` into every build job and `version`
|
|
214
|
+
* on a run with a tag version (spec/ci-actions.md, Compiled Jobs).
|
|
215
|
+
*/
|
|
216
|
+
export declare const reservedImageLabelKeys: readonly ["org.opencontainers.image.revision", "org.opencontainers.image.source", "org.opencontainers.image.version"];
|
|
217
|
+
/**
|
|
218
|
+
* Every runner job failure code in precedence order, mirrored from
|
|
219
|
+
* `conformance/runner-job-cases.json` `failureCodes`: the code a coordinator or runner reports for a
|
|
220
|
+
* compiled job that is not coherent (spec/runner-protocol.md, Job Coherence). The conformance tests
|
|
221
|
+
* assert both sources and the prose table agree.
|
|
222
|
+
*/
|
|
223
|
+
export declare const runnerJobFailureCodes: readonly ["spec_incompatible", "job_schema_invalid", "job_secret_incoherent", "job_limit_incoherent", "job_resources_incoherent", "job_environment_incoherent", "job_command_limit_exceeded", "job_secret_inadmissible", "job_digest_mismatch"];
|
|
184
224
|
export declare const ciSpecAssetPaths: {
|
|
185
225
|
readonly runnerOpenApi: "spec/runner.openapi.json";
|
|
186
226
|
readonly runnerProtocol: "spec/runner-protocol.md";
|
|
@@ -194,6 +234,8 @@ export declare const ciSpecAssetPaths: {
|
|
|
194
234
|
readonly versionCases: "conformance/version-cases.json";
|
|
195
235
|
readonly compileCases: "conformance/compile-cases.json";
|
|
196
236
|
readonly compileCasesSchema: "conformance/compile-cases.schema.json";
|
|
237
|
+
readonly runnerJobCases: "conformance/runner-job-cases.json";
|
|
238
|
+
readonly runnerJobCasesSchema: "conformance/runner-job-cases.schema.json";
|
|
197
239
|
readonly ciActionsConformanceDirectory: "conformance/ci-actions";
|
|
198
240
|
readonly runnerJobConformanceDirectory: "conformance/runner-jobs";
|
|
199
241
|
};
|
package/dist_ts/constants.js
CHANGED
|
@@ -87,6 +87,60 @@ export const compilationFailureCodes = [
|
|
|
87
87
|
{ code: 'protected_secret_denied', layer: 'run' },
|
|
88
88
|
{ code: 'secret_too_short', layer: 'run' },
|
|
89
89
|
];
|
|
90
|
+
/**
|
|
91
|
+
* The prefix of every environment name the specification reserves (spec/ci-actions.md, Jobs and
|
|
92
|
+
* Steps; spec/runner-protocol.md, OCI Container Profile): workflow authors cannot define a name
|
|
93
|
+
* with it, and a compiled job carries only the reserved step variables with it.
|
|
94
|
+
*/
|
|
95
|
+
export const reservedEnvironmentPrefix = 'SHIPZONE_CI_';
|
|
96
|
+
/** The matrix values of a compiled step, as RFC 8785 JSON object text (spec/ci-actions.md, Matrix). */
|
|
97
|
+
export const matrixEnvironmentName = 'SHIPZONE_CI_MATRIX_JSON';
|
|
98
|
+
/** The manual inputs of a run, as RFC 8785 JSON object text (spec/ci-actions.md, Matrix). */
|
|
99
|
+
export const inputsEnvironmentName = 'SHIPZONE_CI_INPUTS_JSON';
|
|
100
|
+
/**
|
|
101
|
+
* The reserved variables every compiled `oci` and `vm` step carries (spec/runner-protocol.md, OCI
|
|
102
|
+
* Container Profile).
|
|
103
|
+
*/
|
|
104
|
+
export const reservedStepEnvironmentNames = [matrixEnvironmentName, inputsEnvironmentName];
|
|
105
|
+
/**
|
|
106
|
+
* The environment name through which a runner delivers npm read grants to `oci` and `vm` steps,
|
|
107
|
+
* reserved in a job with `npmRead` (spec/runner-protocol.md, npm Read Grants).
|
|
108
|
+
*/
|
|
109
|
+
export const npmUserConfigEnvironmentName = 'NPM_CONFIG_USERCONFIG';
|
|
110
|
+
/**
|
|
111
|
+
* The BuildKit secret id through which a runner delivers npm read grants to an `oci-image` build,
|
|
112
|
+
* reserved in a job with `npmRead` (spec/runner-protocol.md, npm Read Grants).
|
|
113
|
+
*/
|
|
114
|
+
export const npmBuildSecretId = 'npmrc';
|
|
115
|
+
/** The prefix of the image label keys reserved for the coordinator (spec/ci-actions.md, Image Builds). */
|
|
116
|
+
export const reservedImageLabelPrefix = 'zone.ship.ci.';
|
|
117
|
+
/**
|
|
118
|
+
* The image label keys reserved for the coordinator besides the reserved prefix (spec/ci-actions.md,
|
|
119
|
+
* Image Builds). The coordinator compiles `revision` and `source` into every build job and `version`
|
|
120
|
+
* on a run with a tag version (spec/ci-actions.md, Compiled Jobs).
|
|
121
|
+
*/
|
|
122
|
+
export const reservedImageLabelKeys = [
|
|
123
|
+
'org.opencontainers.image.revision',
|
|
124
|
+
'org.opencontainers.image.source',
|
|
125
|
+
'org.opencontainers.image.version',
|
|
126
|
+
];
|
|
127
|
+
/**
|
|
128
|
+
* Every runner job failure code in precedence order, mirrored from
|
|
129
|
+
* `conformance/runner-job-cases.json` `failureCodes`: the code a coordinator or runner reports for a
|
|
130
|
+
* compiled job that is not coherent (spec/runner-protocol.md, Job Coherence). The conformance tests
|
|
131
|
+
* assert both sources and the prose table agree.
|
|
132
|
+
*/
|
|
133
|
+
export const runnerJobFailureCodes = [
|
|
134
|
+
'spec_incompatible',
|
|
135
|
+
'job_schema_invalid',
|
|
136
|
+
'job_secret_incoherent',
|
|
137
|
+
'job_limit_incoherent',
|
|
138
|
+
'job_resources_incoherent',
|
|
139
|
+
'job_environment_incoherent',
|
|
140
|
+
'job_command_limit_exceeded',
|
|
141
|
+
'job_secret_inadmissible',
|
|
142
|
+
'job_digest_mismatch',
|
|
143
|
+
];
|
|
90
144
|
export const ciSpecAssetPaths = {
|
|
91
145
|
runnerOpenApi: 'spec/runner.openapi.json',
|
|
92
146
|
runnerProtocol: 'spec/runner-protocol.md',
|
|
@@ -100,7 +154,9 @@ export const ciSpecAssetPaths = {
|
|
|
100
154
|
versionCases: 'conformance/version-cases.json',
|
|
101
155
|
compileCases: 'conformance/compile-cases.json',
|
|
102
156
|
compileCasesSchema: 'conformance/compile-cases.schema.json',
|
|
157
|
+
runnerJobCases: 'conformance/runner-job-cases.json',
|
|
158
|
+
runnerJobCasesSchema: 'conformance/runner-job-cases.schema.json',
|
|
103
159
|
ciActionsConformanceDirectory: 'conformance/ci-actions',
|
|
104
160
|
runnerJobConformanceDirectory: 'conformance/runner-jobs',
|
|
105
161
|
};
|
|
106
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
162
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvY29uc3RhbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUVyRDs7OztHQUlHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFXLFVBQVUsQ0FBQyxPQUFPLENBQUM7QUFDeEQsTUFBTSxDQUFDLE1BQU0sWUFBWSxHQUFHLE9BQWdCLENBQUM7QUFDN0MsTUFBTSxDQUFDLE1BQU0sc0JBQXNCLEdBQUcsYUFBc0IsQ0FBQztBQUM3RCxNQUFNLENBQUMsTUFBTSwrQkFBK0IsR0FBRyxXQUFvQixDQUFDO0FBRXBFOzs7O0dBSUc7QUFDSCxNQUFNLENBQUMsTUFBTSwyQkFBMkIsR0FBRztJQUN6QyxTQUFTLEVBQUUsS0FBSztJQUNoQixVQUFVLEVBQUUsV0FBVztJQUN2QixjQUFjLEVBQUUsSUFBSTtDQUNaLENBQUM7QUFFWDs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLHdCQUF3QixHQUFHLENBQUMsZUFBZSxFQUFFLFdBQVcsRUFBRSxRQUFRLENBQVUsQ0FBQztBQUUxRjs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSx1QkFBdUIsR0FBRyxDQUFDLG1CQUFtQixFQUF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
"name": "@ship.zone/ci-spec",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The ship.zone CI standard: language-neutral CI workflow and runner protocol specifications.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
"./version-cases.json": "./conformance/version-cases.json",
|
|
23
23
|
"./compile-cases.json": "./conformance/compile-cases.json",
|
|
24
24
|
"./compile-cases.schema.json": "./conformance/compile-cases.schema.json",
|
|
25
|
+
"./runner-job-cases.json": "./conformance/runner-job-cases.json",
|
|
26
|
+
"./runner-job-cases.schema.json": "./conformance/runner-job-cases.schema.json",
|
|
25
27
|
"./conformance/ci-actions/*": "./conformance/ci-actions/*",
|
|
26
28
|
"./conformance/runner-jobs/*": "./conformance/runner-jobs/*"
|
|
27
29
|
},
|
|
@@ -65,7 +67,7 @@
|
|
|
65
67
|
],
|
|
66
68
|
"scripts": {
|
|
67
69
|
"test": "tstest test/ --verbose",
|
|
68
|
-
"test:types": "tsbuild check test/**/*",
|
|
70
|
+
"test:types": "tsbuild check 'test/**/*'",
|
|
69
71
|
"lint:openapi": "redocly lint spec/runner.openapi.json --extends=spec",
|
|
70
72
|
"build": "tsbuild tsfolders"
|
|
71
73
|
}
|
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @ship.zone/ci-spec
|
|
2
2
|
|
|
3
|
-
`@ship.zone/ci-spec` defines the ship.zone CI standard: the language-neutral workflow and runner contracts between a coordinator and its runners. The normative artifacts are OpenAPI, JSON Schema, protocol prose, and conformance cases. TypeScript exports provide only the specification version, draft metadata, identifier lists, and asset locations.
|
|
3
|
+
`@ship.zone/ci-spec` defines the ship.zone CI standard: the language-neutral workflow and runner contracts between a coordinator and its runners. The normative artifacts are OpenAPI, JSON Schema, protocol prose, and conformance cases. TypeScript exports provide only the specification version, draft metadata, identifier lists, failure codes, reserved names, and asset locations.
|
|
4
4
|
|
|
5
5
|
The current specification is a draft. It is intentionally incompatible with the legacy internal runner protocol it replaces and must not be treated as stable until independent implementations pass the conformance suite.
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ The package version is the specification version, and it is the only version in
|
|
|
12
12
|
spec: 2.0.0
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Compiled jobs and runner protocol messages carry the same `spec` field. An implementation built against version `I` accepts a declared version `D` when both have the same major version and `D` is not newer than `I`; the rule is defined in `spec/runner-protocol.md` and fixed by `conformance/version-cases.json`. Every incompatible change is a new major version, and additions arrive as new minor versions: a workflow that uses a construct introduced in a later minor version declares that version or a later one. Version 2.0.0 renames the package and its normative identifiers (see Migrating from @foss.global/ci-spec), removes the 1.x cross-version rules, and completes the compilation rules: one stable failure code per compilation failure with a fixed precedence, a stricter YAML subset, the derivation of every compiled job member, and the identities of expanded nodes. The history of the 1.x rules is in the changelog.
|
|
15
|
+
Compiled jobs and runner protocol messages carry the same `spec` field. An implementation built against version `I` accepts a declared version `D` when both have the same major version and `D` is not newer than `I`; the rule is defined in `spec/runner-protocol.md` and fixed by `conformance/version-cases.json`. Every incompatible change is a new major version, and additions arrive as new minor versions: a workflow that uses a construct introduced in a later minor version declares that version or a later one. Version 2.0.0 renames the package and its normative identifiers (see Migrating from @foss.global/ci-spec), removes the 1.x cross-version rules, and completes the compilation rules: one stable failure code per compilation failure with a fixed precedence, a stricter YAML subset, the derivation of every compiled job member, and the identities of expanded nodes. Version 2.1.0 adds job failure codes: every coherence rule of a compiled job has exactly one code, and a job that is not coherent carries the code of the first rule it violates (see Job Coherence in `spec/runner-protocol.md`); it also exports the reserved names as constants. Documents written against 2.0.0 stay valid. The history of the 1.x rules is in the changelog.
|
|
16
16
|
|
|
17
17
|
## Issue Reporting and Security
|
|
18
18
|
|
|
@@ -68,7 +68,8 @@ ajv.addSchema({
|
|
|
68
68
|
- `conformance/archive-cases.json`: byte-identical gzip/tar acceptance and rejection vectors.
|
|
69
69
|
- `conformance/version-cases.json`: specification version compatibility outcomes.
|
|
70
70
|
- `conformance/compile-cases.json` and its schema `conformance/compile-cases.schema.json`: the compilation failure codes in precedence order, trigger pattern and tag version vectors, the expected code of every invalid workflow fixture, and compile vectors that bind a workflow, run context, and deployment policy to a failure code, to not-triggered, or to the compiled nodes and plan digests. The package runs no compiler; its tests check that every vector is schema-valid and internally coherent, and compilers run the vectors.
|
|
71
|
-
- `conformance/
|
|
71
|
+
- `conformance/runner-job-cases.json` and its schema `conformance/runner-job-cases.schema.json`: the job failure codes in precedence order and the expected outcome of every runner job fixture and of inline version cases.
|
|
72
|
+
- `conformance/ci-actions/` and `conformance/runner-jobs/`: valid and invalid data fixtures. `conformance/ci-actions/compile-invalid/` holds schema-valid workflows that a compiler must reject; each is bound to a case in `runner-cases.json`. `conformance/runner-jobs/incoherent/` holds schema-valid compiled jobs that fail a later rule of Job Coherence; each is bound to a case in `runner-job-cases.json`.
|
|
72
73
|
|
|
73
74
|
The package exports these raw asset subpaths:
|
|
74
75
|
|
|
@@ -84,10 +85,12 @@ The package exports these raw asset subpaths:
|
|
|
84
85
|
- `@ship.zone/ci-spec/version-cases.json`
|
|
85
86
|
- `@ship.zone/ci-spec/compile-cases.json`
|
|
86
87
|
- `@ship.zone/ci-spec/compile-cases.schema.json`
|
|
88
|
+
- `@ship.zone/ci-spec/runner-job-cases.json`
|
|
89
|
+
- `@ship.zone/ci-spec/runner-job-cases.schema.json`
|
|
87
90
|
- `@ship.zone/ci-spec/conformance/ci-actions/*`
|
|
88
91
|
- `@ship.zone/ci-spec/conformance/runner-jobs/*`
|
|
89
92
|
|
|
90
|
-
TypeScript metadata exposes package-root-relative asset locations separately:
|
|
93
|
+
TypeScript metadata exposes package-root-relative asset locations, failure codes, and reserved names separately:
|
|
91
94
|
|
|
92
95
|
```ts
|
|
93
96
|
import {
|
|
@@ -96,6 +99,9 @@ import {
|
|
|
96
99
|
compilationFailureCodes,
|
|
97
100
|
executionProfileIdentifiers,
|
|
98
101
|
maximumArchivePathMetadataBytes,
|
|
102
|
+
reservedEnvironmentPrefix,
|
|
103
|
+
reservedImageLabelPrefix,
|
|
104
|
+
runnerJobFailureCodes,
|
|
99
105
|
runnerProtocolBasePath,
|
|
100
106
|
} from '@ship.zone/ci-spec';
|
|
101
107
|
|
|
@@ -105,6 +111,9 @@ console.log(executionProfileIdentifiers.imageBuild); // oci-image
|
|
|
105
111
|
console.log(maximumArchivePathMetadataBytes); // 134217728
|
|
106
112
|
console.log(ciSpecAssetPaths.runnerOpenApi);
|
|
107
113
|
console.log(compilationFailureCodes[0]); // { code: 'workflow_too_large', layer: 'source' }
|
|
114
|
+
console.log(runnerJobFailureCodes[1]); // job_schema_invalid
|
|
115
|
+
console.log(reservedEnvironmentPrefix); // SHIPZONE_CI_
|
|
116
|
+
console.log(reservedImageLabelPrefix); // zone.ship.ci.
|
|
108
117
|
```
|
|
109
118
|
|
|
110
119
|
Generated language bindings are deliberately not normative. Implementations must follow the published OpenAPI, JSON Schemas, prose rules, and conformance cases.
|
package/spec/runner-protocol.md
CHANGED
|
@@ -97,12 +97,42 @@ A `vm` job always carries `requirements.platform`, and it is leased only to a ru
|
|
|
97
97
|
|
|
98
98
|
Image builds run on dedicated builder runners. A runner that advertises `oci-image` advertises no other execution profile and includes `microvm` isolation; the capability schema rejects any other combination. A runner that advertises `vm` includes `microvm` isolation and may also advertise `oci`, but never `oci-image`; the capability schema rejects a `vm` runner without `microvm`.
|
|
99
99
|
|
|
100
|
-
Every compiled job is
|
|
100
|
+
Every compiled job is coherent, as Job Coherence defines, before enqueueing and again before acceptance, and every job requirement fits the accepted runner capability snapshot.
|
|
101
101
|
|
|
102
102
|
A lease is coherent with its job when every candidate reference in the job has exactly one binding with that candidate name and no binding is unreferenced; at most one grant exists per registry, repository, and access; every bound image and every private base image has a pull grant for its repository; an `oci-image` lease has exactly one push grant and an `oci` or `vm` lease has none; `npmGrants` is present exactly when the job declares `npmRead`, with exactly one grant per `npmRead` entry that carries the entry's registry and scopes.
|
|
103
103
|
|
|
104
104
|
A violation is rejected before enqueueing or abandoned as `runner_error` before acceptance.
|
|
105
105
|
|
|
106
|
+
## Job Coherence
|
|
107
|
+
|
|
108
|
+
A compiled job is *coherent* when it violates no rule of the following table. The coordinator checks a job before enqueueing it and the runner checks the job of a lease before acceptance, both with the job's secret values inserted, as a lease carries it. A job that is not coherent has exactly one *job failure code*: the code of the first row, in table order, whose rule it violates. The rows after the `job_schema_invalid` rows are checked only for a job that satisfies `schemas/runner-job.schema.json`, and the `job_schema_invalid` rows list the rules of this protocol that the schema enforces. A coordinator that rejects a job reports its code with the rejection. A runner abandons the lease as `runner_error` and reports the code only in its own diagnostics, because `AbandonJobRequest` carries no code.
|
|
109
|
+
|
|
110
|
+
| Code | Rule |
|
|
111
|
+
| --- | --- |
|
|
112
|
+
| `spec_incompatible` | the job's `spec` is canonical and its outcome for the checking implementation is `newer` or `major-mismatch` (Specification Version) |
|
|
113
|
+
| `job_schema_invalid` | the job fails `schemas/runner-job.schema.json`, including a missing, non-string, or malformed `spec` |
|
|
114
|
+
| `job_schema_invalid` | the job does not have exactly the shape of its execution profile |
|
|
115
|
+
| `job_schema_invalid` | `requirements.features` does not contain `source.tar-gz` |
|
|
116
|
+
| `job_schema_invalid` | a non-empty artifact or cache declaration list whose matching feature is missing from `requirements.features` or whose matching permission is `none` |
|
|
117
|
+
| `job_schema_invalid` | a read-write cache without `caches: read-write` |
|
|
118
|
+
| `job_schema_invalid` | `images: push` in a job that is not `oci-image`, or its absence in an `oci-image` job |
|
|
119
|
+
| `job_schema_invalid` | a `vm` job without `microvm` isolation or without `requirements.platform` |
|
|
120
|
+
| `job_schema_invalid` | an `oci` or `oci-image` job whose `requirements.platform` is not a `linux` platform |
|
|
121
|
+
| `job_schema_invalid` | in a job with `npmRead`, a step environment that defines `NPM_CONFIG_USERCONFIG`, or a build secret with id `npmrc` (npm Read Grants) |
|
|
122
|
+
| `job_secret_incoherent` | in an `oci-image` job, a build secret whose `environment` is not a key of `secrets`, or a key of `secrets` that no build secret names |
|
|
123
|
+
| `job_limit_incoherent` | a source `sizeBytes`, `extractedSizeBytes`, or `entryCount` above `maximumSourceArchiveBytes`, `maximumSourceExtractedBytes`, or `maximumSourceEntries` of `requirements.limits` |
|
|
124
|
+
| `job_limit_incoherent` | an artifact or cache `maximumBytes`, `maximumExtractedBytes`, or `maximumEntries` above the matching artifact or cache maximum of `requirements.limits` |
|
|
125
|
+
| `job_limit_incoherent` | more artifacts than `maximumArtifacts`, or more caches than `maximumCaches` |
|
|
126
|
+
| `job_resources_incoherent` | `resources.sharedMemoryBytes` above `resources.memoryBytes` |
|
|
127
|
+
| `job_environment_incoherent` | a secret target that starts with `SHIPZONE_CI_`, or a step environment name that starts with it and is not `SHIPZONE_CI_MATRIX_JSON` or `SHIPZONE_CI_INPUTS_JSON` (OCI Container Profile) |
|
|
128
|
+
| `job_environment_incoherent` | an `oci` or `vm` step whose environment lacks `SHIPZONE_CI_MATRIX_JSON` or `SHIPZONE_CI_INPUTS_JSON`, or whose value of one of them is not the RFC 8785 serialization of a JSON object (OCI Container Profile) |
|
|
129
|
+
| `job_environment_incoherent` | an `oci` or `vm` step whose environment names, the job's secret targets, and, in a job with `npmRead`, `NPM_CONFIG_USERCONFIG` are not unique or number more than 128 (OCI Container Profile, Protocol Limits) |
|
|
130
|
+
| `job_command_limit_exceeded` | a step command whose arguments total more than 131,072 UTF-8 bytes (Protocol Limits) |
|
|
131
|
+
| `job_secret_inadmissible` | a value of `secrets` shorter than 8 UTF-8 bytes (Secret Redaction) |
|
|
132
|
+
| `job_digest_mismatch` | a `compiledPlanDigest` other than the digest Canonical Digests defines for the job |
|
|
133
|
+
|
|
134
|
+
Whether a job requirement fits a runner capability snapshot and whether a lease is coherent with its job depend on more than the job, so they are not rules of this table and have no job failure code. `conformance/runner-job-cases.json` lists the codes in table order as `failureCodes` and fixes the code of every runner job fixture.
|
|
135
|
+
|
|
106
136
|
## Sessions and Leases
|
|
107
137
|
|
|
108
138
|
Each runner process starts a new session. Session identity is included in every claim and job mutation. Session creation is idempotent by `(runnerId, sessionRequestId, canonicalRequestDigest)`. The coordinator durably stores the exact response before atomically making older sessions stale. An exact retry returns the same session and response; a changed body returns HTTP 409. The key remains tombstoned for the resulting session lifetime plus ten minutes. A different request ID intentionally starts a new session and immediately fences older sessions when the new response is committed.
|
package/spec/runner.openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "ship.zone CI Runner Protocol",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.1.0",
|
|
6
6
|
"description": "Language-neutral, outbound runner protocol of @ship.zone/ci-spec. info.version is the specification version this description is written against. This draft is incompatible with the legacy internal runner protocol it replaces.",
|
|
7
7
|
"license": {
|
|
8
8
|
"name": "MIT",
|
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/constants.ts
CHANGED
|
@@ -94,6 +94,69 @@ export const compilationFailureCodes = [
|
|
|
94
94
|
{ code: 'secret_too_short', layer: 'run' },
|
|
95
95
|
] as const;
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* The prefix of every environment name the specification reserves (spec/ci-actions.md, Jobs and
|
|
99
|
+
* Steps; spec/runner-protocol.md, OCI Container Profile): workflow authors cannot define a name
|
|
100
|
+
* with it, and a compiled job carries only the reserved step variables with it.
|
|
101
|
+
*/
|
|
102
|
+
export const reservedEnvironmentPrefix = 'SHIPZONE_CI_' as const;
|
|
103
|
+
|
|
104
|
+
/** The matrix values of a compiled step, as RFC 8785 JSON object text (spec/ci-actions.md, Matrix). */
|
|
105
|
+
export const matrixEnvironmentName = 'SHIPZONE_CI_MATRIX_JSON' as const;
|
|
106
|
+
|
|
107
|
+
/** The manual inputs of a run, as RFC 8785 JSON object text (spec/ci-actions.md, Matrix). */
|
|
108
|
+
export const inputsEnvironmentName = 'SHIPZONE_CI_INPUTS_JSON' as const;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The reserved variables every compiled `oci` and `vm` step carries (spec/runner-protocol.md, OCI
|
|
112
|
+
* Container Profile).
|
|
113
|
+
*/
|
|
114
|
+
export const reservedStepEnvironmentNames = [matrixEnvironmentName, inputsEnvironmentName] as const;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The environment name through which a runner delivers npm read grants to `oci` and `vm` steps,
|
|
118
|
+
* reserved in a job with `npmRead` (spec/runner-protocol.md, npm Read Grants).
|
|
119
|
+
*/
|
|
120
|
+
export const npmUserConfigEnvironmentName = 'NPM_CONFIG_USERCONFIG' as const;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The BuildKit secret id through which a runner delivers npm read grants to an `oci-image` build,
|
|
124
|
+
* reserved in a job with `npmRead` (spec/runner-protocol.md, npm Read Grants).
|
|
125
|
+
*/
|
|
126
|
+
export const npmBuildSecretId = 'npmrc' as const;
|
|
127
|
+
|
|
128
|
+
/** The prefix of the image label keys reserved for the coordinator (spec/ci-actions.md, Image Builds). */
|
|
129
|
+
export const reservedImageLabelPrefix = 'zone.ship.ci.' as const;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The image label keys reserved for the coordinator besides the reserved prefix (spec/ci-actions.md,
|
|
133
|
+
* Image Builds). The coordinator compiles `revision` and `source` into every build job and `version`
|
|
134
|
+
* on a run with a tag version (spec/ci-actions.md, Compiled Jobs).
|
|
135
|
+
*/
|
|
136
|
+
export const reservedImageLabelKeys = [
|
|
137
|
+
'org.opencontainers.image.revision',
|
|
138
|
+
'org.opencontainers.image.source',
|
|
139
|
+
'org.opencontainers.image.version',
|
|
140
|
+
] as const;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Every runner job failure code in precedence order, mirrored from
|
|
144
|
+
* `conformance/runner-job-cases.json` `failureCodes`: the code a coordinator or runner reports for a
|
|
145
|
+
* compiled job that is not coherent (spec/runner-protocol.md, Job Coherence). The conformance tests
|
|
146
|
+
* assert both sources and the prose table agree.
|
|
147
|
+
*/
|
|
148
|
+
export const runnerJobFailureCodes = [
|
|
149
|
+
'spec_incompatible',
|
|
150
|
+
'job_schema_invalid',
|
|
151
|
+
'job_secret_incoherent',
|
|
152
|
+
'job_limit_incoherent',
|
|
153
|
+
'job_resources_incoherent',
|
|
154
|
+
'job_environment_incoherent',
|
|
155
|
+
'job_command_limit_exceeded',
|
|
156
|
+
'job_secret_inadmissible',
|
|
157
|
+
'job_digest_mismatch',
|
|
158
|
+
] as const;
|
|
159
|
+
|
|
97
160
|
export const ciSpecAssetPaths = {
|
|
98
161
|
runnerOpenApi: 'spec/runner.openapi.json',
|
|
99
162
|
runnerProtocol: 'spec/runner-protocol.md',
|
|
@@ -107,6 +170,8 @@ export const ciSpecAssetPaths = {
|
|
|
107
170
|
versionCases: 'conformance/version-cases.json',
|
|
108
171
|
compileCases: 'conformance/compile-cases.json',
|
|
109
172
|
compileCasesSchema: 'conformance/compile-cases.schema.json',
|
|
173
|
+
runnerJobCases: 'conformance/runner-job-cases.json',
|
|
174
|
+
runnerJobCasesSchema: 'conformance/runner-job-cases.schema.json',
|
|
110
175
|
ciActionsConformanceDirectory: 'conformance/ci-actions',
|
|
111
176
|
runnerJobConformanceDirectory: 'conformance/runner-jobs',
|
|
112
177
|
} as const;
|