Commit Graph

1 Commits

Author SHA1 Message Date
Alexander Whitestone
73bbcd31f7 feat: Add forge cleanup tools and documentation (#1128)
Some checks failed
CI / test (pull_request) Failing after 58s
CI / validate (pull_request) Failing after 29s
Review Approval Gate / verify-review (pull_request) Failing after 5s
## Summary
Implements forge cleanup tools and documentation as requested in issue #1128.
Builds on the cleanup work done in issue #1127 and documented in #1128.

## Changes

### 1. Documentation
- **docs/forge-cleanup-analysis.md**: Detailed analysis of duplicate PRs and cleanup recommendations
- **docs/forge-cleanup-report.md**: Comprehensive cleanup report with metrics and next steps
- **scripts/README.md**: Documentation for the cleanup script

### 2. Tools
- **scripts/cleanup-duplicate-prs.sh**: Automated script for detecting and closing duplicate PRs
- **.github/workflows/pr-duplicate-check.yml**: GitHub Action for automated duplicate detection

## Features

### cleanup-duplicate-prs.sh
- **Issue-based grouping**: Groups PRs by issue number extracted from titles
- **Date-based selection**: Keeps the newest PR, closes older duplicates
- **Dry-run mode**: Shows what would be done without making changes
- **Stale PR detection**: Identifies PRs older than 30 days with no activity
- **Explanatory comments**: Adds comments when closing PRs to explain why

### GitHub Action Workflow
- **Weekly schedule**: Runs every Monday at 9 AM UTC
- **Manual trigger**: Can be run on-demand via workflow_dispatch
- **Automatic issue creation**: Creates issues when duplicates are found
- **Dry-run by default**: Safe to run without making changes

## Testing
- Script syntax validated
- Dry-run mode tested successfully
- No duplicate PRs currently found (cleanup already done)

## Acceptance Criteria
 Tools for detecting duplicate PRs
 Documentation of cleanup process
 Automated workflow for ongoing maintenance
 Safe dry-run mode for testing
 Explanatory comments when closing PRs

## Related Issues
- #1128: [RESOLVED] Forge Cleanup — PRs Closed, Milestones Deduplicated, Policy Issues Filed
- #1127: Evening triage pass (predecessor to #1128)

Issue: #1128
2026-04-13 21:44:53 -04:00