5 PR Metrics on 303 Merged PRs from pytest and pydantic: 2 Point at Review Bottlenecks
说明与用途
Python脚本收集pytest和pydantic仓库的PR指标,以评估审查是否是交付更改的瓶颈。
问题
Determine if review is the slow part of shipping a change by analyzing PR metrics.
结果
Script outputs 303 PR records with metrics such as first review time, merge time, approval-to-merge time, review comments, cycles, and changed lines for pytest and pydantic repositories.
工作流
- 1. Set repository and date window (90 days).
- 2. Authenticate with GitHub API using GITHUB_TOKEN.
- 3. Retrieve closed PRs sorted by updated date.
- 4. Filter PRs merged within the window and exclude bots.
- 5. For each PR, collect author, creation and merge times, reviews, approvals, comments, cycles, and changed lines.
- 6. Calculate time to first review, total merge time, time from last approval to merge, and other metrics.
- 7. Append data to rows list.
- 8. Output rows as JSON file.
证据
All numbers below come from the GitHub REST API, and you can rerun the script to check them.
The script produces JSON with metrics for 303 merged PRs from pytest and pydantic.
- 记录日期: 2026-10-22T14:11:26.467Z