forked from taskcluster/taskcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0037.yml
199 lines (199 loc) · 6.8 KB
/
0037.yml
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
version: 37
description: github checks phase 2
migrationScript: 0037-migration.sql
downgradeScript: 0037-downgrade.sql
methods:
taskcluster_check_runs_entities_load:
deprecated: true
description: See taskcluster-lib-entities
mode: read
serviceName: github
args: partition_key text, row_key text
returns: table (partition_key_out text, row_key_out text, value jsonb, version integer, etag uuid)
body: |-
begin
return query
select
partition_key,
row_key,
jsonb_build_object(
'PartitionKey', partition_key,
'RowKey', row_key,
'taskGroupId', task_group_id,
'taskId', task_id,
'checkSuiteId', check_suite_id,
'checkRunId', check_run_id) as value,
1 as version,
public.gen_random_uuid() as etag -- we just return this for api compatibility
from github_checks
where
github_checks.task_group_id = decode_string_key(partition_key) and
github_checks.task_id = decode_string_key(row_key);
end
taskcluster_check_runs_entities_create:
deprecated: true
description: See taskcluster-lib-entities
serviceName: github
mode: write
args: pk text, rk text, properties jsonb, overwrite boolean, version integer
returns: uuid
body: |-
declare
new_row github_checks%ROWTYPE;
begin
select
(properties ->> 'taskGroupId')::text as task_group_id,
(properties ->> 'taskId')::text as task_id,
(properties ->> 'checkSuiteId')::text as check_suite_id,
(properties ->> 'checkRunId')::text as check_run_id
into new_row;
if overwrite then
raise exception 'overwrite not implemented';
else
execute 'insert into github_checks select $1.*' using new_row;
end if;
return public.gen_random_uuid(); -- we just return this for api compatibility
end
taskcluster_check_runs_entities_scan:
deprecated: true
description: See taskcluster-lib-entities
mode: read
serviceName: github
args: pk text, rk text, condition text, size integer, page integer
returns: table (partition_key text, row_key text, value jsonb, version integer, etag uuid)
body: |-
begin
raise exception 'not implemented';
end
taskcluster_check_runs_entities_remove:
deprecated: true
serviceName: github
description: See taskcluster-lib-entities
mode: write
args: partition_key text, row_key text
returns: table (etag uuid)
body: |-
begin
delete
from github_checks
where
github_checks.task_group_id = decode_string_key(partition_key) and
github_checks.task_id = decode_string_key(row_key);
-- tc-gh does not care if the row existed
return query select gen_random_uuid() as etag;
end
taskcluster_check_runs_entities_modify:
deprecated: true
serviceName: github
description: See taskcluster-lib-entities
mode: write
args: partition_key text, row_key text, properties jsonb, version integer, old_etag uuid
returns: table (etag uuid)
body: |-
begin
raise exception 'github integrations are immutable';
end
taskcluster_checks_to_tasks_entities_load:
deprecated: true
description: See taskcluster-lib-entities
mode: read
serviceName: github
args: partition_key text, row_key text
returns: table (partition_key_out text, row_key_out text, value jsonb, version integer, etag uuid)
body: |-
begin
return query
select
partition_key,
row_key,
jsonb_build_object(
'PartitionKey', partition_key,
'RowKey', row_key,
'taskGroupId', task_group_id,
'taskId', task_id,
'checkSuiteId', check_suite_id,
'checkRunId', check_run_id) as value,
1 as version,
public.gen_random_uuid() as etag -- we just return this for api compatibility
from github_checks
where
github_checks.check_suite_id = decode_string_key(partition_key) and
github_checks.check_run_id = decode_string_key(row_key);
end
taskcluster_checks_to_tasks_entities_create:
deprecated: true
description: See taskcluster-lib-entities
serviceName: github
mode: write
args: pk text, rk text, properties jsonb, overwrite boolean, version integer
returns: uuid
body: |-
begin
-- We do nothing here because this is always written in tandem with a check_run
return gen_random_uuid();
end
taskcluster_checks_to_tasks_entities_scan:
deprecated: true
description: See taskcluster-lib-entities
mode: read
serviceName: github
args: pk text, rk text, condition text, size integer, page integer
returns: table (partition_key text, row_key text, value jsonb, version integer, etag uuid)
body: |-
begin
raise exception 'not implemented';
end
taskcluster_checks_to_tasks_entities_remove:
deprecated: true
serviceName: github
description: See taskcluster-lib-entities
mode: write
args: partition_key text, row_key text
returns: table (etag uuid)
body: |-
begin
delete
from github_checks
where
github_checks.check_suite_id = decode_string_key(partition_key) and
github_checks.check_run_id = decode_string_key(row_key);
-- tc-gh does not care if the row existed
return query select gen_random_uuid() as etag;
end
taskcluster_checks_to_tasks_entities_modify:
deprecated: true
serviceName: github
description: See taskcluster-lib-entities
mode: write
args: partition_key text, row_key text, properties jsonb, version integer, old_etag uuid
returns: table (etag uuid)
body: |-
begin
raise exception 'github integrations are immutable';
end
create_github_check:
serviceName: github
description: Create a single check.
mode: write
args: task_group_id_in text, task_id_in text, check_suite_id_in text, check_run_id_in text
returns: void
body: |-
begin
insert into github_checks (task_group_id, task_id, check_suite_id, check_run_id) values (task_group_id_in, task_id_in, check_suite_id_in, check_run_id_in);
end
get_github_check_by_task_id:
serviceName: github
description: Get a single check from a task_id.
mode: read
args: task_id_in text
returns: table (task_group_id text, task_id text, check_suite_id text, check_run_id text)
body: |-
begin
return query select
github_checks.task_group_id,
github_checks.task_id,
github_checks.check_suite_id,
github_checks.check_run_id
from github_checks
where github_checks.task_id = task_id_in;
end