@opensoftware/contracts 0.0.0-stage → 1.4.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/LICENSE +202 -0
- package/README.md +112 -2
- package/dist/breaking.d.ts +27 -0
- package/dist/breaking.js +157 -0
- package/dist/breaking.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +69 -0
- package/dist/cli.js.map +1 -0
- package/dist/formats.d.ts +10 -0
- package/dist/formats.js +21 -0
- package/dist/formats.js.map +1 -0
- package/dist/generated/types.d.ts +636 -0
- package/dist/generated/types.js +2 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/dist/roundtrip.d.ts +3 -0
- package/dist/roundtrip.js +90 -0
- package/dist/roundtrip.js.map +1 -0
- package/dist/run-record.d.ts +18 -0
- package/dist/run-record.js +27 -0
- package/dist/run-record.js.map +1 -0
- package/events/asyncapi.yaml +186 -0
- package/events/gate-decided/gate-decided.schema.json +122 -0
- package/events/gate-requested/gate-requested.schema.json +135 -0
- package/events/pr-closed/pr-closed.schema.json +80 -0
- package/events/pr-opened/pr-opened.schema.json +138 -0
- package/events/pr-reviewed/pr-reviewed.schema.json +111 -0
- package/events/run-completed/run-completed.schema.json +163 -0
- package/events/score-recorded/score-recorded.schema.json +163 -0
- package/events/work-received/work-received.schema.json +182 -0
- package/evidence-bundle/evidence-bundle.schema.json +180 -0
- package/factory-definition/factory-definition.schema.json +371 -0
- package/openapi/openapi.json +1715 -0
- package/package.json +50 -3
- package/run-record/run-record.schema.json +179 -0
- package/score/score.schema.json +110 -0
- package/typespec/common.tsp +62 -0
- package/typespec/events.tsp +168 -0
- package/typespec/evidence-bundle.tsp +99 -0
- package/typespec/factory-definition.tsp +193 -0
- package/typespec/main.tsp +10 -0
- package/typespec/run-record.tsp +88 -0
- package/typespec/score.tsp +68 -0
- package/typespec/work-item.tsp +65 -0
- package/work-item/work-item.schema.json +129 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/sesigl/open-software-factory/main/contracts/events/gate-requested/gate-requested.schema.json",
|
|
4
|
+
"title": "GateRequested",
|
|
5
|
+
"$comment": "Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"specversion": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "1.0"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"maxLength": 128,
|
|
16
|
+
"description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
|
|
17
|
+
},
|
|
18
|
+
"source": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"description": "The producing module, for example \"/osf/intake\"."
|
|
22
|
+
},
|
|
23
|
+
"type": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"const": "gate.requested@v1"
|
|
26
|
+
},
|
|
27
|
+
"time": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"format": "date-time"
|
|
30
|
+
},
|
|
31
|
+
"subject": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
|
|
34
|
+
},
|
|
35
|
+
"datacontenttype": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"const": "application/json"
|
|
38
|
+
},
|
|
39
|
+
"dataschema": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"format": "uri"
|
|
42
|
+
},
|
|
43
|
+
"traceparent": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "W3C trace context (CloudEvents distributed tracing extension)."
|
|
46
|
+
},
|
|
47
|
+
"data": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"gateId": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"minLength": 1,
|
|
53
|
+
"maxLength": 128,
|
|
54
|
+
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
55
|
+
},
|
|
56
|
+
"workItemId": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"minLength": 1,
|
|
59
|
+
"maxLength": 128,
|
|
60
|
+
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
61
|
+
},
|
|
62
|
+
"runId": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"minLength": 1,
|
|
65
|
+
"maxLength": 128,
|
|
66
|
+
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
67
|
+
},
|
|
68
|
+
"stage": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"pattern": "^[a-z][a-z0-9-]{0,62}$",
|
|
71
|
+
"description": "The stage that waits."
|
|
72
|
+
},
|
|
73
|
+
"policy": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"minLength": 1,
|
|
76
|
+
"description": "Path to the policy in the factory definition."
|
|
77
|
+
},
|
|
78
|
+
"approvers": {
|
|
79
|
+
"type": "array",
|
|
80
|
+
"items": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"pattern": "^[a-z][a-z0-9-]{0,62}$",
|
|
83
|
+
"description": "A lowercase name: letters, digits and hyphens, starting with a letter. Agents, stages, adapters, sources."
|
|
84
|
+
},
|
|
85
|
+
"minItems": 1,
|
|
86
|
+
"description": "Approver groups picked by the policy."
|
|
87
|
+
},
|
|
88
|
+
"summary": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"minLength": 1,
|
|
91
|
+
"description": "What the approver is asked to decide, shown in the channel."
|
|
92
|
+
},
|
|
93
|
+
"links": {
|
|
94
|
+
"type": "array",
|
|
95
|
+
"items": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"properties": {
|
|
98
|
+
"url": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"format": "uri"
|
|
101
|
+
},
|
|
102
|
+
"title": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"required": [
|
|
107
|
+
"url"
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"expiresAt": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"format": "date-time"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"required": [
|
|
117
|
+
"gateId",
|
|
118
|
+
"workItemId",
|
|
119
|
+
"stage",
|
|
120
|
+
"policy",
|
|
121
|
+
"approvers",
|
|
122
|
+
"summary"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"required": [
|
|
127
|
+
"specversion",
|
|
128
|
+
"id",
|
|
129
|
+
"source",
|
|
130
|
+
"type",
|
|
131
|
+
"time",
|
|
132
|
+
"data"
|
|
133
|
+
],
|
|
134
|
+
"description": "gatekeeper: a decision is needed before a stage starts."
|
|
135
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/sesigl/open-software-factory/main/contracts/events/pr-closed/pr-closed.schema.json",
|
|
4
|
+
"title": "PrClosed",
|
|
5
|
+
"$comment": "Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"specversion": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "1.0"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"maxLength": 128,
|
|
16
|
+
"description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
|
|
17
|
+
},
|
|
18
|
+
"source": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"description": "The producing module, for example \"/osf/intake\"."
|
|
22
|
+
},
|
|
23
|
+
"type": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"const": "pr.closed@v1"
|
|
26
|
+
},
|
|
27
|
+
"time": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"format": "date-time"
|
|
30
|
+
},
|
|
31
|
+
"subject": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
|
|
34
|
+
},
|
|
35
|
+
"datacontenttype": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"const": "application/json"
|
|
38
|
+
},
|
|
39
|
+
"dataschema": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"format": "uri"
|
|
42
|
+
},
|
|
43
|
+
"traceparent": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "W3C trace context (CloudEvents distributed tracing extension)."
|
|
46
|
+
},
|
|
47
|
+
"data": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"url": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"format": "uri",
|
|
53
|
+
"description": "The pull request."
|
|
54
|
+
},
|
|
55
|
+
"merged": {
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"description": "True when the pull request was merged, false when it was closed without a merge."
|
|
58
|
+
},
|
|
59
|
+
"mergeCommit": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"pattern": "^[0-9a-f]{7,40}$",
|
|
62
|
+
"description": "A Git commit hash, abbreviated (7+) or full. The factory version is the commit of the factory definition."
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": [
|
|
66
|
+
"url",
|
|
67
|
+
"merged"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"required": [
|
|
72
|
+
"specversion",
|
|
73
|
+
"id",
|
|
74
|
+
"source",
|
|
75
|
+
"type",
|
|
76
|
+
"time",
|
|
77
|
+
"data"
|
|
78
|
+
],
|
|
79
|
+
"description": "forge adapters: a pull request was merged or closed without a merge."
|
|
80
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/sesigl/open-software-factory/main/contracts/events/pr-opened/pr-opened.schema.json",
|
|
4
|
+
"title": "PrOpened",
|
|
5
|
+
"$comment": "Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"specversion": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "1.0"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"maxLength": 128,
|
|
16
|
+
"description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
|
|
17
|
+
},
|
|
18
|
+
"source": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"description": "The producing module, for example \"/osf/intake\"."
|
|
22
|
+
},
|
|
23
|
+
"type": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"const": "pr.opened@v1"
|
|
26
|
+
},
|
|
27
|
+
"time": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"format": "date-time"
|
|
30
|
+
},
|
|
31
|
+
"subject": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
|
|
34
|
+
},
|
|
35
|
+
"datacontenttype": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"const": "application/json"
|
|
38
|
+
},
|
|
39
|
+
"dataschema": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"format": "uri"
|
|
42
|
+
},
|
|
43
|
+
"traceparent": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "W3C trace context (CloudEvents distributed tracing extension)."
|
|
46
|
+
},
|
|
47
|
+
"data": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"url": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"format": "uri"
|
|
53
|
+
},
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"format": "uri"
|
|
57
|
+
},
|
|
58
|
+
"number": {
|
|
59
|
+
"type": "integer",
|
|
60
|
+
"minimum": 1
|
|
61
|
+
},
|
|
62
|
+
"title": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"minLength": 1
|
|
65
|
+
},
|
|
66
|
+
"headBranch": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
},
|
|
69
|
+
"baseBranch": {
|
|
70
|
+
"type": "string"
|
|
71
|
+
},
|
|
72
|
+
"headCommit": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"pattern": "^[0-9a-f]{7,40}$",
|
|
75
|
+
"description": "A Git commit hash, abbreviated (7+) or full. The factory version is the commit of the factory definition."
|
|
76
|
+
},
|
|
77
|
+
"author": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"properties": {
|
|
80
|
+
"kind": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"enum": [
|
|
83
|
+
"person",
|
|
84
|
+
"trigger"
|
|
85
|
+
],
|
|
86
|
+
"description": "Who caused something: a person, or an automated trigger such as a cron rule or an alert."
|
|
87
|
+
},
|
|
88
|
+
"id": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"minLength": 1,
|
|
91
|
+
"description": "Stable ID in the source system, prefixed with the source, for example \"slack:U024BE7LH\"."
|
|
92
|
+
},
|
|
93
|
+
"displayName": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "Shown to people, for example \"Varun\"."
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"required": [
|
|
99
|
+
"kind",
|
|
100
|
+
"id"
|
|
101
|
+
],
|
|
102
|
+
"description": "A person or trigger. RUNTIME-008: every run is attributed to one."
|
|
103
|
+
},
|
|
104
|
+
"workItemId": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"minLength": 1,
|
|
107
|
+
"maxLength": 128,
|
|
108
|
+
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
109
|
+
},
|
|
110
|
+
"runId": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"minLength": 1,
|
|
113
|
+
"maxLength": 128,
|
|
114
|
+
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"required": [
|
|
118
|
+
"url",
|
|
119
|
+
"repository",
|
|
120
|
+
"number",
|
|
121
|
+
"title",
|
|
122
|
+
"headBranch",
|
|
123
|
+
"baseBranch",
|
|
124
|
+
"headCommit",
|
|
125
|
+
"author"
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"required": [
|
|
130
|
+
"specversion",
|
|
131
|
+
"id",
|
|
132
|
+
"source",
|
|
133
|
+
"type",
|
|
134
|
+
"time",
|
|
135
|
+
"data"
|
|
136
|
+
],
|
|
137
|
+
"description": "forge adapters: the factory opened a pull request."
|
|
138
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/sesigl/open-software-factory/main/contracts/events/pr-reviewed/pr-reviewed.schema.json",
|
|
4
|
+
"title": "PrReviewed",
|
|
5
|
+
"$comment": "Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"specversion": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "1.0"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"maxLength": 128,
|
|
16
|
+
"description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
|
|
17
|
+
},
|
|
18
|
+
"source": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"description": "The producing module, for example \"/osf/intake\"."
|
|
22
|
+
},
|
|
23
|
+
"type": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"const": "pr.reviewed@v1"
|
|
26
|
+
},
|
|
27
|
+
"time": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"format": "date-time"
|
|
30
|
+
},
|
|
31
|
+
"subject": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
|
|
34
|
+
},
|
|
35
|
+
"datacontenttype": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"const": "application/json"
|
|
38
|
+
},
|
|
39
|
+
"dataschema": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"format": "uri"
|
|
42
|
+
},
|
|
43
|
+
"traceparent": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "W3C trace context (CloudEvents distributed tracing extension)."
|
|
46
|
+
},
|
|
47
|
+
"data": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"url": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"format": "uri",
|
|
53
|
+
"description": "The pull request."
|
|
54
|
+
},
|
|
55
|
+
"reviewer": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"properties": {
|
|
58
|
+
"kind": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"enum": [
|
|
61
|
+
"person",
|
|
62
|
+
"trigger"
|
|
63
|
+
],
|
|
64
|
+
"description": "Who caused something: a person, or an automated trigger such as a cron rule or an alert."
|
|
65
|
+
},
|
|
66
|
+
"id": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"minLength": 1,
|
|
69
|
+
"description": "Stable ID in the source system, prefixed with the source, for example \"slack:U024BE7LH\"."
|
|
70
|
+
},
|
|
71
|
+
"displayName": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "Shown to people, for example \"Varun\"."
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"required": [
|
|
77
|
+
"kind",
|
|
78
|
+
"id"
|
|
79
|
+
],
|
|
80
|
+
"description": "A person or trigger. RUNTIME-008: every run is attributed to one."
|
|
81
|
+
},
|
|
82
|
+
"automated": {
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"description": "True when an agent or a bot wrote the review, not a person."
|
|
85
|
+
},
|
|
86
|
+
"state": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"enum": [
|
|
89
|
+
"approved",
|
|
90
|
+
"changes_requested",
|
|
91
|
+
"commented"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"required": [
|
|
96
|
+
"url",
|
|
97
|
+
"reviewer",
|
|
98
|
+
"state"
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": [
|
|
103
|
+
"specversion",
|
|
104
|
+
"id",
|
|
105
|
+
"source",
|
|
106
|
+
"type",
|
|
107
|
+
"time",
|
|
108
|
+
"data"
|
|
109
|
+
],
|
|
110
|
+
"description": "forge adapters: a person, an agent or a bot reviewed or commented on a pull request."
|
|
111
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/sesigl/open-software-factory/main/contracts/events/run-completed/run-completed.schema.json",
|
|
4
|
+
"title": "RunCompleted",
|
|
5
|
+
"$comment": "Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"specversion": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "1.0"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"maxLength": 128,
|
|
16
|
+
"description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
|
|
17
|
+
},
|
|
18
|
+
"source": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"description": "The producing module, for example \"/osf/intake\"."
|
|
22
|
+
},
|
|
23
|
+
"type": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"const": "run.completed@v1"
|
|
26
|
+
},
|
|
27
|
+
"time": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"format": "date-time"
|
|
30
|
+
},
|
|
31
|
+
"subject": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
|
|
34
|
+
},
|
|
35
|
+
"datacontenttype": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"const": "application/json"
|
|
38
|
+
},
|
|
39
|
+
"dataschema": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"format": "uri"
|
|
42
|
+
},
|
|
43
|
+
"traceparent": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "W3C trace context (CloudEvents distributed tracing extension)."
|
|
46
|
+
},
|
|
47
|
+
"data": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"runId": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"minLength": 1,
|
|
53
|
+
"maxLength": 128,
|
|
54
|
+
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
55
|
+
},
|
|
56
|
+
"workItemId": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"minLength": 1,
|
|
59
|
+
"maxLength": 128,
|
|
60
|
+
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
61
|
+
},
|
|
62
|
+
"stage": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"pattern": "^[a-z][a-z0-9-]{0,62}$",
|
|
65
|
+
"description": "A lowercase name: letters, digits and hyphens, starting with a letter. Agents, stages, adapters, sources."
|
|
66
|
+
},
|
|
67
|
+
"factoryVersion": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"pattern": "^[0-9a-f]{7,40}$",
|
|
70
|
+
"description": "A Git commit hash, abbreviated (7+) or full. The factory version is the commit of the factory definition."
|
|
71
|
+
},
|
|
72
|
+
"outcome": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": [
|
|
75
|
+
"succeeded",
|
|
76
|
+
"failed",
|
|
77
|
+
"cancelled"
|
|
78
|
+
],
|
|
79
|
+
"description": "How a run ended."
|
|
80
|
+
},
|
|
81
|
+
"startedAt": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"format": "date-time"
|
|
84
|
+
},
|
|
85
|
+
"endedAt": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"format": "date-time"
|
|
88
|
+
},
|
|
89
|
+
"requester": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"properties": {
|
|
92
|
+
"kind": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"enum": [
|
|
95
|
+
"person",
|
|
96
|
+
"trigger"
|
|
97
|
+
],
|
|
98
|
+
"description": "Who caused something: a person, or an automated trigger such as a cron rule or an alert."
|
|
99
|
+
},
|
|
100
|
+
"id": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"minLength": 1,
|
|
103
|
+
"description": "Stable ID in the source system, prefixed with the source, for example \"slack:U024BE7LH\"."
|
|
104
|
+
},
|
|
105
|
+
"displayName": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "Shown to people, for example \"Varun\"."
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"required": [
|
|
111
|
+
"kind",
|
|
112
|
+
"id"
|
|
113
|
+
],
|
|
114
|
+
"description": "A person or trigger. RUNTIME-008: every run is attributed to one."
|
|
115
|
+
},
|
|
116
|
+
"source": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"pattern": "^[a-z][a-z0-9-]{0,62}$",
|
|
119
|
+
"description": "A lowercase name: letters, digits and hyphens, starting with a letter. Agents, stages, adapters, sources."
|
|
120
|
+
},
|
|
121
|
+
"costUsd": {
|
|
122
|
+
"type": "number",
|
|
123
|
+
"minimum": 0
|
|
124
|
+
},
|
|
125
|
+
"traceId": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"pattern": "^[0-9a-f]{32}$",
|
|
128
|
+
"description": "An OpenTelemetry trace ID: 32 lowercase hex characters."
|
|
129
|
+
},
|
|
130
|
+
"pullRequests": {
|
|
131
|
+
"type": "array",
|
|
132
|
+
"items": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"format": "uri"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"evidenceBundle": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"format": "uri"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"required": [
|
|
143
|
+
"runId",
|
|
144
|
+
"workItemId",
|
|
145
|
+
"factoryVersion",
|
|
146
|
+
"outcome",
|
|
147
|
+
"startedAt",
|
|
148
|
+
"endedAt",
|
|
149
|
+
"requester",
|
|
150
|
+
"source"
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"required": [
|
|
155
|
+
"specversion",
|
|
156
|
+
"id",
|
|
157
|
+
"source",
|
|
158
|
+
"type",
|
|
159
|
+
"time",
|
|
160
|
+
"data"
|
|
161
|
+
],
|
|
162
|
+
"description": "foreman: a run ended."
|
|
163
|
+
}
|