@opensoftware/contracts 1.7.0 → 1.8.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 CHANGED
@@ -53,7 +53,7 @@ first is gatekeeper's: `POST /v1/gates` and `GET /v1/gates/{gateId}` with the mo
53
53
  `ApiProblem` (RFC 9457). The second is intake's (ADR 0063): `POST /v1/work-items` and
54
54
  `GET /v1/work-items/{workItemId}` with the models `WorkSubmission`, `WorkItemView` and `WorkRequest`. The third is the
55
55
  foreman's (ADR 0067): `POST /v1/runs`, `GET /v1/runs/{runId}` and `POST /v1/runs/{runId}/signals` with the models
56
- `RunView`, `StageView` and `RunSignal`. `pnpm build` compiles the operations with the TypeSpec OpenAPI 3 emitter and copies their
56
+ `RunView`, `StageView`, `CheckView` (ADR 0069) and `RunSignal`. `pnpm build` compiles the operations with the TypeSpec OpenAPI 3 emitter and copies their
57
57
  paths next to the named models; an operation that uses a type that is no model fails the build. The package exports
58
58
  the type `paths`, which types a client such as openapi-fetch.
59
59
 
@@ -193,6 +193,18 @@ export type components = {
193
193
  };
194
194
  /** @description A path inside the bundle: relative, forward slashes, no "..". */
195
195
  BundlePath: string;
196
+ /** @description The name of a check on the forge: a commit status context. */
197
+ CheckName: string;
198
+ /**
199
+ * @description foreman: the state of a check on the forge (forge port).
200
+ * @enum {string}
201
+ */
202
+ CheckState: "pending" | "success" | "failure" | "error";
203
+ /** @description foreman: a check that a stage waits for, as the foreman last read it on the run's pull request (ADR 0069). */
204
+ CheckView: {
205
+ name: components["schemas"]["CheckName"];
206
+ state: components["schemas"]["CheckState"];
207
+ };
196
208
  /** @description A Git commit hash, abbreviated (7+) or full. The factory version is the commit of the factory definition. */
197
209
  CommitHash: string;
198
210
  /**
@@ -790,6 +802,11 @@ export type components = {
790
802
  /** @description The commit of the factory definition the run started with. */
791
803
  factoryVersion: components["schemas"]["CommitHash"];
792
804
  state: components["schemas"]["RunState"];
805
+ /**
806
+ * Format: uri
807
+ * @description The last pull request link that an agent of the run wrote (ADR 0069).
808
+ */
809
+ pullRequest?: string;
793
810
  /** Format: date-time */
794
811
  startedAt: string;
795
812
  /** Format: date-time */
@@ -931,6 +948,11 @@ export type components = {
931
948
  agent?: components["schemas"]["Name"];
932
949
  /** @description The stage waits for a decision before it starts. */
933
950
  gate?: components["schemas"]["Gate"];
951
+ /**
952
+ * @description Checks that must succeed on the run's pull request before the stage starts, by their names on the forge, for
953
+ * example "verify" (ADR 0069).
954
+ */
955
+ checks?: components["schemas"]["CheckName"][];
934
956
  /** @description Whether the stage must produce an evidence bundle. */
935
957
  evidence?: components["schemas"]["EvidenceRequirement"];
936
958
  };
@@ -949,6 +971,10 @@ export type components = {
949
971
  sessionId?: string;
950
972
  /** @description The gate that decides whether the stage starts, once it was requested. */
951
973
  gateId?: string;
974
+ /** @description The checks the stage waits for, once the foreman read them (ADR 0069). */
975
+ checks?: components["schemas"]["CheckView"][];
976
+ /** @description Why the stage ended without success, when the foreman knows. */
977
+ reason?: string;
952
978
  /** Format: date-time */
953
979
  startedAt?: string;
954
980
  /** Format: date-time */
package/dist/index.d.ts CHANGED
@@ -29,6 +29,7 @@ export type WorkItemView = Schemas["WorkItemView"];
29
29
  export type WorkRequest = Schemas["WorkRequest"];
30
30
  export type RunView = Schemas["RunView"];
31
31
  export type StageView = Schemas["StageView"];
32
+ export type CheckView = Schemas["CheckView"];
32
33
  export type RunSignal = Schemas["RunSignal"];
33
34
  export type SandboxSpec = Schemas["SandboxSpec"];
34
35
  /** One reason a document does not match its format. `path` is a JSON Pointer into the document. */
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAA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AC,GAAG,CAAC,CAAC;QACd,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,QAAQ,CAAC,KAAkB;IAClC,MAAM,KAAK,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,GAAG,KAAK,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC;IACpH,QAAQ,KAAK,CAAC,OAAO,EAAE,CAAC;QACtB,KAAK,sBAAsB;YACzB,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;QAC5F,KAAK,uBAAuB;YAC1B,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;QAC7F,KAAK,UAAU;YACb,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;QAClG,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACV,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,IAAI,GAAG,EAAE,OAAO,EAAE,6CAA6C,EAAE,CAAC;QACrG;YACE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,IAAI,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;IACxF,CAAC;AACH,CAAC"}
@@ -247,6 +247,15 @@
247
247
  "additionalProperties": false,
248
248
  "description": "The stage waits for a decision before it starts."
249
249
  },
250
+ "checks": {
251
+ "type": "array",
252
+ "items": {
253
+ "type": "string",
254
+ "minLength": 1,
255
+ "description": "The name of a check on the forge: a commit status context."
256
+ },
257
+ "description": "Checks that must succeed on the run's pull request before the stage starts, by their names on the forge, for\nexample \"verify\" (ADR 0069)."
258
+ },
250
259
  "evidence": {
251
260
  "type": "string",
252
261
  "enum": [
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Open Software Factory contracts",
5
- "version": "1.7.0",
5
+ "version": "1.8.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",
@@ -696,6 +696,37 @@
696
696
  "pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$))[^\\\\]+$",
697
697
  "description": "A path inside the bundle: relative, forward slashes, no \"..\"."
698
698
  },
699
+ "CheckName": {
700
+ "type": "string",
701
+ "minLength": 1,
702
+ "description": "The name of a check on the forge: a commit status context."
703
+ },
704
+ "CheckState": {
705
+ "type": "string",
706
+ "enum": [
707
+ "pending",
708
+ "success",
709
+ "failure",
710
+ "error"
711
+ ],
712
+ "description": "foreman: the state of a check on the forge (forge port)."
713
+ },
714
+ "CheckView": {
715
+ "type": "object",
716
+ "properties": {
717
+ "name": {
718
+ "$ref": "#/components/schemas/CheckName"
719
+ },
720
+ "state": {
721
+ "$ref": "#/components/schemas/CheckState"
722
+ }
723
+ },
724
+ "required": [
725
+ "name",
726
+ "state"
727
+ ],
728
+ "description": "foreman: a check that a stage waits for, as the foreman last read it on the run's pull request (ADR 0069)."
729
+ },
699
730
  "CommitHash": {
700
731
  "type": "string",
701
732
  "pattern": "^[0-9a-f]{7,40}$",
@@ -2270,6 +2301,11 @@
2270
2301
  "state": {
2271
2302
  "$ref": "#/components/schemas/RunState"
2272
2303
  },
2304
+ "pullRequest": {
2305
+ "type": "string",
2306
+ "format": "uri",
2307
+ "description": "The last pull request link that an agent of the run wrote (ADR 0069)."
2308
+ },
2273
2309
  "startedAt": {
2274
2310
  "type": "string",
2275
2311
  "format": "date-time"
@@ -2656,6 +2692,13 @@
2656
2692
  "$ref": "#/components/schemas/Gate",
2657
2693
  "description": "The stage waits for a decision before it starts."
2658
2694
  },
2695
+ "checks": {
2696
+ "type": "array",
2697
+ "items": {
2698
+ "$ref": "#/components/schemas/CheckName"
2699
+ },
2700
+ "description": "Checks that must succeed on the run's pull request before the stage starts, by their names on the forge, for\nexample \"verify\" (ADR 0069)."
2701
+ },
2659
2702
  "evidence": {
2660
2703
  "$ref": "#/components/schemas/EvidenceRequirement",
2661
2704
  "description": "Whether the stage must produce an evidence bundle."
@@ -2701,6 +2744,18 @@
2701
2744
  "pattern": "^g[0-9a-f]{16}$",
2702
2745
  "description": "The gate that decides whether the stage starts, once it was requested."
2703
2746
  },
2747
+ "checks": {
2748
+ "type": "array",
2749
+ "items": {
2750
+ "$ref": "#/components/schemas/CheckView"
2751
+ },
2752
+ "description": "The checks the stage waits for, once the foreman read them (ADR 0069)."
2753
+ },
2754
+ "reason": {
2755
+ "type": "string",
2756
+ "minLength": 1,
2757
+ "description": "Why the stage ended without success, when the foreman knows."
2758
+ },
2704
2759
  "startedAt": {
2705
2760
  "type": "string",
2706
2761
  "format": "date-time"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensoftware/contracts",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "The shared formats of the open software factory: JSON Schemas, TypeScript types and the osf-contracts CLI.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -126,10 +126,20 @@ model Stage {
126
126
  /** The stage waits for a decision before it starts. */
127
127
  gate?: Gate;
128
128
 
129
+ /**
130
+ * Checks that must succeed on the run's pull request before the stage starts, by their names on the forge, for
131
+ * example "verify" (ADR 0069).
132
+ */
133
+ checks?: CheckName[];
134
+
129
135
  /** Whether the stage must produce an evidence bundle. */
130
136
  evidence?: EvidenceRequirement;
131
137
  }
132
138
 
139
+ /** The name of a check on the forge: a commit status context. */
140
+ @minLength(1)
141
+ scalar CheckName extends string;
142
+
133
143
  enum EvidenceRequirement {
134
144
  required,
135
145
  optional,
@@ -1,6 +1,7 @@
1
1
  import "@typespec/json-schema";
2
2
  import "./common.tsp";
3
3
  import "./work-item.tsp";
4
+ import "./factory-definition.tsp";
4
5
 
5
6
  using TypeSpec.JsonSchema;
6
7
 
@@ -26,6 +27,20 @@ enum StageState {
26
27
  cancelled,
27
28
  }
28
29
 
30
+ /** foreman: the state of a check on the forge (forge port). */
31
+ enum CheckState {
32
+ pending,
33
+ success,
34
+ failure,
35
+ error,
36
+ }
37
+
38
+ /** foreman: a check that a stage waits for, as the foreman last read it on the run's pull request (ADR 0069). */
39
+ model CheckView {
40
+ name: CheckName;
41
+ state: CheckState;
42
+ }
43
+
29
44
  /** foreman: one stage of a run (ADR 0067). */
30
45
  model StageView {
31
46
  stage: Name;
@@ -42,6 +57,13 @@ model StageView {
42
57
  @pattern("^g[0-9a-f]{16}$")
43
58
  gateId?: string;
44
59
 
60
+ /** The checks the stage waits for, once the foreman read them (ADR 0069). */
61
+ checks?: CheckView[];
62
+
63
+ /** Why the stage ended without success, when the foreman knows. */
64
+ @minLength(1)
65
+ reason?: string;
66
+
45
67
  startedAt?: utcDateTime;
46
68
  endedAt?: utcDateTime;
47
69
  }
@@ -61,6 +83,10 @@ model RunView {
61
83
  factoryVersion: CommitHash;
62
84
 
63
85
  state: RunState;
86
+
87
+ /** The last pull request link that an agent of the run wrote (ADR 0069). */
88
+ pullRequest?: url;
89
+
64
90
  startedAt: utcDateTime;
65
91
  endedAt?: utcDateTime;
66
92