Skip to content

feat: collect PR reviews and merged_at - #167

Open
maxulysse wants to merge 5 commits into
mainfrom
karma
Open

maxulysse wants to merge 5 commits into
mainfrom
karma

Conversation

@maxulysse

@maxulysse maxulysse commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Collects PR reviews again and stores PR merge times, as data for a karma leaderboard. The earlier review stats (#72) hit rate limits by fetching reviews for every PR on every run; here only PRs updated since the last run are fetched.

  • issue_stats fetches the reviews of PRs updated since REVIEWS_SINCE (2026-11-13) (GET /pulls/{n}/reviews) into the nested issue_stats__reviews table: reviewer, state, submitted_at. The date bound keeps full-history loads, like the PR smoke run (~16.5k PRs), within the rate limit.
  • issue_stats stores merged_at.
  • Removes the unused github_source().
  • Mentions issue_stats__reviews in CLAUDE.md and pipeline/README.md.

Costs one extra REST call per updated PR (~190 on a busy day). Tested issue_stats on nf-core/sarek against a local DuckDB, including a rerun without duplicates.

🤖 Generated with Claude Code

maxulysse and others added 2 commits November 13, 2026 14:33
main() builds its own resource list, so github_source was never called.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New pr_reviews resource collects PR reviews through GitHub GraphQL search,
incrementally from 2026-11-13, and issue_stats now stores merged_at.
karma.sql scores merged PRs (3), reviews of others' PRs (2) and opened
issues (1), excluding bot and LLM accounts; pages/code/karma.md shows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@maxulysse
maxulysse requested a review from a team as a code owner November 13, 2026 13:34
karma.sql reads merged_at and github.pr_reviews, which only exist in
production after this pipeline change has run there, so the sources
check cannot pass until then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@maxulysse maxulysse changed the title feat: karma leaderboard with PR review collection feat: collect PR reviews and merged_at Nov 13, 2026
maxulysse and others added 2 commits November 13, 2026 16:05
issue_stats already reads every PR updated since its last run, so it now
fetches their reviews into issue_stats__reviews. This replaces the
separate GraphQL pr_reviews resource and its helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One reviews call per PR is too many for a full-history load: the PR smoke
run reads 25 repos with ~16.5k PRs, three times the hourly REST limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@edmundmiller
edmundmiller added this pull request to stack #183 November 24, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant