-
Notifications
You must be signed in to change notification settings - Fork 251
/
0086.yml
37 lines (37 loc) · 1.59 KB
/
0086.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
version: 86
description: Filter github builds in db
methods:
get_pending_github_builds:
description: |-
Get github builds that are pending (not yet resolved) for a given organization and repository
mode: read
serviceName: github
args: page_size_in integer, page_offset_in integer, organization_in text, repository_in text, sha_in text, pull_request_number_in integer
returns: table (organization text, repository text, sha text, task_group_id text, state text, created timestamptz, updated timestamptz, installation_id integer, event_type text, event_id text, pull_request_number integer, etag uuid)
body: |-
begin
return query
select
github_builds.organization,
github_builds.repository,
github_builds.sha,
github_builds.task_group_id,
github_builds.state,
github_builds.created,
github_builds.updated,
github_builds.installation_id,
github_builds.event_type,
github_builds.event_id,
github_builds.pull_request_number,
public.gen_random_uuid()
from github_builds
where
github_builds.organization = organization_in and
github_builds.repository = repository_in and
(sha_in is null or github_builds.sha = sha_in) and
(pull_request_number_in is null or github_builds.pull_request_number = pull_request_number_in) and
github_builds.state in ('pending')
order by github_builds.updated asc
limit get_page_limit(page_size_in)
offset get_page_offset(page_offset_in);
end