@opensoftware/contracts 1.6.0 → 1.7.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 +5 -2
- package/dist/formats.js +2 -0
- package/dist/formats.js.map +1 -1
- package/dist/generated/types.d.ts +542 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js.map +1 -1
- package/events/asyncapi.yaml +42 -0
- package/events/issue-labeled/issue-labeled.schema.json +128 -0
- package/events/run-started/run-started.schema.json +139 -0
- package/openapi/openapi.json +789 -2
- package/package.json +2 -2
- package/typespec/events.tsp +47 -0
- package/typespec/foreman-api.tsp +45 -0
- package/typespec/foreman.tsp +84 -0
- package/typespec/intake-api.tsp +40 -0
- package/typespec/intake.tsp +52 -0
- package/typespec/main.tsp +4 -0
package/openapi/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Open Software Factory contracts",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.7.0",
|
|
6
6
|
"description": "The shared formats as named models, and the HTTP APIs of the modules. Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
|
|
7
7
|
"license": {
|
|
8
8
|
"name": "Apache-2.0",
|
|
@@ -116,6 +116,355 @@
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
+
},
|
|
120
|
+
"/v1/runs": {
|
|
121
|
+
"post": {
|
|
122
|
+
"operationId": "ForemanApi_startRun",
|
|
123
|
+
"description": "Start a run of the factory's workflow for a work item. The same work item again answers the run it started.",
|
|
124
|
+
"parameters": [],
|
|
125
|
+
"responses": {
|
|
126
|
+
"200": {
|
|
127
|
+
"description": "The request has succeeded.",
|
|
128
|
+
"content": {
|
|
129
|
+
"application/json": {
|
|
130
|
+
"schema": {
|
|
131
|
+
"$ref": "#/components/schemas/RunView"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"201": {
|
|
137
|
+
"description": "The request has succeeded and a new resource has been created as a result.",
|
|
138
|
+
"content": {
|
|
139
|
+
"application/json": {
|
|
140
|
+
"schema": {
|
|
141
|
+
"$ref": "#/components/schemas/RunView"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"400": {
|
|
147
|
+
"description": "The server could not understand the request due to invalid syntax.",
|
|
148
|
+
"content": {
|
|
149
|
+
"application/problem+json": {
|
|
150
|
+
"schema": {
|
|
151
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"401": {
|
|
157
|
+
"description": "Access is unauthorized.",
|
|
158
|
+
"content": {
|
|
159
|
+
"application/problem+json": {
|
|
160
|
+
"schema": {
|
|
161
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"requestBody": {
|
|
168
|
+
"required": true,
|
|
169
|
+
"content": {
|
|
170
|
+
"application/json": {
|
|
171
|
+
"schema": {
|
|
172
|
+
"$ref": "#/components/schemas/WorkItem"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"/v1/runs/{runId}": {
|
|
180
|
+
"get": {
|
|
181
|
+
"operationId": "ForemanApi_getRun",
|
|
182
|
+
"description": "A run: its state and the state of each stage.",
|
|
183
|
+
"parameters": [
|
|
184
|
+
{
|
|
185
|
+
"name": "runId",
|
|
186
|
+
"in": "path",
|
|
187
|
+
"required": true,
|
|
188
|
+
"schema": {
|
|
189
|
+
"type": "string"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"responses": {
|
|
194
|
+
"200": {
|
|
195
|
+
"description": "The request has succeeded.",
|
|
196
|
+
"content": {
|
|
197
|
+
"application/json": {
|
|
198
|
+
"schema": {
|
|
199
|
+
"$ref": "#/components/schemas/RunView"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"401": {
|
|
205
|
+
"description": "Access is unauthorized.",
|
|
206
|
+
"content": {
|
|
207
|
+
"application/problem+json": {
|
|
208
|
+
"schema": {
|
|
209
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"404": {
|
|
215
|
+
"description": "The server cannot find the requested resource.",
|
|
216
|
+
"content": {
|
|
217
|
+
"application/problem+json": {
|
|
218
|
+
"schema": {
|
|
219
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"/v1/runs/{runId}/signals": {
|
|
228
|
+
"post": {
|
|
229
|
+
"operationId": "ForemanApi_signalRun",
|
|
230
|
+
"description": "Steer the running stage's agent, or cancel the run.",
|
|
231
|
+
"parameters": [
|
|
232
|
+
{
|
|
233
|
+
"name": "runId",
|
|
234
|
+
"in": "path",
|
|
235
|
+
"required": true,
|
|
236
|
+
"schema": {
|
|
237
|
+
"type": "string"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"responses": {
|
|
242
|
+
"202": {
|
|
243
|
+
"description": "The request has been accepted for processing, but processing has not yet completed.",
|
|
244
|
+
"content": {
|
|
245
|
+
"application/json": {
|
|
246
|
+
"schema": {
|
|
247
|
+
"$ref": "#/components/schemas/RunView"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"400": {
|
|
253
|
+
"description": "The server could not understand the request due to invalid syntax.",
|
|
254
|
+
"content": {
|
|
255
|
+
"application/problem+json": {
|
|
256
|
+
"schema": {
|
|
257
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"401": {
|
|
263
|
+
"description": "Access is unauthorized.",
|
|
264
|
+
"content": {
|
|
265
|
+
"application/problem+json": {
|
|
266
|
+
"schema": {
|
|
267
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"404": {
|
|
273
|
+
"description": "The server cannot find the requested resource.",
|
|
274
|
+
"content": {
|
|
275
|
+
"application/problem+json": {
|
|
276
|
+
"schema": {
|
|
277
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"409": {
|
|
283
|
+
"description": "The request conflicts with the current state of the server.",
|
|
284
|
+
"content": {
|
|
285
|
+
"application/problem+json": {
|
|
286
|
+
"schema": {
|
|
287
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
"requestBody": {
|
|
294
|
+
"required": true,
|
|
295
|
+
"content": {
|
|
296
|
+
"application/json": {
|
|
297
|
+
"schema": {
|
|
298
|
+
"$ref": "#/components/schemas/RunSignal"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"/v1/work-items": {
|
|
306
|
+
"post": {
|
|
307
|
+
"operationId": "IntakeApi_submitWork",
|
|
308
|
+
"description": "Put work into the inbox. A submission with the dedupe key of a work item answers that work item.",
|
|
309
|
+
"parameters": [],
|
|
310
|
+
"responses": {
|
|
311
|
+
"200": {
|
|
312
|
+
"description": "The request has succeeded.",
|
|
313
|
+
"content": {
|
|
314
|
+
"application/json": {
|
|
315
|
+
"schema": {
|
|
316
|
+
"$ref": "#/components/schemas/WorkItemView"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"201": {
|
|
322
|
+
"description": "The request has succeeded and a new resource has been created as a result.",
|
|
323
|
+
"content": {
|
|
324
|
+
"application/json": {
|
|
325
|
+
"schema": {
|
|
326
|
+
"$ref": "#/components/schemas/WorkItemView"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
"400": {
|
|
332
|
+
"description": "The server could not understand the request due to invalid syntax.",
|
|
333
|
+
"content": {
|
|
334
|
+
"application/problem+json": {
|
|
335
|
+
"schema": {
|
|
336
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"401": {
|
|
342
|
+
"description": "Access is unauthorized.",
|
|
343
|
+
"content": {
|
|
344
|
+
"application/problem+json": {
|
|
345
|
+
"schema": {
|
|
346
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
"requestBody": {
|
|
353
|
+
"required": true,
|
|
354
|
+
"content": {
|
|
355
|
+
"application/json": {
|
|
356
|
+
"schema": {
|
|
357
|
+
"$ref": "#/components/schemas/WorkSubmission"
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"get": {
|
|
364
|
+
"operationId": "IntakeApi_findWorkItem",
|
|
365
|
+
"description": "The work item with this dedupe key, such as an issue's link (ADR 0065).",
|
|
366
|
+
"parameters": [
|
|
367
|
+
{
|
|
368
|
+
"name": "dedupeKey",
|
|
369
|
+
"in": "query",
|
|
370
|
+
"required": true,
|
|
371
|
+
"schema": {
|
|
372
|
+
"type": "string"
|
|
373
|
+
},
|
|
374
|
+
"explode": false
|
|
375
|
+
}
|
|
376
|
+
],
|
|
377
|
+
"responses": {
|
|
378
|
+
"200": {
|
|
379
|
+
"description": "The request has succeeded.",
|
|
380
|
+
"content": {
|
|
381
|
+
"application/json": {
|
|
382
|
+
"schema": {
|
|
383
|
+
"$ref": "#/components/schemas/WorkItemView"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"400": {
|
|
389
|
+
"description": "The server could not understand the request due to invalid syntax.",
|
|
390
|
+
"content": {
|
|
391
|
+
"application/problem+json": {
|
|
392
|
+
"schema": {
|
|
393
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"401": {
|
|
399
|
+
"description": "Access is unauthorized.",
|
|
400
|
+
"content": {
|
|
401
|
+
"application/problem+json": {
|
|
402
|
+
"schema": {
|
|
403
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
"404": {
|
|
409
|
+
"description": "The server cannot find the requested resource.",
|
|
410
|
+
"content": {
|
|
411
|
+
"application/problem+json": {
|
|
412
|
+
"schema": {
|
|
413
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
"/v1/work-items/{workItemId}": {
|
|
422
|
+
"get": {
|
|
423
|
+
"operationId": "IntakeApi_getWorkItem",
|
|
424
|
+
"description": "A work item, its status and every request that asked for it.",
|
|
425
|
+
"parameters": [
|
|
426
|
+
{
|
|
427
|
+
"name": "workItemId",
|
|
428
|
+
"in": "path",
|
|
429
|
+
"required": true,
|
|
430
|
+
"schema": {
|
|
431
|
+
"type": "string"
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
],
|
|
435
|
+
"responses": {
|
|
436
|
+
"200": {
|
|
437
|
+
"description": "The request has succeeded.",
|
|
438
|
+
"content": {
|
|
439
|
+
"application/json": {
|
|
440
|
+
"schema": {
|
|
441
|
+
"$ref": "#/components/schemas/WorkItemView"
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
"401": {
|
|
447
|
+
"description": "Access is unauthorized.",
|
|
448
|
+
"content": {
|
|
449
|
+
"application/problem+json": {
|
|
450
|
+
"schema": {
|
|
451
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
"404": {
|
|
457
|
+
"description": "The server cannot find the requested resource.",
|
|
458
|
+
"content": {
|
|
459
|
+
"application/problem+json": {
|
|
460
|
+
"schema": {
|
|
461
|
+
"$ref": "#/components/schemas/ApiProblem"
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
119
468
|
}
|
|
120
469
|
},
|
|
121
470
|
"security": [
|
|
@@ -952,6 +1301,108 @@
|
|
|
952
1301
|
"maxLength": 128,
|
|
953
1302
|
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
954
1303
|
},
|
|
1304
|
+
"IssueLabeled": {
|
|
1305
|
+
"type": "object",
|
|
1306
|
+
"properties": {
|
|
1307
|
+
"specversion": {
|
|
1308
|
+
"type": "string",
|
|
1309
|
+
"const": "1.0"
|
|
1310
|
+
},
|
|
1311
|
+
"id": {
|
|
1312
|
+
"$ref": "#/components/schemas/Identifier",
|
|
1313
|
+
"description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
|
|
1314
|
+
},
|
|
1315
|
+
"source": {
|
|
1316
|
+
"type": "string",
|
|
1317
|
+
"minLength": 1,
|
|
1318
|
+
"description": "The producing module, for example \"/osf/intake\"."
|
|
1319
|
+
},
|
|
1320
|
+
"type": {
|
|
1321
|
+
"type": "string",
|
|
1322
|
+
"const": "issue.labeled@v1"
|
|
1323
|
+
},
|
|
1324
|
+
"time": {
|
|
1325
|
+
"type": "string",
|
|
1326
|
+
"format": "date-time"
|
|
1327
|
+
},
|
|
1328
|
+
"subject": {
|
|
1329
|
+
"type": "string",
|
|
1330
|
+
"description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
|
|
1331
|
+
},
|
|
1332
|
+
"datacontenttype": {
|
|
1333
|
+
"type": "string",
|
|
1334
|
+
"const": "application/json"
|
|
1335
|
+
},
|
|
1336
|
+
"dataschema": {
|
|
1337
|
+
"type": "string",
|
|
1338
|
+
"format": "uri"
|
|
1339
|
+
},
|
|
1340
|
+
"traceparent": {
|
|
1341
|
+
"type": "string",
|
|
1342
|
+
"description": "W3C trace context (CloudEvents distributed tracing extension)."
|
|
1343
|
+
},
|
|
1344
|
+
"data": {
|
|
1345
|
+
"$ref": "#/components/schemas/IssueLabeledData"
|
|
1346
|
+
}
|
|
1347
|
+
},
|
|
1348
|
+
"required": [
|
|
1349
|
+
"specversion",
|
|
1350
|
+
"id",
|
|
1351
|
+
"source",
|
|
1352
|
+
"type",
|
|
1353
|
+
"time",
|
|
1354
|
+
"data"
|
|
1355
|
+
],
|
|
1356
|
+
"description": "forge adapters: a label was added to an issue."
|
|
1357
|
+
},
|
|
1358
|
+
"IssueLabeledData": {
|
|
1359
|
+
"type": "object",
|
|
1360
|
+
"properties": {
|
|
1361
|
+
"url": {
|
|
1362
|
+
"type": "string",
|
|
1363
|
+
"format": "uri",
|
|
1364
|
+
"description": "The issue."
|
|
1365
|
+
},
|
|
1366
|
+
"repository": {
|
|
1367
|
+
"type": "string",
|
|
1368
|
+
"format": "uri"
|
|
1369
|
+
},
|
|
1370
|
+
"number": {
|
|
1371
|
+
"type": "integer",
|
|
1372
|
+
"minimum": 1
|
|
1373
|
+
},
|
|
1374
|
+
"title": {
|
|
1375
|
+
"type": "string",
|
|
1376
|
+
"minLength": 1
|
|
1377
|
+
},
|
|
1378
|
+
"body": {
|
|
1379
|
+
"type": "string"
|
|
1380
|
+
},
|
|
1381
|
+
"author": {
|
|
1382
|
+
"$ref": "#/components/schemas/Actor",
|
|
1383
|
+
"description": "The person who opened the issue."
|
|
1384
|
+
},
|
|
1385
|
+
"labels": {
|
|
1386
|
+
"type": "array",
|
|
1387
|
+
"items": {
|
|
1388
|
+
"type": "string"
|
|
1389
|
+
},
|
|
1390
|
+
"description": "Every label of the issue after the change."
|
|
1391
|
+
},
|
|
1392
|
+
"label": {
|
|
1393
|
+
"type": "string",
|
|
1394
|
+
"description": "The label that was added, when the forge names it."
|
|
1395
|
+
}
|
|
1396
|
+
},
|
|
1397
|
+
"required": [
|
|
1398
|
+
"url",
|
|
1399
|
+
"repository",
|
|
1400
|
+
"number",
|
|
1401
|
+
"title",
|
|
1402
|
+
"author",
|
|
1403
|
+
"labels"
|
|
1404
|
+
]
|
|
1405
|
+
},
|
|
955
1406
|
"Link": {
|
|
956
1407
|
"type": "object",
|
|
957
1408
|
"properties": {
|
|
@@ -1570,7 +2021,32 @@
|
|
|
1570
2021
|
"osf.source",
|
|
1571
2022
|
"osf.harness.name"
|
|
1572
2023
|
],
|
|
1573
|
-
"description": "Set at launch through OTEL_RESOURCE_ATTRIBUTES, so it is on every span of the run."
|
|
2024
|
+
"description": "Set at launch through OTEL_RESOURCE_ATTRIBUTES, so it is on every span of the run."
|
|
2025
|
+
},
|
|
2026
|
+
"RunSignal": {
|
|
2027
|
+
"type": "object",
|
|
2028
|
+
"properties": {
|
|
2029
|
+
"type": {
|
|
2030
|
+
"$ref": "#/components/schemas/RunSignalType"
|
|
2031
|
+
},
|
|
2032
|
+
"message": {
|
|
2033
|
+
"type": "string",
|
|
2034
|
+
"minLength": 1,
|
|
2035
|
+
"description": "The steering message. Required with \"steer\"."
|
|
2036
|
+
}
|
|
2037
|
+
},
|
|
2038
|
+
"required": [
|
|
2039
|
+
"type"
|
|
2040
|
+
],
|
|
2041
|
+
"description": "foreman: a signal to a run: \"steer\" with a message for the running stage's agent, or \"cancel\"."
|
|
2042
|
+
},
|
|
2043
|
+
"RunSignalType": {
|
|
2044
|
+
"type": "string",
|
|
2045
|
+
"enum": [
|
|
2046
|
+
"steer",
|
|
2047
|
+
"cancel"
|
|
2048
|
+
],
|
|
2049
|
+
"description": "foreman: what a person tells a run."
|
|
1574
2050
|
},
|
|
1575
2051
|
"RunSpan": {
|
|
1576
2052
|
"type": "object",
|
|
@@ -1662,6 +2138,165 @@
|
|
|
1662
2138
|
],
|
|
1663
2139
|
"description": "Attributes of the root span of the run. GenAI names where a convention exists."
|
|
1664
2140
|
},
|
|
2141
|
+
"RunStarted": {
|
|
2142
|
+
"type": "object",
|
|
2143
|
+
"properties": {
|
|
2144
|
+
"specversion": {
|
|
2145
|
+
"type": "string",
|
|
2146
|
+
"const": "1.0"
|
|
2147
|
+
},
|
|
2148
|
+
"id": {
|
|
2149
|
+
"$ref": "#/components/schemas/Identifier",
|
|
2150
|
+
"description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
|
|
2151
|
+
},
|
|
2152
|
+
"source": {
|
|
2153
|
+
"type": "string",
|
|
2154
|
+
"minLength": 1,
|
|
2155
|
+
"description": "The producing module, for example \"/osf/intake\"."
|
|
2156
|
+
},
|
|
2157
|
+
"type": {
|
|
2158
|
+
"type": "string",
|
|
2159
|
+
"const": "run.started@v1"
|
|
2160
|
+
},
|
|
2161
|
+
"time": {
|
|
2162
|
+
"type": "string",
|
|
2163
|
+
"format": "date-time"
|
|
2164
|
+
},
|
|
2165
|
+
"subject": {
|
|
2166
|
+
"type": "string",
|
|
2167
|
+
"description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
|
|
2168
|
+
},
|
|
2169
|
+
"datacontenttype": {
|
|
2170
|
+
"type": "string",
|
|
2171
|
+
"const": "application/json"
|
|
2172
|
+
},
|
|
2173
|
+
"dataschema": {
|
|
2174
|
+
"type": "string",
|
|
2175
|
+
"format": "uri"
|
|
2176
|
+
},
|
|
2177
|
+
"traceparent": {
|
|
2178
|
+
"type": "string",
|
|
2179
|
+
"description": "W3C trace context (CloudEvents distributed tracing extension)."
|
|
2180
|
+
},
|
|
2181
|
+
"data": {
|
|
2182
|
+
"$ref": "#/components/schemas/RunStartedData"
|
|
2183
|
+
}
|
|
2184
|
+
},
|
|
2185
|
+
"required": [
|
|
2186
|
+
"specversion",
|
|
2187
|
+
"id",
|
|
2188
|
+
"source",
|
|
2189
|
+
"type",
|
|
2190
|
+
"time",
|
|
2191
|
+
"data"
|
|
2192
|
+
],
|
|
2193
|
+
"description": "foreman: a run started (ADR 0067)."
|
|
2194
|
+
},
|
|
2195
|
+
"RunStartedData": {
|
|
2196
|
+
"type": "object",
|
|
2197
|
+
"properties": {
|
|
2198
|
+
"runId": {
|
|
2199
|
+
"$ref": "#/components/schemas/Identifier"
|
|
2200
|
+
},
|
|
2201
|
+
"workItemId": {
|
|
2202
|
+
"$ref": "#/components/schemas/Identifier"
|
|
2203
|
+
},
|
|
2204
|
+
"factory": {
|
|
2205
|
+
"$ref": "#/components/schemas/Name",
|
|
2206
|
+
"description": "The name of the factory."
|
|
2207
|
+
},
|
|
2208
|
+
"factoryVersion": {
|
|
2209
|
+
"$ref": "#/components/schemas/CommitHash"
|
|
2210
|
+
},
|
|
2211
|
+
"stages": {
|
|
2212
|
+
"type": "array",
|
|
2213
|
+
"items": {
|
|
2214
|
+
"$ref": "#/components/schemas/Name"
|
|
2215
|
+
},
|
|
2216
|
+
"description": "The stages of the run's workflow, in order."
|
|
2217
|
+
},
|
|
2218
|
+
"startedAt": {
|
|
2219
|
+
"type": "string",
|
|
2220
|
+
"format": "date-time"
|
|
2221
|
+
},
|
|
2222
|
+
"requester": {
|
|
2223
|
+
"$ref": "#/components/schemas/Actor"
|
|
2224
|
+
},
|
|
2225
|
+
"source": {
|
|
2226
|
+
"$ref": "#/components/schemas/Name"
|
|
2227
|
+
}
|
|
2228
|
+
},
|
|
2229
|
+
"required": [
|
|
2230
|
+
"runId",
|
|
2231
|
+
"workItemId",
|
|
2232
|
+
"factory",
|
|
2233
|
+
"factoryVersion",
|
|
2234
|
+
"stages",
|
|
2235
|
+
"startedAt",
|
|
2236
|
+
"requester",
|
|
2237
|
+
"source"
|
|
2238
|
+
]
|
|
2239
|
+
},
|
|
2240
|
+
"RunState": {
|
|
2241
|
+
"type": "string",
|
|
2242
|
+
"enum": [
|
|
2243
|
+
"running",
|
|
2244
|
+
"blocked",
|
|
2245
|
+
"complete",
|
|
2246
|
+
"failed",
|
|
2247
|
+
"cancelled"
|
|
2248
|
+
],
|
|
2249
|
+
"description": "foreman: where a run stands (vision scenario ORCH-008)."
|
|
2250
|
+
},
|
|
2251
|
+
"RunView": {
|
|
2252
|
+
"type": "object",
|
|
2253
|
+
"properties": {
|
|
2254
|
+
"runId": {
|
|
2255
|
+
"type": "string",
|
|
2256
|
+
"pattern": "^run_[0-9a-f]{20}$",
|
|
2257
|
+
"description": "\"run_\" and 20 hex digits of the SHA-256 of the work item's ID."
|
|
2258
|
+
},
|
|
2259
|
+
"workItem": {
|
|
2260
|
+
"$ref": "#/components/schemas/WorkItem"
|
|
2261
|
+
},
|
|
2262
|
+
"factory": {
|
|
2263
|
+
"$ref": "#/components/schemas/Name",
|
|
2264
|
+
"description": "The name of the factory."
|
|
2265
|
+
},
|
|
2266
|
+
"factoryVersion": {
|
|
2267
|
+
"$ref": "#/components/schemas/CommitHash",
|
|
2268
|
+
"description": "The commit of the factory definition the run started with."
|
|
2269
|
+
},
|
|
2270
|
+
"state": {
|
|
2271
|
+
"$ref": "#/components/schemas/RunState"
|
|
2272
|
+
},
|
|
2273
|
+
"startedAt": {
|
|
2274
|
+
"type": "string",
|
|
2275
|
+
"format": "date-time"
|
|
2276
|
+
},
|
|
2277
|
+
"endedAt": {
|
|
2278
|
+
"type": "string",
|
|
2279
|
+
"format": "date-time"
|
|
2280
|
+
},
|
|
2281
|
+
"stages": {
|
|
2282
|
+
"type": "array",
|
|
2283
|
+
"items": {
|
|
2284
|
+
"$ref": "#/components/schemas/StageView"
|
|
2285
|
+
},
|
|
2286
|
+
"description": "The stages of the workflow, in order."
|
|
2287
|
+
}
|
|
2288
|
+
},
|
|
2289
|
+
"required": [
|
|
2290
|
+
"runId",
|
|
2291
|
+
"workItem",
|
|
2292
|
+
"factory",
|
|
2293
|
+
"factoryVersion",
|
|
2294
|
+
"state",
|
|
2295
|
+
"startedAt",
|
|
2296
|
+
"stages"
|
|
2297
|
+
],
|
|
2298
|
+
"description": "foreman: a run of the factory's workflow for one work item, as the HTTP API shows it (ADR 0067)."
|
|
2299
|
+
},
|
|
1665
2300
|
"Sandbox": {
|
|
1666
2301
|
"type": "object",
|
|
1667
2302
|
"properties": {
|
|
@@ -2031,6 +2666,57 @@
|
|
|
2031
2666
|
],
|
|
2032
2667
|
"additionalProperties": false
|
|
2033
2668
|
},
|
|
2669
|
+
"StageState": {
|
|
2670
|
+
"type": "string",
|
|
2671
|
+
"enum": [
|
|
2672
|
+
"pending",
|
|
2673
|
+
"blocked",
|
|
2674
|
+
"running",
|
|
2675
|
+
"succeeded",
|
|
2676
|
+
"failed",
|
|
2677
|
+
"rejected",
|
|
2678
|
+
"cancelled"
|
|
2679
|
+
],
|
|
2680
|
+
"description": "foreman: where a stage of a run stands."
|
|
2681
|
+
},
|
|
2682
|
+
"StageView": {
|
|
2683
|
+
"type": "object",
|
|
2684
|
+
"properties": {
|
|
2685
|
+
"stage": {
|
|
2686
|
+
"$ref": "#/components/schemas/Name"
|
|
2687
|
+
},
|
|
2688
|
+
"agent": {
|
|
2689
|
+
"$ref": "#/components/schemas/Name",
|
|
2690
|
+
"description": "The agent that runs the stage."
|
|
2691
|
+
},
|
|
2692
|
+
"state": {
|
|
2693
|
+
"$ref": "#/components/schemas/StageState"
|
|
2694
|
+
},
|
|
2695
|
+
"sessionId": {
|
|
2696
|
+
"type": "string",
|
|
2697
|
+
"description": "The harness session of the stage's agent, once it started."
|
|
2698
|
+
},
|
|
2699
|
+
"gateId": {
|
|
2700
|
+
"type": "string",
|
|
2701
|
+
"pattern": "^g[0-9a-f]{16}$",
|
|
2702
|
+
"description": "The gate that decides whether the stage starts, once it was requested."
|
|
2703
|
+
},
|
|
2704
|
+
"startedAt": {
|
|
2705
|
+
"type": "string",
|
|
2706
|
+
"format": "date-time"
|
|
2707
|
+
},
|
|
2708
|
+
"endedAt": {
|
|
2709
|
+
"type": "string",
|
|
2710
|
+
"format": "date-time"
|
|
2711
|
+
}
|
|
2712
|
+
},
|
|
2713
|
+
"required": [
|
|
2714
|
+
"stage",
|
|
2715
|
+
"agent",
|
|
2716
|
+
"state"
|
|
2717
|
+
],
|
|
2718
|
+
"description": "foreman: one stage of a run (ADR 0067)."
|
|
2719
|
+
},
|
|
2034
2720
|
"TraceId": {
|
|
2035
2721
|
"type": "string",
|
|
2036
2722
|
"pattern": "^[0-9a-f]{32}$",
|
|
@@ -2104,6 +2790,13 @@
|
|
|
2104
2790
|
],
|
|
2105
2791
|
"description": "One unit of requested work: the `data` of a `work.received@v1` CloudEvent."
|
|
2106
2792
|
},
|
|
2793
|
+
"WorkItemStatus": {
|
|
2794
|
+
"type": "string",
|
|
2795
|
+
"enum": [
|
|
2796
|
+
"received"
|
|
2797
|
+
],
|
|
2798
|
+
"description": "Where a work item stands."
|
|
2799
|
+
},
|
|
2107
2800
|
"WorkItemType": {
|
|
2108
2801
|
"type": "string",
|
|
2109
2802
|
"enum": [
|
|
@@ -2113,6 +2806,36 @@
|
|
|
2113
2806
|
"automation"
|
|
2114
2807
|
]
|
|
2115
2808
|
},
|
|
2809
|
+
"WorkItemView": {
|
|
2810
|
+
"type": "object",
|
|
2811
|
+
"properties": {
|
|
2812
|
+
"workItem": {
|
|
2813
|
+
"$ref": "#/components/schemas/WorkItem",
|
|
2814
|
+
"description": "Its ID is \"wi_\" and 20 hex digits of the SHA-256 of its dedupe key."
|
|
2815
|
+
},
|
|
2816
|
+
"status": {
|
|
2817
|
+
"$ref": "#/components/schemas/WorkItemStatus"
|
|
2818
|
+
},
|
|
2819
|
+
"receivedAt": {
|
|
2820
|
+
"type": "string",
|
|
2821
|
+
"format": "date-time"
|
|
2822
|
+
},
|
|
2823
|
+
"requests": {
|
|
2824
|
+
"type": "array",
|
|
2825
|
+
"items": {
|
|
2826
|
+
"$ref": "#/components/schemas/WorkRequest"
|
|
2827
|
+
},
|
|
2828
|
+
"description": "Every submission that asked for the work item, oldest first; one per origin."
|
|
2829
|
+
}
|
|
2830
|
+
},
|
|
2831
|
+
"required": [
|
|
2832
|
+
"workItem",
|
|
2833
|
+
"status",
|
|
2834
|
+
"receivedAt",
|
|
2835
|
+
"requests"
|
|
2836
|
+
],
|
|
2837
|
+
"description": "intake: a work item as the HTTP API shows it (ADR 0063)."
|
|
2838
|
+
},
|
|
2116
2839
|
"WorkReceived": {
|
|
2117
2840
|
"type": "object",
|
|
2118
2841
|
"properties": {
|
|
@@ -2166,6 +2889,70 @@
|
|
|
2166
2889
|
"data"
|
|
2167
2890
|
],
|
|
2168
2891
|
"description": "intake: a work item was accepted."
|
|
2892
|
+
},
|
|
2893
|
+
"WorkRequest": {
|
|
2894
|
+
"type": "object",
|
|
2895
|
+
"properties": {
|
|
2896
|
+
"requester": {
|
|
2897
|
+
"$ref": "#/components/schemas/Actor"
|
|
2898
|
+
},
|
|
2899
|
+
"origin": {
|
|
2900
|
+
"$ref": "#/components/schemas/Origin"
|
|
2901
|
+
},
|
|
2902
|
+
"receivedAt": {
|
|
2903
|
+
"type": "string",
|
|
2904
|
+
"format": "date-time"
|
|
2905
|
+
}
|
|
2906
|
+
},
|
|
2907
|
+
"required": [
|
|
2908
|
+
"requester",
|
|
2909
|
+
"origin",
|
|
2910
|
+
"receivedAt"
|
|
2911
|
+
],
|
|
2912
|
+
"description": "intake: one submission that asked for a work item."
|
|
2913
|
+
},
|
|
2914
|
+
"WorkSubmission": {
|
|
2915
|
+
"type": "object",
|
|
2916
|
+
"properties": {
|
|
2917
|
+
"type": {
|
|
2918
|
+
"$ref": "#/components/schemas/WorkItemType",
|
|
2919
|
+
"description": "Default: task."
|
|
2920
|
+
},
|
|
2921
|
+
"title": {
|
|
2922
|
+
"type": "string",
|
|
2923
|
+
"minLength": 1,
|
|
2924
|
+
"maxLength": 300
|
|
2925
|
+
},
|
|
2926
|
+
"description": {
|
|
2927
|
+
"type": "string"
|
|
2928
|
+
},
|
|
2929
|
+
"requester": {
|
|
2930
|
+
"$ref": "#/components/schemas/Actor"
|
|
2931
|
+
},
|
|
2932
|
+
"origin": {
|
|
2933
|
+
"$ref": "#/components/schemas/Origin"
|
|
2934
|
+
},
|
|
2935
|
+
"dedupeKey": {
|
|
2936
|
+
"type": "string",
|
|
2937
|
+
"minLength": 1,
|
|
2938
|
+
"description": "Requests with the same key become one work item. Default: the origin's url, else \"<source>:<externalId>\"."
|
|
2939
|
+
},
|
|
2940
|
+
"surface": {
|
|
2941
|
+
"type": "string"
|
|
2942
|
+
},
|
|
2943
|
+
"links": {
|
|
2944
|
+
"type": "array",
|
|
2945
|
+
"items": {
|
|
2946
|
+
"$ref": "#/components/schemas/Link"
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
},
|
|
2950
|
+
"required": [
|
|
2951
|
+
"title",
|
|
2952
|
+
"requester",
|
|
2953
|
+
"origin"
|
|
2954
|
+
],
|
|
2955
|
+
"description": "intake: work to put into the inbox, a work item without its ID (ADR 0063)."
|
|
2169
2956
|
}
|
|
2170
2957
|
},
|
|
2171
2958
|
"securitySchemes": {
|