A Node.js tool to analyze pull request review cycle times from GitHub repositories. This tool helps teams understand their code review processes and identify bottlenecks in their development workflow.
- 📊 Analyze PR review cycle times across repositories
- 📈 Generate detailed metrics and reports
- 📋 Export data to CSV for further analysis
- 🎯 Filter by date ranges, authors, and reviewers
- 📦 CLI interface for easy integration
- Clone this repository:
git clone <your-repo-url>
cd pr-review-cycle-time- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env
# Edit .env with your GitHub token and settingsCreate a .env file with the following variables:
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_ORG=your_organization_name
GITHUB_REPO=your_repository_name- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate a new token with
reposcope - Copy the token to your
.envfile
# Analyze PRs from the last 30 days
npm start
# Analyze specific repository
npm start -- --repo owner/repository
# Analyze specific date range
npm start -- --from 2024-01-01 --to 2024-01-31
# Export to CSV
npm start -- --export data/pr-metrics.csv--repo <owner/repo>: Target repository (default: from .env)--from <date>: Start date (YYYY-MM-DD format)--to <date>: End date (YYYY-MM-DD format)--export <file>: Export results to CSV file--help: Show help information
- Time to First Review: Time from PR creation to first review
- Time to Approval: Time from PR creation to approval
- Time to Merge: Time from PR creation to merge
- Review Cycles: Number of review rounds
- Contributors: Number of unique reviewers
├── src/
│ └── index.js # Main CLI application
├── lib/
│ ├── github-client.js # GitHub API wrapper
│ └── pr-analyzer.js # PR analysis logic
├── config/
│ └── default.js # Configuration defaults
├── data/ # Output directory for exports
└── README.md
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
ISC