diff --git a/reports/pages/issues.md b/reports/pages/issues.md index a77a3bf..275d17f 100644 --- a/reports/pages/issues.md +++ b/reports/pages/issues.md @@ -1,5 +1,114 @@ --- title: Analyzing Issues +sources: + - issues.sql --- -Coming soon! You could contribute this page! +In the last hours there have been events across repositories! This has involved contributors opening and closing issues, and respectively. + + + + + + + + + + + + + + + + + + + + + + + + + + +## Issue Sample +```sql issuesraw +select * from ${issues} limit 100 +``` +
+ +```sql issue_summary +select + count(1)::INT as issues, + count(distinct actor_id)::INT as actor_count, + count(distinct repo_id)::INT as repo_count, + date_diff('hour', min(event_created_at)::TIMESTAMPTZ, now()::TIMESTAMPTZ) as last_hours, + count(1) filter(where issue_action = 'opened')::INT as opened_events, + count(1) filter(where issue_action = 'closed')::INT as closed_events, + from ${issues} + +``` + +```sql issue_count + select count(1) as issues, + count(1) - count(1) filter(where issue_created_at < now() AT TIME ZONE 'UTC' - interval '1 Day') as count_day_prior, + from ${issues} + group by all +``` + +```sql issue_count_hour + select + date_trunc('hour', event_created_at) as hour_of_day, + case + when issue_action = 'opened' then 'Opened' + when issue_action = 'closed' then 'Closed' + else 'Unknown' + end as issue_action, + count(1) as issues, + from ${issues} + group by all + order by all + +``` + +```sql issues_per_repo +select + repo_name, + issue_repo_url, + count(distinct issue_id) as number_of_issues, + count(distinct actor_id) as actors, + count(1) filter(where issue_action = 'opened') as opened_events, + count(1) filter(where issue_action = 'closed') as closed_events, +from ${issues} +group by all +having number_of_issues > 2 +order by 2 desc +``` + +
diff --git a/reports/sources/issues.sql b/reports/sources/issues.sql new file mode 100644 index 0000000..c13dfcc --- /dev/null +++ b/reports/sources/issues.sql @@ -0,0 +1 @@ +select * from issue_events