-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathschema.capnp
More file actions
143 lines (110 loc) · 3.29 KB
/
schema.capnp
File metadata and controls
143 lines (110 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@0x9ac524e0ec04d45e;
using OCurrent = import "ocurrent.capnp";
enum BuildStatus {
notStarted @0;
passed @1;
failed @2;
pending @3;
}
struct JobInfo {
variant @0 :Text;
state :union {
notStarted @1 :Void;
passed @2 :Void;
failed @3 :Text;
# The text is the error message.
active @4 :Void;
# The job is still running.
aborted @5 :Void;
# This means we couldn't find any record of the job. It probably means
# that the server crashed while building, and when it came back up we
# no longer wanted to test that commit anyway.
}
queuedAt :union {
ts @6 :Float64;
# timestamp as seconds since epoch
none @7 :Void;
}
startedAt :union {
ts @8 :Float64;
# timestamp as seconds since epoch
none @9 :Void;
}
finishedAt :union {
ts @10 :Float64;
# timestamp as seconds since epoch
none @11 :Void;
}
isExperimental @12 :Bool;
}
interface Commit {
jobs @0 () -> (jobs :List(JobInfo));
jobOfVariant @1 (variant :Text) -> (job :OCurrent.Job);
refs @2 (hash :Text) -> (refs :List(Text));
# Get the set of branches and PRs with this commit at their head.
status @3 () -> (status :BuildStatus);
message @4 () -> (message :Text);
title @5 () -> (title :Text);
}
struct RefInfo {
ref @0 :Text;
hash @1 :Text;
status @2 :BuildStatus;
startedAt :union {
ts @3 :Float64;
none @4 :Void;
}
message @5 :Text;
name @6 :Text;
ranFor :union {
ts @7 :Float64;
none @8 :Void;
}
# The state of a ref's commit
}
interface Repo {
refs @0 () -> (refs :List(RefInfo));
# Get the set of branches and PRs being monitored.
obsoleteJobOfCommit @1 (hash :Text) -> (job :OCurrent.Job);
obsoleteJobOfRef @2 (ref :Text) -> (job :OCurrent.Job);
obsoleteRefsOfCommit @3 (hash :Text) -> (refs :List(Text));
commitOfHash @4 (hash :Text) -> (commit :Commit);
# The hash doesn't need to be the full hash, but must be at least 6 characters long.
commitOfRef @5 (ref :Text) -> (commit :Commit);
# ref should be of the form "refs/heads/..." or "refs/pull/4/head"
historyOfRef @6 (ref :Text) -> (refs :List(RefInfo));
# ref should be of the form "refs/heads/..." or "refs/pull/4/head"
defaultRef @7 () -> (default :RefInfo);
}
struct RepoInfo {
name @0 :Text;
mainState @1 :BuildStatus;
mainHash @2 :Text;
mainLastUpdated :union {
ts @3 :Float64;
none @4 :Void;
}
defaultRef @5 :Text;
# The status of the repository's main branch (notStarted if there isn't one)
}
struct RepoHistory {
name @0 :Text;
history @1 :List(RefInfo);
}
struct OrgInfo {
name @0 :Text;
numberRepos @1 :Int16;
}
interface Org {
repo @0 (name :Text) -> (repo :Repo);
repos @1 () -> (repos :List(RepoInfo));
# Get the list of tracked repositories for this organisation.
repoHistories @2 () -> (histories :List(RepoHistory));
}
interface CI {
org @0 (owner :Text) -> (org :Org);
orgs @1 () -> (orgs :List(Text));
# Get the list of organisations for this CI capability.
orgsDetailed @2 () -> (orgs :List(OrgInfo));
# Get a list of organisations and related information for this CI capability.
}