diff --git a/reports/pages/issues.md b/reports/pages/issues.md index a77a3bf..739f657 100644 --- a/reports/pages/issues.md +++ b/reports/pages/issues.md @@ -1,5 +1,154 @@ --- 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. + + was the top contributor with issues added to repository! + +
+
+ + + + + + + + + +### Issues by hour + + + + + + +### Issues summary by repo + + + + + + + + +## Issue Sample +```sql issuesraw +select * from ${issues} limit 100 + +``` + +
+ +_The longest content issue in the data set reads:_ +
+
+ +```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 top_actor + select + actor_login, + count(1) as actor_events, + from ${issues} + group by all + having actor_events>1 + order by actor_login desc + limit 1 +``` + +```sql top_actor_repo + select repo_name, + count(1) as repo_events + from ${issues} + where actor_login = (select actor_login from ${top_actor}) + group by all + limit 1 +``` + + +```sql issue_content_len + select + left(issue_body, 400) as content_summary, + issue_body, + length(issue_body) as issue_body_len, + from ${issues} + group by all + order by issue_body_len desc + limit 1 +``` + +```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 issue_action + 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..47bda6b --- /dev/null +++ b/reports/sources/issues.sql @@ -0,0 +1 @@ +select * from octocatalog.issue_events