## Summary Added tools and process for managing PR backlog in timmy-config. ## Problem timmy-config has 31+ open PRs, the highest in the organization. This creates confusion, slows down development, and increases merge conflicts. ## Solution Created automated tools and process for PR backlog management: ### 1. PR Backlog Analyzer (`scripts/pr-backlog-analyzer.py`) - Fetches all open PRs from timmy-config - Analyzes age, review status, labels - Generates markdown report - Categorizes PRs: stale, needs review, approved, changes requested ### 2. GitHub Actions Workflow (`.github/workflows/pr-backlog-management.yml`) - Runs weekly on Monday at 10 AM UTC - Analyzes PR backlog - Creates issue if backlog is high (>10 stale PRs) - Uploads report as artifact ### 3. Documentation (`docs/pr-backlog-process.md`) - Weekly analysis process - Review stale PRs procedure - Merge approved PRs workflow - Review pending PRs SLA - Close duplicate PRs process - Metrics to track - Escalation procedures ## Usage ### Run Analyzer ```bash python scripts/pr-backlog-analyzer.py ``` ### View Report ```bash cat reports/pr-backlog-$(date +%Y%m%d).md ``` ## Metrics - **Current**: 32 open PRs in timmy-config - **Target**: <20 open PRs - **SLA**: Review within 48 hours, merge within 7 days Issue: #1470
3.4 KiB
3.4 KiB
PR Backlog Management Process
Overview
This document outlines the process for managing PR backlog in the Timmy Foundation repositories, specifically addressing the high PR backlog in timmy-config.
Current State
As of the latest analysis:
- timmy-config: 31 open PRs (highest in org)
- the-nexus: Multiple PRs for same issues
- hermes-agent: Moderate PR count
Process
1. Weekly Analysis
Run the PR backlog analyzer weekly:
python scripts/pr-backlog-analyzer.py
This generates a report in reports/pr-backlog-YYYYMMDD.md.
2. Review Stale PRs
PRs older than 30 days are considered stale. For each stale PR:
- Check relevance: Is the PR still needed?
- Check conflicts: Does it conflict with current main?
- Check activity: Has there been recent activity?
- Action: Close, update, or merge
3. Merge Approved PRs
PRs with approvals should be merged within 7 days:
- Verify CI: Ensure all checks pass
- Verify review: At least 1 approval
- Merge: Use squash merge for clean history
- Delete branch: Clean up after merge
4. Review Pending PRs
PRs waiting for review should be reviewed within 48 hours:
- Assign reviewer: Ensure someone is responsible
- Review: Check code quality, tests, documentation
- Approve or request changes: Don't leave PRs in limbo
- Follow up: If no response in 48 hours, escalate
5. Close Duplicate PRs
Multiple PRs for the same issue should be consolidated:
- Identify duplicates: Same issue number or similar changes
- Keep newest: Usually the most up-to-date
- Close older: With explanatory comments
- Document: Update issue with which PR was kept
Automation
GitHub Actions Workflow
The pr-backlog-management.yml workflow runs weekly to:
- Analyze all open PRs
- Generate a report
- Create an issue if backlog is high (>10 stale PRs)
Manual Trigger
The workflow can be triggered manually via GitHub Actions UI.
Metrics
Track these metrics weekly:
- Total open PRs: Should be <20 per repo
- Stale PRs: Should be <5 per repo
- Average PR age: Should be <14 days
- Time to review: Should be <48 hours
- Time to merge: Should be <7 days after approval
Escalation
If backlog exceeds thresholds:
- Level 1: Automated issue created
- Level 2: Team lead notified
- Level 3: Organization-wide cleanup sprint
Tools
PR Backlog Analyzer
# Run analysis
python scripts/pr-backlog-analyzer.py
# View report
cat reports/pr-backlog-$(date +%Y%m%d).md
Manual Cleanup
# List stale PRs
curl -s -H "Authorization: token $GITEA_TOKEN" "https://forge.alexanderwhitestone.com/api/v1/repos/Timmy_Foundation/timmy-config/pulls?state=open" | jq -r '.[] | select(.created_at < "'$(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%SZ)'") | .number'
# Close a PR
curl -s -X PATCH -H "Authorization: token $GITEA_TOKEN" -H "Content-Type: application/json" -d '{"state": "closed"}' "https://forge.alexanderwhitestone.com/api/v1/repos/Timmy_Foundation/timmy-config/pulls/123"
Success Criteria
- Short-term: Reduce timmy-config PRs from 31 to <20
- Medium-term: Maintain <15 open PRs across all repos
- Long-term: Automated PR lifecycle management
Related
- Issue #1470: process: Address timmy-config PR backlog (9 PRs - highest in org)
- Issue #1127: Evening triage pass
- Issue #1128: Forge Cleanup