@opensoftware/contracts 1.0.0 → 1.5.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.
@@ -49,6 +49,18 @@ channels:
49
49
  messages:
50
50
  PrOpened:
51
51
  $ref: '#/components/messages/PrOpened'
52
+ pr-reviewed:
53
+ address: osf.pr.reviewed.v1
54
+ description: A person, an agent or a bot reviewed or commented on a pull request.
55
+ messages:
56
+ PrReviewed:
57
+ $ref: '#/components/messages/PrReviewed'
58
+ pr-closed:
59
+ address: osf.pr.closed.v1
60
+ description: A pull request was merged or closed without a merge.
61
+ messages:
62
+ PrClosed:
63
+ $ref: '#/components/messages/PrClosed'
52
64
  operations:
53
65
  publishWorkReceived:
54
66
  action: send
@@ -92,6 +104,20 @@ operations:
92
104
  $ref: '#/channels/pr-opened'
93
105
  messages:
94
106
  - $ref: '#/channels/pr-opened/messages/PrOpened'
107
+ publishPrReviewed:
108
+ action: send
109
+ summary: Published by forge adapters.
110
+ channel:
111
+ $ref: '#/channels/pr-reviewed'
112
+ messages:
113
+ - $ref: '#/channels/pr-reviewed/messages/PrReviewed'
114
+ publishPrClosed:
115
+ action: send
116
+ summary: Published by forge adapters.
117
+ channel:
118
+ $ref: '#/channels/pr-closed'
119
+ messages:
120
+ - $ref: '#/channels/pr-closed/messages/PrClosed'
95
121
  components:
96
122
  messages:
97
123
  WorkReceived:
@@ -142,3 +168,19 @@ components:
142
168
  schemaFormat: application/schema+json;version=draft-2020-12
143
169
  schema:
144
170
  $ref: './pr-opened/pr-opened.schema.json'
171
+ PrReviewed:
172
+ name: pr.reviewed@v1
173
+ title: pr.reviewed@v1
174
+ contentType: application/cloudevents+json
175
+ payload:
176
+ schemaFormat: application/schema+json;version=draft-2020-12
177
+ schema:
178
+ $ref: './pr-reviewed/pr-reviewed.schema.json'
179
+ PrClosed:
180
+ name: pr.closed@v1
181
+ title: pr.closed@v1
182
+ contentType: application/cloudevents+json
183
+ payload:
184
+ schemaFormat: application/schema+json;version=draft-2020-12
185
+ schema:
186
+ $ref: './pr-closed/pr-closed.schema.json'
@@ -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,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,140 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/sesigl/open-software-factory/main/contracts/gate-record/gate-record.schema.json",
4
+ "title": "GateRecord",
5
+ "$comment": "Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
6
+ "type": "object",
7
+ "properties": {
8
+ "gate": {
9
+ "type": "string",
10
+ "pattern": "^g[0-9a-f]{16}$"
11
+ },
12
+ "workItem": {
13
+ "type": "string"
14
+ },
15
+ "stage": {
16
+ "type": "string",
17
+ "pattern": "^[a-z][a-z0-9-]{0,62}$",
18
+ "description": "A lowercase name: letters, digits and hyphens, starting with a letter. Agents, stages, adapters, sources."
19
+ },
20
+ "summary": {
21
+ "type": "string"
22
+ },
23
+ "request": {
24
+ "type": "string",
25
+ "pattern": "^sha256:[0-9a-f]{64}$",
26
+ "description": "SHA-256 of the canonical request: what was approved."
27
+ },
28
+ "policy": {
29
+ "type": "string",
30
+ "minLength": 1,
31
+ "description": "The policy file."
32
+ },
33
+ "policyDigest": {
34
+ "type": "string",
35
+ "pattern": "^sha256:[0-9a-f]{64}$",
36
+ "description": "SHA-256 of the policy's text: the rules that picked the approvers."
37
+ },
38
+ "risk": {
39
+ "type": "string"
40
+ },
41
+ "approvers": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "string",
45
+ "pattern": "^[a-z][a-z0-9-]{0,62}$",
46
+ "description": "A lowercase name: letters, digits and hyphens, starting with a letter. Agents, stages, adapters, sources."
47
+ }
48
+ },
49
+ "channel": {
50
+ "type": "string"
51
+ },
52
+ "requestedAt": {
53
+ "type": "string",
54
+ "format": "date-time"
55
+ },
56
+ "decision": {
57
+ "type": "string",
58
+ "enum": [
59
+ "approved",
60
+ "rejected",
61
+ "expired"
62
+ ]
63
+ },
64
+ "decidedBy": {
65
+ "type": "object",
66
+ "properties": {
67
+ "kind": {
68
+ "type": "string",
69
+ "enum": [
70
+ "person",
71
+ "trigger"
72
+ ],
73
+ "description": "Who caused something: a person, or an automated trigger such as a cron rule or an alert."
74
+ },
75
+ "id": {
76
+ "type": "string",
77
+ "minLength": 1,
78
+ "description": "Stable ID in the source system, prefixed with the source, for example \"slack:U024BE7LH\"."
79
+ },
80
+ "displayName": {
81
+ "type": "string",
82
+ "description": "Shown to people, for example \"Varun\"."
83
+ }
84
+ },
85
+ "required": [
86
+ "kind",
87
+ "id"
88
+ ],
89
+ "description": "Who decided. Absent only when the gate expired. A policy that names no group decides as a trigger."
90
+ },
91
+ "decidedAt": {
92
+ "type": "string",
93
+ "format": "date-time"
94
+ },
95
+ "reason": {
96
+ "type": "string",
97
+ "description": "The reason of a rejection."
98
+ },
99
+ "signature": {
100
+ "type": "object",
101
+ "properties": {
102
+ "algorithm": {
103
+ "type": "string",
104
+ "const": "Ed25519"
105
+ },
106
+ "key": {
107
+ "type": "string",
108
+ "pattern": "^sha256:",
109
+ "description": "SHA-256 of the public key in DER, like \"sha256:…\"."
110
+ },
111
+ "value": {
112
+ "type": "string",
113
+ "minLength": 1,
114
+ "description": "The signature in base64."
115
+ }
116
+ },
117
+ "required": [
118
+ "algorithm",
119
+ "key",
120
+ "value"
121
+ ],
122
+ "description": "Ed25519 over the canonical JSON of the rest of the record. Absent when the record is unsigned."
123
+ }
124
+ },
125
+ "required": [
126
+ "gate",
127
+ "workItem",
128
+ "stage",
129
+ "summary",
130
+ "request",
131
+ "policy",
132
+ "policyDigest",
133
+ "approvers",
134
+ "channel",
135
+ "requestedAt",
136
+ "decision",
137
+ "decidedAt"
138
+ ],
139
+ "description": "gatekeeper: who decided what and when, signed with Ed25519 (ADR 0047)."
140
+ }