···9 "key": "tid",
10 "record": {
11 "type": "object",
12+ "required": ["pipeline", "workflow", "status", "createdAt"],
13 "properties": {
14 "pipeline": {
15 "type": "string",
16 "format": "at-uri",
17+ "description": "ATURI of the pipeline"
18+ },
19+ "workflow": {
20+ "type": "string",
21+ "format": "at-uri",
22+ "description": "name of the workflow within this pipeline"
23 },
24 "status": {
25 "type": "string",
26+ "description": "status of the workflow",
27 "enum": [
28 "pending",
29 "running",
···32 "cancelled",
33 "success"
34 ]
35+ },
36+ "createdAt": {
37+ "type": "string",
38+ "format": "datetime",
39+ "description": "time of creation of this status update"
40 },
41 "error": {
42 "type": "string",
···45 "exitCode": {
46 "type": "integer",
47 "description": "exit code if failed"
00000000000000048 }
49 }
50 }
+5-13
spindle/db/db.go
···30 did text primary key
31 );
3233- create table if not exists pipeline_status (
034 rkey text not null,
35- pipeline text not null,
36- status text not null,
37-38- -- only set if status is 'failed'
39- error text,
40- exit_code integer,
41-42- started_at timestamp not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
43- updated_at timestamp not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
44- finished_at timestamp,
45-46- primary key (rkey)
47 );
48 `)
49 if err != nil {
···30 did text primary key
31 );
3233+ -- status event for a single workflow
34+ create table if not exists events (
35 rkey text not null,
36+ nsid text not null,
37+ event text not null, -- json
38+ created integer not null -- unix nanos
00000000039 );
40 `)
41 if err != nil {