Skip to content

Commit b55dee9

Browse files
Missing commits util scripts
Signed-off-by: Lukasz Gryglicki <[email protected]>
1 parent 0b9c99a commit b55dee9

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

util_sql/list_missing_commits.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SELECT
2+
p.dup_repo_name, p.dup_actor_login, p.dup_created_at,
3+
p.event_id, p.push_id, p.ref, p.head, p.befor, p.size
4+
FROM gha_payloads p
5+
WHERE p.dup_type = 'PushEvent'
6+
AND NOT EXISTS (
7+
SELECT 1
8+
FROM gha_commits c
9+
WHERE c.event_id = p.event_id
10+
)
11+
ORDER BY p.dup_repo_name ASC, p.dup_created_at ASC, p.event_id ASC;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- clear && k exec -in devstats-prod devstats-postgres-0 -c devstats-postgres -- psql allprj < util_sql/list_missing_commits_per_repo.sql
2+
SELECT
3+
p.dup_repo_id,
4+
p.dup_repo_name,
5+
COUNT(*) AS missing_push_events,
6+
MIN(p.dup_created_at) AS missing_since,
7+
MAX(p.dup_created_at) AS missing_until,
8+
(MAX(p.dup_created_at) - MIN(p.dup_created_at)) AS span
9+
FROM gha_payloads p
10+
WHERE p.dup_type = 'PushEvent'
11+
AND NOT EXISTS (
12+
SELECT 1
13+
FROM gha_commits c
14+
WHERE c.event_id = p.event_id
15+
)
16+
GROUP BY
17+
p.dup_repo_id, p.dup_repo_name
18+
ORDER BY
19+
missing_push_events DESC,
20+
span DESC;
21+

0 commit comments

Comments
 (0)