@xemahq/xema 0.39.0 → 0.40.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/README.md +1 -1
- package/dist/assets/distribution-assets.manifest.json +2 -70
- package/dist/commands/biome-dev.js +2 -3
- package/dist/commands/biome-dev.js.map +1 -1
- package/dist/commands/dev.js +2 -3
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +3 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.js +21 -9
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/installation.d.ts.map +1 -1
- package/dist/commands/installation.js +7 -5
- package/dist/commands/installation.js.map +1 -1
- package/dist/commands/license.d.ts.map +1 -1
- package/dist/commands/license.js +2 -1
- package/dist/commands/license.js.map +1 -1
- package/dist/commands/serve.js +1 -1
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +3 -5
- package/dist/commands/up.js.map +1 -1
- package/dist/edition/verify-image-evidence.bundle.provenance.json +39 -39
- package/dist/runtime/config/init-presets.d.ts.map +1 -1
- package/dist/runtime/config/init-presets.js +3 -5
- package/dist/runtime/config/init-presets.js.map +1 -1
- package/dist/runtime/config/loader.d.ts +2 -2
- package/dist/runtime/config/loader.d.ts.map +1 -1
- package/dist/runtime/config/loader.js +1 -1
- package/dist/runtime/config/loader.js.map +1 -1
- package/dist/runtime/config/schema.d.ts +149 -1
- package/dist/runtime/config/schema.d.ts.map +1 -1
- package/dist/runtime/config/schema.js +17 -4
- package/dist/runtime/config/schema.js.map +1 -1
- package/dist/runtime/installation/setup-profile.d.ts +1 -1
- package/dist/runtime/installation/setup-profile.d.ts.map +1 -1
- package/dist/runtime/installation/setup-profile.js +1 -1
- package/dist/runtime/installation/setup-profile.js.map +1 -1
- package/edition/biome-content.mjs +35 -6
- package/edition/build-platform-service-index.mjs +1 -1
- package/edition/develop-edition-resolve.mjs +58 -20
- package/edition/develop-image-probe.mjs +117 -0
- package/edition/develop-seal.mjs +4 -12
- package/edition/dispatched-runtime-components.mjs +1 -1
- package/edition/dist-check.mjs +1 -1
- package/edition/lib.mjs +1 -1
- package/edition/map-with-concurrency.mjs +19 -0
- package/edition/oras-process.mjs +35 -0
- package/edition/oras.mjs +123 -94
- package/edition/resolve-chart-set.mjs +12 -8
- package/edition/resolve-images.mjs +18 -8
- package/edition/verify-image-platforms.mjs +28 -26
- package/package.json +2 -2
- package/dist/assets/cloud/distribution.lock.json +0 -6447
- package/dist/assets/cloud/images.lock.json +0 -1831
- package/dist/assets/minimal/distribution.lock.json +0 -3297
- package/dist/assets/minimal/images.lock.json +0 -1189
- package/dist/assets/oss/distribution.lock.json +0 -6266
- package/dist/assets/oss/images.lock.json +0 -1750
- package/dist/assets/starter/distribution.lock.json +0 -4165
- package/dist/assets/starter/images.lock.json +0 -1454
|
@@ -90,7 +90,150 @@ declare const PolicyConfigSchema: z.ZodObject<{
|
|
|
90
90
|
export type PolicyConfig = z.infer<typeof PolicyConfigSchema>;
|
|
91
91
|
export declare function resolveDefaultAllowedTiers(policy: PolicyConfig | undefined): CredentialPolicyAllowedTiers;
|
|
92
92
|
export declare const XemaConfigSchema: z.ZodObject<{
|
|
93
|
-
|
|
93
|
+
infra: z.ZodDefault<z.ZodObject<{
|
|
94
|
+
postgres: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
mode: z.ZodEnum<typeof InfraMode>;
|
|
96
|
+
url: z.ZodOptional<z.ZodString>;
|
|
97
|
+
realm: z.ZodOptional<z.ZodString>;
|
|
98
|
+
bucketPrefix: z.ZodOptional<z.ZodString>;
|
|
99
|
+
secretRef: z.ZodOptional<z.ZodString>;
|
|
100
|
+
persist: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
path: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, z.core.$strict>>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
redis: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
mode: z.ZodEnum<typeof InfraMode>;
|
|
106
|
+
url: z.ZodOptional<z.ZodString>;
|
|
107
|
+
realm: z.ZodOptional<z.ZodString>;
|
|
108
|
+
bucketPrefix: z.ZodOptional<z.ZodString>;
|
|
109
|
+
secretRef: z.ZodOptional<z.ZodString>;
|
|
110
|
+
persist: z.ZodOptional<z.ZodObject<{
|
|
111
|
+
path: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strict>>;
|
|
113
|
+
}, z.core.$strict>>;
|
|
114
|
+
etcd: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
mode: z.ZodEnum<typeof InfraMode>;
|
|
116
|
+
url: z.ZodOptional<z.ZodString>;
|
|
117
|
+
realm: z.ZodOptional<z.ZodString>;
|
|
118
|
+
bucketPrefix: z.ZodOptional<z.ZodString>;
|
|
119
|
+
secretRef: z.ZodOptional<z.ZodString>;
|
|
120
|
+
persist: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
path: z.ZodOptional<z.ZodString>;
|
|
122
|
+
}, z.core.$strict>>;
|
|
123
|
+
}, z.core.$strict>>;
|
|
124
|
+
keycloak: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
mode: z.ZodEnum<typeof InfraMode>;
|
|
126
|
+
url: z.ZodOptional<z.ZodString>;
|
|
127
|
+
realm: z.ZodOptional<z.ZodString>;
|
|
128
|
+
bucketPrefix: z.ZodOptional<z.ZodString>;
|
|
129
|
+
secretRef: z.ZodOptional<z.ZodString>;
|
|
130
|
+
persist: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
path: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$strict>>;
|
|
133
|
+
}, z.core.$strict>>;
|
|
134
|
+
objectStore: z.ZodOptional<z.ZodObject<{
|
|
135
|
+
mode: z.ZodEnum<typeof InfraMode>;
|
|
136
|
+
url: z.ZodOptional<z.ZodString>;
|
|
137
|
+
realm: z.ZodOptional<z.ZodString>;
|
|
138
|
+
bucketPrefix: z.ZodOptional<z.ZodString>;
|
|
139
|
+
secretRef: z.ZodOptional<z.ZodString>;
|
|
140
|
+
persist: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
path: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$strict>>;
|
|
143
|
+
}, z.core.$strict>>;
|
|
144
|
+
fga: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
mode: z.ZodEnum<typeof InfraMode>;
|
|
146
|
+
url: z.ZodOptional<z.ZodString>;
|
|
147
|
+
realm: z.ZodOptional<z.ZodString>;
|
|
148
|
+
bucketPrefix: z.ZodOptional<z.ZodString>;
|
|
149
|
+
secretRef: z.ZodOptional<z.ZodString>;
|
|
150
|
+
persist: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
path: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
}, z.core.$strict>>;
|
|
154
|
+
git: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
mode: z.ZodEnum<typeof InfraMode>;
|
|
156
|
+
url: z.ZodOptional<z.ZodString>;
|
|
157
|
+
realm: z.ZodOptional<z.ZodString>;
|
|
158
|
+
bucketPrefix: z.ZodOptional<z.ZodString>;
|
|
159
|
+
secretRef: z.ZodOptional<z.ZodString>;
|
|
160
|
+
persist: z.ZodOptional<z.ZodObject<{
|
|
161
|
+
path: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strict>>;
|
|
163
|
+
}, z.core.$strict>>;
|
|
164
|
+
temporal: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
mode: z.ZodEnum<typeof InfraMode>;
|
|
166
|
+
url: z.ZodOptional<z.ZodString>;
|
|
167
|
+
realm: z.ZodOptional<z.ZodString>;
|
|
168
|
+
bucketPrefix: z.ZodOptional<z.ZodString>;
|
|
169
|
+
secretRef: z.ZodOptional<z.ZodString>;
|
|
170
|
+
persist: z.ZodOptional<z.ZodObject<{
|
|
171
|
+
path: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strict>>;
|
|
173
|
+
}, z.core.$strict>>;
|
|
174
|
+
}, z.core.$strict>>;
|
|
175
|
+
app: z.ZodDefault<z.ZodObject<{
|
|
176
|
+
substrate: z.ZodDefault<z.ZodEnum<typeof Substrate>>;
|
|
177
|
+
processModel: z.ZodDefault<z.ZodEnum<typeof ProcessModel>>;
|
|
178
|
+
include: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"default">, z.ZodLiteral<"minimal">, z.ZodArray<z.ZodString>]>>;
|
|
179
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
180
|
+
features: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
181
|
+
web: z.ZodDefault<z.ZodObject<{
|
|
182
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
183
|
+
substrate: z.ZodOptional<z.ZodEnum<typeof Substrate>>;
|
|
184
|
+
}, z.core.$strict>>;
|
|
185
|
+
}, z.core.$strict>>;
|
|
186
|
+
state: z.ZodDefault<z.ZodObject<{
|
|
187
|
+
workspaces: z.ZodDefault<z.ZodObject<{
|
|
188
|
+
driver: z.ZodOptional<z.ZodEnum<typeof WorkspaceDriver>>;
|
|
189
|
+
path: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, z.core.$strict>>;
|
|
191
|
+
biomeMaterialization: z.ZodDefault<z.ZodObject<{
|
|
192
|
+
path: z.ZodOptional<z.ZodString>;
|
|
193
|
+
}, z.core.$strict>>;
|
|
194
|
+
}, z.core.$strict>>;
|
|
195
|
+
secrets: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
196
|
+
from: z.ZodEnum<typeof SecretSource>;
|
|
197
|
+
path: z.ZodOptional<z.ZodString>;
|
|
198
|
+
env: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, z.core.$strict>>>;
|
|
200
|
+
sources: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
201
|
+
kind: z.ZodLiteral<import("../sources/schema").SourceKind.Workspace>;
|
|
202
|
+
root: z.ZodOptional<z.ZodString>;
|
|
203
|
+
name: z.ZodString;
|
|
204
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
205
|
+
kind: z.ZodLiteral<import("../sources/schema").SourceKind.Distribution>;
|
|
206
|
+
edition: z.ZodString;
|
|
207
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
208
|
+
name: z.ZodString;
|
|
209
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
210
|
+
kind: z.ZodLiteral<import("../sources/schema").SourceKind.Npm>;
|
|
211
|
+
registryUrl: z.ZodOptional<z.ZodString>;
|
|
212
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
213
|
+
authTokenEnv: z.ZodOptional<z.ZodString>;
|
|
214
|
+
name: z.ZodString;
|
|
215
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
216
|
+
kind: z.ZodLiteral<import("../sources/schema").SourceKind.Oci>;
|
|
217
|
+
registry: z.ZodString;
|
|
218
|
+
authTokenEnv: z.ZodOptional<z.ZodString>;
|
|
219
|
+
name: z.ZodString;
|
|
220
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
221
|
+
kind: z.ZodLiteral<import("../sources/schema").SourceKind.Git>;
|
|
222
|
+
url: z.ZodString;
|
|
223
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
224
|
+
authTokenEnv: z.ZodOptional<z.ZodString>;
|
|
225
|
+
authUsername: z.ZodOptional<z.ZodString>;
|
|
226
|
+
name: z.ZodString;
|
|
227
|
+
}, z.core.$strict>], "kind">>>;
|
|
228
|
+
cli: z.ZodOptional<z.ZodObject<{
|
|
229
|
+
devMode: z.ZodOptional<z.ZodBoolean>;
|
|
230
|
+
}, z.core.$strict>>;
|
|
231
|
+
policy: z.ZodOptional<z.ZodObject<{
|
|
232
|
+
allowedTiers: z.ZodOptional<z.ZodEnum<typeof LaunchAllowedTiers>>;
|
|
233
|
+
}, z.core.$strict>>;
|
|
234
|
+
edition: z.ZodString;
|
|
235
|
+
}, z.core.$strict>;
|
|
236
|
+
export declare const EditionlessConfigSchema: z.ZodObject<{
|
|
94
237
|
infra: z.ZodDefault<z.ZodObject<{
|
|
95
238
|
postgres: z.ZodOptional<z.ZodObject<{
|
|
96
239
|
mode: z.ZodEnum<typeof InfraMode>;
|
|
@@ -234,6 +377,11 @@ export declare const XemaConfigSchema: z.ZodObject<{
|
|
|
234
377
|
}, z.core.$strict>>;
|
|
235
378
|
}, z.core.$strict>;
|
|
236
379
|
export type XemaConfig = z.infer<typeof XemaConfigSchema>;
|
|
380
|
+
export type LoadedXemaConfig = Omit<XemaConfig, 'edition'> & {
|
|
381
|
+
readonly edition: string | undefined;
|
|
382
|
+
};
|
|
383
|
+
export declare const MISSING_EDITION_MESSAGE = "No edition configured: pass --edition <id> or set `edition:` in xema.config.yaml.";
|
|
384
|
+
export declare function withEdition(config: LoadedXemaConfig, override?: string): XemaConfig;
|
|
237
385
|
export declare function parseXemaConfig(raw: unknown): XemaConfig;
|
|
238
386
|
export {};
|
|
239
387
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/runtime/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,oBAAY,SAAS;IAEnB,OAAO,YAAY;IAEnB,QAAQ,aAAa;IAMrB,QAAQ,aAAa;CACtB;AAGD,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;IAEjB,IAAI,SAAS;CACd;AASD,oBAAY,YAAY;IACtB,WAAW,gBAAgB;CAC5B;AAGD,oBAAY,cAAc;IACxB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,GAAG,QAAQ;IACX,GAAG,QAAQ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O,GAAG,UAAU,CAUxD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.XemaConfigSchema = exports.CredentialPolicyAllowedTiers = exports.LaunchAllowedTiers = exports.SecretSource = exports.WorkspaceDriver = exports.InfraComponent = exports.ProcessModel = exports.Substrate = exports.InfraMode = void 0;
|
|
3
|
+
exports.MISSING_EDITION_MESSAGE = exports.EditionlessConfigSchema = exports.XemaConfigSchema = exports.CredentialPolicyAllowedTiers = exports.LaunchAllowedTiers = exports.SecretSource = exports.WorkspaceDriver = exports.InfraComponent = exports.ProcessModel = exports.Substrate = exports.InfraMode = void 0;
|
|
4
4
|
exports.resolveDefaultAllowedTiers = resolveDefaultAllowedTiers;
|
|
5
|
+
exports.withEdition = withEdition;
|
|
5
6
|
exports.parseXemaConfig = parseXemaConfig;
|
|
6
7
|
const zod_1 = require("zod");
|
|
7
8
|
const url_security_1 = require("../secrets/url-security");
|
|
@@ -202,9 +203,7 @@ function resolveDefaultAllowedTiers(policy) {
|
|
|
202
203
|
const tier = policy?.allowedTiers ?? LaunchAllowedTiers.Byok;
|
|
203
204
|
return LAUNCH_TIERS_TO_CREDENTIAL_POLICY[tier];
|
|
204
205
|
}
|
|
205
|
-
|
|
206
|
-
.object({
|
|
207
|
-
edition: zod_1.z.string().min(1).default('oss'),
|
|
206
|
+
const xemaConfigShape = {
|
|
208
207
|
infra: InfraConfigSchema.default({}),
|
|
209
208
|
app: AppConfigSchema.default({
|
|
210
209
|
substrate: Substrate.Container,
|
|
@@ -222,8 +221,22 @@ exports.XemaConfigSchema = zod_1.z
|
|
|
222
221
|
sources: schema_1.SourcesConfigSchema,
|
|
223
222
|
cli: CliConfigSchema.optional(),
|
|
224
223
|
policy: PolicyConfigSchema.optional(),
|
|
224
|
+
};
|
|
225
|
+
exports.XemaConfigSchema = zod_1.z
|
|
226
|
+
.object({
|
|
227
|
+
edition: zod_1.z.string().min(1),
|
|
228
|
+
...xemaConfigShape,
|
|
225
229
|
})
|
|
226
230
|
.strict();
|
|
231
|
+
exports.EditionlessConfigSchema = zod_1.z.object(xemaConfigShape).strict();
|
|
232
|
+
exports.MISSING_EDITION_MESSAGE = 'No edition configured: pass --edition <id> or set `edition:` in xema.config.yaml.';
|
|
233
|
+
function withEdition(config, override) {
|
|
234
|
+
const edition = override !== undefined && override.length > 0 ? override : config.edition;
|
|
235
|
+
if (edition === undefined) {
|
|
236
|
+
throw new Error(exports.MISSING_EDITION_MESSAGE);
|
|
237
|
+
}
|
|
238
|
+
return { ...config, edition };
|
|
239
|
+
}
|
|
227
240
|
function parseXemaConfig(raw) {
|
|
228
241
|
const result = exports.XemaConfigSchema.safeParse(raw ?? {});
|
|
229
242
|
if (!result.success) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/runtime/config/schema.ts"],"names":[],"mappings":";;;AAgUA,gEAKC;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/runtime/config/schema.ts"],"names":[],"mappings":";;;AAgUA,gEAKC;AA8DD,kCASC;AAGD,0CAUC;AAzZD,6BAAwB;AAExB,0DAAwE;AACxE,8CAAwD;AAWxD,IAAY,SAWX;AAXD,WAAY,SAAS;IAEnB,gCAAmB,CAAA;IAEnB,kCAAqB,CAAA;IAMrB,kCAAqB,CAAA;AACvB,CAAC,EAXW,SAAS,yBAAT,SAAS,QAWpB;AAGD,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,8BAAiB,CAAA;IAEjB,0BAAa,CAAA;AACf,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB;AASD,IAAY,YAEX;AAFD,WAAY,YAAY;IACtB,2CAA2B,CAAA;AAC7B,CAAC,EAFW,YAAY,4BAAZ,YAAY,QAEvB;AAGD,IAAY,cASX;AATD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,i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C,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;aAChD,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
|
|
@@ -7,7 +7,7 @@ export interface SetupTargetBinding {
|
|
|
7
7
|
readonly context?: string;
|
|
8
8
|
readonly kubeconfig?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare function createInstallationProfileTemplate(profile: SetupInstallationProfile, name: string, edition
|
|
10
|
+
export declare function createInstallationProfileTemplate(profile: SetupInstallationProfile, name: string, edition: string, target?: SetupTargetBinding): XemaInstallation;
|
|
11
11
|
export declare function setupInstallationProfiles(): readonly SetupInstallationProfile[];
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=setup-profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-profile.d.ts","sourceRoot":"","sources":["../../../src/runtime/installation/setup-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,KAAK,sBAAsB,EAI3B,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AAEpB,QAAA,MAAM,cAAc,iHAIV,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,MAAM,GACZ,wBAAwB,CAQ1B;AAGD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,wBAAwB,EACjC,IAAI,EAAE,MAAM,EACZ,OAAO,
|
|
1
|
+
{"version":3,"file":"setup-profile.d.ts","sourceRoot":"","sources":["../../../src/runtime/installation/setup-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,KAAK,sBAAsB,EAI3B,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AAEpB,QAAA,MAAM,cAAc,iHAIV,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,MAAM,GACZ,wBAAwB,CAQ1B;AAGD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,wBAAwB,EACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,kBAAkB,GAC1B,gBAAgB,CAoBlB;AAED,wBAAgB,yBAAyB,IAAI,SAAS,wBAAwB,EAAE,CAE/E"}
|
|
@@ -16,7 +16,7 @@ function parseSetupInstallationProfile(value) {
|
|
|
16
16
|
}
|
|
17
17
|
return profile;
|
|
18
18
|
}
|
|
19
|
-
function createInstallationProfileTemplate(profile, name, edition
|
|
19
|
+
function createInstallationProfileTemplate(profile, name, edition, target) {
|
|
20
20
|
return {
|
|
21
21
|
apiVersion: contract_1.XEMA_INSTALLATION_API_VERSION,
|
|
22
22
|
kind: contract_1.XEMA_INSTALLATION_KIND,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-profile.js","sourceRoot":"","sources":["../../../src/runtime/installation/setup-profile.ts"],"names":[],"mappings":";;AAkBA,sEAUC;AASD,8EAyBC;AAED,8DAEC;AAlED,y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B;QACzC,IAAI,EAAE,iCAAsB;QAC5B,QAAQ,EAAE,EAAE,IAAI,EAAE;QAClB,IAAI,EAAE;YACJ,OAAO;YACP,SAAS,EAAE;gBACT,WAAW,EACT,OAAO,KAAK,8BAAmB,CAAC,oBAAoB;oBAClD,CAAC,CAAC,+BAAoB,CAAC,UAAU;oBACjC,CAAC,CAAC,+BAAoB,CAAC,WAAW;aACvC;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,oCAAyB,CAAC,OAAO;gBACvC,OAAO;aACR;YACD,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;SAC5C;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,yBAAyB;IACvC,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -224,36 +224,65 @@ function assertLockNamesCatalogue({ schemas, lock, catalogue, catalogueDigest, s
|
|
|
224
224
|
* @param {readonly string[]} [request.storePublisherAnchorKeys] customer mode: the definition's Store publisher selection (absent = none)
|
|
225
225
|
* @returns {Promise<Map<string, string>>} biome id -> BiomeContentHash
|
|
226
226
|
*/
|
|
227
|
-
export async function computeBiomeContentHashes({ schemas, lock, imageLock, locate, vendoredCommit, catalogue, catalogueDigest, storePublisherAnchorKeys }) {
|
|
227
|
+
export async function computeBiomeContentHashes({ schemas, lock, imageLock, locate, vendoredCommit, catalogue, catalogueDigest, storePublisherAnchorKeys, sourceFactsById }) {
|
|
228
228
|
if (catalogue !== undefined) {assertLockNamesCatalogue({ schemas, lock, catalogue, catalogueDigest, storePublisherAnchorKeys });}
|
|
229
229
|
const hashes = new Map();
|
|
230
230
|
for (const biome of lock.biomes) {
|
|
231
231
|
const facts =
|
|
232
232
|
catalogue !== undefined && biome.source === undefined
|
|
233
233
|
? await catalogueFacts({ schemas, biome, imageLock, catalogue })
|
|
234
|
-
:
|
|
234
|
+
: sourceFactsById === undefined
|
|
235
|
+
? await sourceFacts({ schemas, biome, imageLock, locate, vendoredCommit })
|
|
236
|
+
: precomputedFacts(sourceFactsById, biome);
|
|
235
237
|
hashes.set(biome.id, await schemas.computeBiomeContentHash(facts));
|
|
236
238
|
}
|
|
237
239
|
return hashes;
|
|
238
240
|
}
|
|
239
241
|
|
|
242
|
+
/**
|
|
243
|
+
* The source facts of every biome of `lock`, read ONCE: a caller that needs both
|
|
244
|
+
* the content hashes and the tree ids (the develop resolve) passes the result to
|
|
245
|
+
* `sealLock` and `biomeSourceTreeIds` as `sourceFactsById`, instead of each walking
|
|
246
|
+
* every biome's checkout again.
|
|
247
|
+
*
|
|
248
|
+
* @returns {Promise<Map<string, object>>} biome id -> the three source facts
|
|
249
|
+
*/
|
|
250
|
+
export async function readBiomeSourceFacts({ schemas, lock, imageLock, locate, vendoredCommit }) {
|
|
251
|
+
const facts = new Map();
|
|
252
|
+
for (const biome of lock.biomes) {
|
|
253
|
+
facts.set(biome.id, await sourceFacts({ schemas, biome, imageLock, locate, vendoredCommit }));
|
|
254
|
+
}
|
|
255
|
+
return facts;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function precomputedFacts(sourceFactsById, biome) {
|
|
259
|
+
const facts = sourceFactsById.get(biome.id);
|
|
260
|
+
if (facts === undefined) {
|
|
261
|
+
throw new BiomeContentHashError(`biome "${biome.id}": the precomputed source facts do not cover it`);
|
|
262
|
+
}
|
|
263
|
+
return facts;
|
|
264
|
+
}
|
|
265
|
+
|
|
240
266
|
/**
|
|
241
267
|
* The git tree id of every biome of a VENDOR offering at its pinned commit, as
|
|
242
268
|
* the catalogue publishes them: `{ [biomeId]: GitTreeId }`, sorted by id.
|
|
243
269
|
* THIS is the writer's source of the catalogue's `sourceTreeIds` (callers:
|
|
244
270
|
* release-catalogue.mjs `releaseCatalogue`, develop-edition-resolve.mjs).
|
|
245
271
|
*/
|
|
246
|
-
export async function biomeSourceTreeIds({ schemas, lock, imageLock, locate, vendoredCommit }) {
|
|
272
|
+
export async function biomeSourceTreeIds({ schemas, lock, imageLock, locate, vendoredCommit, sourceFactsById }) {
|
|
247
273
|
const ids = {};
|
|
248
274
|
for (const biome of [...lock.biomes].sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0))) {
|
|
249
|
-
|
|
275
|
+
const facts = sourceFactsById === undefined
|
|
276
|
+
? await sourceFacts({ schemas, biome, imageLock, locate, vendoredCommit })
|
|
277
|
+
: precomputedFacts(sourceFactsById, biome);
|
|
278
|
+
ids[biome.id] = facts.sourceTreeId;
|
|
250
279
|
}
|
|
251
280
|
return ids;
|
|
252
281
|
}
|
|
253
282
|
|
|
254
283
|
/** Seal: the unsealed lock + the recomputed hashes -> the kernel's `sealDistributionLock`. */
|
|
255
|
-
export async function sealLock({ schemas, unsealed, imageLock, locate, vendoredCommit, catalogue, catalogueDigest, storePublisherAnchorKeys }) {
|
|
256
|
-
const hashes = await computeBiomeContentHashes({ schemas, lock: unsealed, imageLock, locate, vendoredCommit, catalogue, catalogueDigest, storePublisherAnchorKeys });
|
|
284
|
+
export async function sealLock({ schemas, unsealed, imageLock, locate, vendoredCommit, catalogue, catalogueDigest, storePublisherAnchorKeys, sourceFactsById }) {
|
|
285
|
+
const hashes = await computeBiomeContentHashes({ schemas, lock: unsealed, imageLock, locate, vendoredCommit, catalogue, catalogueDigest, storePublisherAnchorKeys, sourceFactsById });
|
|
257
286
|
assertOperationGrantsAdmitted(schemas, unsealed);
|
|
258
287
|
assertOrganizationSweepsAdmitted(schemas, unsealed);
|
|
259
288
|
return schemas.sealDistributionLock(unsealed, hashes);
|
|
@@ -85,7 +85,7 @@ function git(repo, args) {
|
|
|
85
85
|
* `opencode-image-prepuller` and `xema-host-web` with no identity at all.
|
|
86
86
|
*
|
|
87
87
|
* The index is derived from the declarations alone: no edition is read, so a
|
|
88
|
-
* data root
|
|
88
|
+
* data root with any set of editions (or none) builds and checks it the same.
|
|
89
89
|
*/
|
|
90
90
|
function loadPlatformServiceDeclarations() {
|
|
91
91
|
return platformServiceSourceDeclarations()
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
// trees; the caller writes the artifact (edition-artifact.mjs).
|
|
8
8
|
|
|
9
9
|
import { adapterHostRow, assertAdapterBundlesMatchHost, fetchRegistryManifest } from './adapter-bundled-versions.mjs';
|
|
10
|
-
import { biomeSourceTreeIds, sealLock } from './biome-content.mjs';
|
|
10
|
+
import { biomeSourceTreeIds, readBiomeSourceFacts, sealLock } from './biome-content.mjs';
|
|
11
11
|
import { buildCatalogue } from './catalogue.mjs';
|
|
12
12
|
import { resolveDevelopChartSet } from './develop-chart-set.mjs';
|
|
13
|
+
import { createDevelopImageProbe } from './develop-image-probe.mjs';
|
|
13
14
|
import { sealDevelopImages } from './develop-seal.mjs';
|
|
14
15
|
import { assertFrozenCheckouts, buildSnapshotInputs } from './develop-snapshot-inputs.mjs';
|
|
15
16
|
import { EditionChannel } from './edition-constants.mjs';
|
|
@@ -21,33 +22,69 @@ import { composeAuthorizationBase, resolveDistributionWithIndex } from './resolv
|
|
|
21
22
|
import { externalSourceTrees, resolveImages, sourceTreeLocator } from './resolve-images.mjs';
|
|
22
23
|
import { createPinnedSourceAuthority } from './source-authority.mjs';
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The steps the resolve runs, named so a test can stand in for the ones that
|
|
27
|
+
* need a real snapshot and observe that the later ones are never reached.
|
|
28
|
+
*/
|
|
29
|
+
export const DEVELOP_EDITION_STEPS = Object.freeze({
|
|
30
|
+
assertFrozenCheckouts,
|
|
31
|
+
buildSnapshotInputs,
|
|
32
|
+
resolveDistributionWithIndex,
|
|
33
|
+
assertAdapterBundlesMatchHost,
|
|
34
|
+
composeAuthorizationBase,
|
|
35
|
+
resolveImages,
|
|
36
|
+
sealDevelopImages,
|
|
37
|
+
resolveDevelopChartSet,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const stderrProgress = (line) => process.stderr.write(`${line}\n`);
|
|
41
|
+
|
|
42
|
+
export async function resolveDevelopEdition({ id, pins, env = process.env, sealOptions = {}, fetchKernelTarball, fetchManifest = fetchRegistryManifest, progress = stderrProgress, steps = DEVELOP_EDITION_STEPS }) {
|
|
43
|
+
const startedAt = Date.now();
|
|
44
|
+
// One line per phase, with the time since the resolve began, so the step is never silent for long.
|
|
45
|
+
const phase = (name) => progress(`[develop-edition] ${name} (+${Date.now() - startedAt}ms)`);
|
|
25
46
|
const schemas = await loadKernelDistributionSchemas();
|
|
26
|
-
assertFrozenCheckouts(pins);
|
|
27
|
-
const inputs = await buildSnapshotInputs({ id, pins, schemas });
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
47
|
+
steps.assertFrozenCheckouts(pins);
|
|
48
|
+
const inputs = await steps.buildSnapshotInputs({ id, pins, schemas });
|
|
49
|
+
phase('snapshot inputs built');
|
|
50
|
+
const { lock, index } = await steps.resolveDistributionWithIndex(id, { inputs });
|
|
51
|
+
await steps.assertAdapterBundlesMatchHost({ lock, hostRow: adapterHostRow(index), fetchManifest });
|
|
52
|
+
const authorizationLock = await steps.composeAuthorizationBase(id, lock, index);
|
|
53
|
+
phase('distribution lock resolved');
|
|
54
|
+
// Every subject's develop image is probed the moment its hash is known, in
|
|
55
|
+
// parallel with the hashing of the rest; an absent image refuses here, naming
|
|
56
|
+
// all of them, before any later phase runs.
|
|
57
|
+
const probe = createDevelopImageProbe({
|
|
58
|
+
distributionId: id,
|
|
59
|
+
env,
|
|
60
|
+
...(sealOptions.distributionsRoot === undefined ? {} : { distributionsRoot: sealOptions.distributionsRoot }),
|
|
61
|
+
...(sealOptions.fetchImpl === undefined ? {} : { fetchImpl: sealOptions.fetchImpl }),
|
|
62
|
+
...(sealOptions.run === undefined ? {} : { run: sealOptions.run }),
|
|
63
|
+
progress,
|
|
64
|
+
});
|
|
65
|
+
const { imageLock } = await steps.resolveImages(id, { inputs, lock, onSubjectHashed: probe.observe });
|
|
66
|
+
phase(`image content hashes computed (${imageLock.subjects.length} subjects)`);
|
|
67
|
+
await probe.settle();
|
|
68
|
+
phase('every develop image is present');
|
|
69
|
+
const sealedImageLock = await steps.sealDevelopImages({ imageLock, env, progress, ...sealOptions });
|
|
70
|
+
phase('images sealed');
|
|
33
71
|
// The unsealed lock becomes the one v5 grammar only here, once the images it
|
|
34
72
|
// owns are sealed: each biomeContentHash is recomputed from the frozen sources.
|
|
35
73
|
const authority = createPinnedSourceAuthority({ pins: inputs.runtimeImageSourceIndex.repositoryPins });
|
|
36
|
-
const
|
|
74
|
+
const biomeSources = {
|
|
37
75
|
schemas,
|
|
38
|
-
unsealed: lock,
|
|
39
76
|
imageLock: sealedImageLock,
|
|
40
77
|
locate: sourceTreeLocator(externalSourceTrees(lock)),
|
|
41
78
|
vendoredCommit: (repo) => authority.vendoredSourceCommitForRepository(repo),
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
});
|
|
79
|
+
};
|
|
80
|
+
// ONE walk of the biome checkouts: the content hashes and the tree ids both read it.
|
|
81
|
+
const sourceFactsById = await readBiomeSourceFacts({ ...biomeSources, lock });
|
|
82
|
+
phase(`biome sources read (${sourceFactsById.size} biomes)`);
|
|
83
|
+
const sealedLock = await sealLock({ ...biomeSources, unsealed: lock, sourceFactsById });
|
|
84
|
+
phase('distribution lock sealed');
|
|
85
|
+
const chartSetLock = await steps.resolveDevelopChartSet({ xemaDeploySha: pins[deployPinKey()] });
|
|
86
|
+
phase('chart set resolved');
|
|
87
|
+
const sourceTreeIds = await biomeSourceTreeIds({ ...biomeSources, lock, sourceFactsById });
|
|
51
88
|
const catalogue = buildCatalogue({
|
|
52
89
|
sourceTreeIds,
|
|
53
90
|
offeringId: id,
|
|
@@ -65,5 +102,6 @@ export async function resolveDevelopEdition({ id, pins, env = process.env, sealO
|
|
|
65
102
|
}),
|
|
66
103
|
leaf: inputs.composed.leaf,
|
|
67
104
|
});
|
|
105
|
+
phase('catalogue built');
|
|
68
106
|
return { distributionLock: sealedLock, imageLock: sealedImageLock, authorizationLock, chartSetLock, catalogue };
|
|
69
107
|
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// develop-image-probe — learn EARLY which develop images are not built yet.
|
|
2
|
+
//
|
|
3
|
+
// The develop seal verifies every subject's platforms, and only after it has
|
|
4
|
+
// read all of them can it say which coordinates are absent. A develop edition
|
|
5
|
+
// whose producer CI has not finished therefore failed minutes after the
|
|
6
|
+
// content hashes were known. This probe asks the registry one cheap question
|
|
7
|
+
// per subject — does `<developImageRef>:<contentHash>` resolve to a
|
|
8
|
+
// hash-verified manifest — as soon as that subject's hash exists, in parallel
|
|
9
|
+
// with the hashing of the rest, and `settle()` refuses with ONE error naming
|
|
10
|
+
// every missing coordinate. It verifies existence only: the platform check, the
|
|
11
|
+
// digest decision and the size bounds stay in the seal, which still runs.
|
|
12
|
+
|
|
13
|
+
import { developImageRef } from './develop-image-coordinate.mjs';
|
|
14
|
+
import { editionsRoot } from './edition-workspace.mjs';
|
|
15
|
+
import { loadRegistryCredentialDeclarations, splitImageRef } from './registry-credentials.mjs';
|
|
16
|
+
import { isNotPublishedYet } from './seal-image-digests.mjs';
|
|
17
|
+
import { registryClientsFor } from './verify-image-platforms.mjs';
|
|
18
|
+
|
|
19
|
+
const DEFAULT_PROBE_CONCURRENCY = 6;
|
|
20
|
+
|
|
21
|
+
/** One subject's line in the "not built yet" refusal. */
|
|
22
|
+
export function notBuiltYetMessage(subject) {
|
|
23
|
+
return (
|
|
24
|
+
`${subject.repo}@${subject.sourceCommit} develop image ` +
|
|
25
|
+
`${subject.imageRef}:${subject.contentHash} not built yet`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The ONE refusal naming every develop subject whose coordinate is absent. */
|
|
30
|
+
export function notBuiltYetError(distributionId, missingSubjects) {
|
|
31
|
+
return new Error(
|
|
32
|
+
`${missingSubjects.length} develop image(s) of "${distributionId}" are not built yet ` +
|
|
33
|
+
"(the producer's CI is not green or still running):\n " +
|
|
34
|
+
missingSubjects.map(notBuiltYetMessage).join('\n '),
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @param {object} request
|
|
40
|
+
* @param {string} request.distributionId the edition (named in the refusal)
|
|
41
|
+
* @returns {{ observe(subject: object): void, settle(): Promise<void> }}
|
|
42
|
+
* `observe` takes a subject with `repo`, `sourceCommit`, `imageRef` (release ref) and `contentHash`
|
|
43
|
+
* and starts its probe; `settle` waits for all of them and throws when any is absent or unreadable.
|
|
44
|
+
*/
|
|
45
|
+
export function createDevelopImageProbe({
|
|
46
|
+
distributionId,
|
|
47
|
+
distributionsRoot = editionsRoot(),
|
|
48
|
+
env = process.env,
|
|
49
|
+
fetchImpl = globalThis.fetch,
|
|
50
|
+
run = null,
|
|
51
|
+
concurrency = DEFAULT_PROBE_CONCURRENCY,
|
|
52
|
+
progress = null,
|
|
53
|
+
}) {
|
|
54
|
+
const declarations = loadRegistryCredentialDeclarations(distributionsRoot);
|
|
55
|
+
const clients = new Map();
|
|
56
|
+
const outcomes = [];
|
|
57
|
+
const waiting = [];
|
|
58
|
+
let active = 0;
|
|
59
|
+
|
|
60
|
+
function clientFor(subject) {
|
|
61
|
+
const { authority } = splitImageRef(subject.imageRef);
|
|
62
|
+
if (!clients.has(authority)) {
|
|
63
|
+
for (const [key, client] of registryClientsFor([subject], { declarations, env, fetchImpl, run })) {
|
|
64
|
+
clients.set(key, client);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return clients.get(authority);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function probeOne(subject) {
|
|
71
|
+
const startedAt = Date.now();
|
|
72
|
+
const { repository } = splitImageRef(subject.imageRef);
|
|
73
|
+
try {
|
|
74
|
+
await clientFor(subject).getManifestByTag(repository, subject.contentHash);
|
|
75
|
+
progress?.(`[probe] ${subject.kind}:${subject.id} present ${Date.now() - startedAt}ms`);
|
|
76
|
+
return { subject };
|
|
77
|
+
} catch (error) {
|
|
78
|
+
progress?.(`[probe] ${subject.kind}:${subject.id} ${isNotPublishedYet(error) ? 'ABSENT' : 'FAILED'} ${Date.now() - startedAt}ms`);
|
|
79
|
+
return { subject, error };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function next() {
|
|
84
|
+
const start = waiting.shift();
|
|
85
|
+
if (start !== undefined) {start();}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function schedule(subject) {
|
|
89
|
+
return new Promise((resolve) => {
|
|
90
|
+
const start = () => {
|
|
91
|
+
active += 1;
|
|
92
|
+
probeOne(subject).then((outcome) => {
|
|
93
|
+
active -= 1;
|
|
94
|
+
next();
|
|
95
|
+
resolve(outcome);
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
if (active < concurrency) {start();} else {waiting.push(start);}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
observe(subject) {
|
|
104
|
+
const developSubject = { ...subject, imageRef: developImageRef(subject.imageRef) };
|
|
105
|
+
// Credentials resolve here, on the first subject of each registry, so a missing token stops the run now.
|
|
106
|
+
clientFor(developSubject);
|
|
107
|
+
outcomes.push(schedule(developSubject));
|
|
108
|
+
},
|
|
109
|
+
async settle() {
|
|
110
|
+
const settled = await Promise.all(outcomes);
|
|
111
|
+
const aborting = settled.find(({ error }) => error !== undefined && !isNotPublishedYet(error));
|
|
112
|
+
if (aborting) {throw aborting.error;}
|
|
113
|
+
const missing = settled.filter(({ error }) => error !== undefined).map(({ subject }) => subject);
|
|
114
|
+
if (missing.length > 0) {throw notBuiltYetError(distributionId, missing);}
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
package/edition/develop-seal.mjs
CHANGED
|
@@ -12,18 +12,12 @@
|
|
|
12
12
|
// aborts as it does in the release.
|
|
13
13
|
|
|
14
14
|
import { developImageRef } from './develop-image-coordinate.mjs';
|
|
15
|
+
import { notBuiltYetError } from './develop-image-probe.mjs';
|
|
15
16
|
import { editionsRoot } from './edition-workspace.mjs';
|
|
16
17
|
import { validateImmutableImageLock, loadKernelDistributionSchemas, } from './lib.mjs';
|
|
17
18
|
import { isNotPublishedYet, planDigestSeal } from './seal-image-digests.mjs';
|
|
18
19
|
import { verifyDistributionPlatforms } from './verify-image-platforms.mjs';
|
|
19
20
|
|
|
20
|
-
function notBuiltYetMessage(subject) {
|
|
21
|
-
return (
|
|
22
|
-
`${subject.repo}@${subject.sourceCommit} develop image ` +
|
|
23
|
-
`${subject.imageRef}:${subject.contentHash} not built yet`
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
21
|
/**
|
|
28
22
|
* The row-level seal: every subject re-homed to its develop repository, verified
|
|
29
23
|
* there for its required platforms, and given the digest the registry served.
|
|
@@ -42,6 +36,7 @@ export async function sealDevelopImageSubjects({
|
|
|
42
36
|
env = process.env,
|
|
43
37
|
fetchImpl = globalThis.fetch,
|
|
44
38
|
run = null,
|
|
39
|
+
progress = null,
|
|
45
40
|
}) {
|
|
46
41
|
const developSubjects = subjects.map((subject) => ({
|
|
47
42
|
...subject,
|
|
@@ -54,15 +49,12 @@ export async function sealDevelopImageSubjects({
|
|
|
54
49
|
fetchImpl,
|
|
55
50
|
run,
|
|
56
51
|
collectFailures: true,
|
|
52
|
+
progress,
|
|
57
53
|
});
|
|
58
54
|
const aborting = report.failures.find(({ error }) => !isNotPublishedYet(error));
|
|
59
55
|
if (aborting) {throw aborting.error;}
|
|
60
56
|
if (report.failures.length > 0) {
|
|
61
|
-
throw
|
|
62
|
-
`${report.failures.length} develop image(s) of "${distributionId}" are not built yet ` +
|
|
63
|
-
'(the producer\'s CI is not green or still running):\n ' +
|
|
64
|
-
report.failures.map(({ subject }) => notBuiltYetMessage(subject)).join('\n '),
|
|
65
|
-
);
|
|
57
|
+
throw notBuiltYetError(distributionId, report.failures.map(({ subject }) => subject));
|
|
66
58
|
}
|
|
67
59
|
const { writes, unchanged } = planDigestSeal({ subjects: developSubjects, verified: report.subjects });
|
|
68
60
|
const digests = new Map([...writes, ...unchanged].map(({ key, digest }) => [key, digest]));
|