sh.tangled.ci.pipeline.json

 1{
 2  "lexicon": 1,
 3  "id": "sh.tangled.ci.pipeline",
 4  "defs": {
 5    "main": {
 6      "type": "object",
 7      "description": "A CI pipeline. Record-like, but owned by the spindle rather than a PDS.",
 8      "required": ["id", "trigger", "commit", "workflows"],
 9      "properties": {
10        "id": {
11          "type": "string",
12          "description": "Spindle-local pipeline id"
13        },
14        "repo": {
15          "type": "string",
16          "format": "did",
17          "description": "Repository DID"
18        },
19        "trigger": {
20          "type": "union",
21          "refs": [
22            "sh.tangled.ci.trigger#push",
23            "sh.tangled.ci.trigger#pullRequest",
24            "sh.tangled.ci.trigger#manual",
25            "sh.tangled.ci.trigger#schedule"
26          ],
27          "description": "Trigger event metadata"
28        },
29        "commit": {
30          "type": "string",
31          "description": "Commit Id this pipeline is running on"
32        },
33        "sourceRepo": {
34          "type": "string",
35          "format": "did",
36          "description": "Repository DID that the commit was checked out from, if different from repo (e.g. a fork for a fork-based pull request)"
37        },
38        "createdAt": {
39          "type": "string",
40          "format": "datetime"
41        },
42        "workflows": {
43          "type": "array",
44          "description": "Triggered workflows",
45          "minLength": 1,
46          "maxLength": 50,
47          "items": {
48            "type": "ref",
49            "ref": "#workflow"
50          }
51        }
52      }
53    },
54    "workflow": {
55      "type": "object",
56      "required": ["id", "name", "status"],
57      "properties": {
58        "id": {
59          "type": "string",
60          "description": "Spindle-local workflow id. Unique per pipeline, usually same as name."
61        },
62        "name": {
63          "type": "string",
64          "description": "Name of the workflow",
65          "minGraphemes": 1,
66          "maxGraphemes": 40
67        },
68        "status": {
69          "type": "string",
70          "description": "Workflow status",
71          "enum": [
72            "pending",
73            "running",
74            "failed",
75            "timeout",
76            "cancelled",
77            "success"
78          ]
79        },
80        "startedAt": {
81          "type": "string",
82          "format": "datetime"
83        },
84        "finishedAt": {
85          "type": "string",
86          "format": "datetime"
87        },
88        "error": {
89          "type": "string"
90        }
91      }
92    }
93  }
94}