Thanks to visit codestin.com
Credit goes to github.com

Skip to content

k-macmillan/pr-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purpose

This tool was created to have a rough estimate of how long it took PRs to go from Ready for Review until a Merged state for a given time period. At some point it would be nice to graph this data and compare it to DevEx changes.

Installation

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

GH CLI

Follow the instructions located here to install and setup the Github CLI. This will give the script everything your user has access to, however, this script only queries PR/issue data.

Set the Config

Modify the config for data you would like to see. Keep it small for the first lookup.

Run the Script

python pr_data.py

Example Output

The tqdm output shows progress, how long it took to run (5 seconds below), and how many iterations per second were accomplished.

100%|████████████████████████████████████████████████████████████████| 14/14 [00:05<00:00,  2.46it/s]
department-of-veterans-affairs/notification-api 2025-04-01..2025-04-15 Total PRs: 10
department-of-veterans-affairs/notification-api 2025-04-01..2025-04-15 Total minutes: 5080
department-of-veterans-affairs/notification-api 2025-04-01..2025-04-15 Average minutes: 508
department-of-veterans-affairs/notification-api 2025-04-01..2025-04-15 Median minutes: 62

There were 14 PRs merged in the date range but only 10 were drafts turned ready for review, had the correct number of approvals, and a merge. The 4 may have been closed, pushed through by an admin, or a bot that can automerge if the checks pass.

Notes

This was implemented with both shell scripts that used the gh CLI and an all python implementation. The python implementation, using PyGithub, was about 5x slower and required generation of a PAT. Data between the two was slightly different as well, probably due to the python package using Github's REST API and the gh cli using GraphQL API.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published