imjasonh / ideas

A place for me to file issues against myself for things I want to build when I'm bored
5 stars 0 forks source link

Show recent public GitHub issues locked as "too heated" #97

Open imjasonh opened 2 years ago

imjasonh commented 2 years ago

Sometimes popular projects lock issues for being too contentious, and usually people just piling on meaningless "+1"s or "why haven't you fixed this yet you dummies" or whatever.

If this is too spammy you could filter for issues that have >N comments or unique commenters, or are for repos with lots of watchers/stars/forks.

If you don't care about immediate gratification, you could periodically (daily?) query the public BigQuery dataset provided by https://www.gharchive.org/ and send an email or something.

In fact, this is almost definitely going to be easier.

SELECT
  repo,
  login,
  url,
  title,
  reason
FROM (
  SELECT
    repo.name AS repo,
    actor.login AS login,
    JSON_EXTRACT(payload,
      '$.issue.html_url') AS url,
    JSON_EXTRACT(payload,
      '$.issue.active_lock_reason') AS reason,
    JSON_EXTRACT(payload,
      '$.issue.title') AS title
  FROM
    `githubarchive.month.202109`
  WHERE
    type = 'IssuesEvent' )
WHERE
  reason LIKE '%too heated%'
LIMIT
  10;

returns all locked-as-too-heated issues last month (well, 10 of them).

Screen Shot 2021-10-29 at 4 57 31 PM

I could filter and sort until it's a nice little digest of internet drama. I could run this weekly/monthly/whatever on GHA and send me an email. I should see how much this is costing me in BQ bucks. 💰

imjasonh commented 2 years ago

This seems to be a good monthly query:

SELECT
  url,
  login as closer,
  title,
  num_comments
FROM (
  SELECT
    repo.name AS repo,
    actor.login AS login,
    JSON_EXTRACT(payload,
      '$.issue.html_url') AS url,
    JSON_EXTRACT(payload,
      '$.issue.active_lock_reason') AS reason,
    JSON_EXTRACT(payload,
      '$.issue.comments') as num_comments,
    JSON_EXTRACT(payload,
      '$.issue.title') AS title
  FROM
    `githubarchive.month.202110`
  WHERE
    type = 'IssuesEvent')
WHERE
  reason LIKE '%too heated%'
  AND PARSE_NUMERIC(num_comments) > 10
ORDER BY num_comments DESC
Screen Shot 2021-11-04 at 6 01 40 PM

From here I could probably set up a GitHub Action to run at the beginning of a month (using 🌟OIDC magic🌟), query for last month's issues, and fail the run to send me an email. It's not pretty but it'd work 🤷