mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
7.3 KiB
7.3 KiB
PR Summary: Convert TODO Items to GitHub Issues
Overview
This PR enhances the existing populate-kanban.py script with new features, comprehensive testing, automation workflows, and documentation to make converting TODO items to GitHub issues easier and more flexible.
What Was Added
1. Enhanced populate-kanban.py Script
New Filtering Options:
--filter-priority [critical|high|medium|low]- Filter by priority level--filter-label <label>- Filter by label (e.g., security, frontend)--exclude-checklist- Exclude checklist items from sections like "Done Criteria"
Benefits:
- Create issues incrementally (e.g., start with critical items only)
- Focus on specific areas (e.g., security-related tasks)
- Reduce noise by excluding procedural checklists
2. New check-new-todos.py Script
Features:
- Track baseline state of TODO items
- Detect new TODOs added since baseline
- Report what changed and where
- Exit code indicates presence of new items (useful for CI)
Use Cases:
- CI/CD integration to detect new TODOs in PRs
- Track TODO growth over time
- Know exactly which items are new for issue creation
3. Comprehensive Test Suite
test_populate_kanban.py:
- 15 unit tests covering all major functionality
- Tests parsing, categorization, filtering, edge cases
- 100% passing rate
Coverage:
- TODO extraction from markdown
- Priority assignment logic
- Label categorization
- Context extraction
- Section tracking
- Special file exclusion
4. NPM Scripts (10 new commands)
Convenient shortcuts from repository root:
npm run todos:preview # Preview 10 issues
npm run todos:test # Run test suite
npm run todos:export # Export all to JSON
npm run todos:export-critical # Export critical only
npm run todos:export-filtered # Export excluding checklists
npm run todos:check # Check for new TODOs
npm run todos:baseline # Save TODO baseline
npm run todos:create # Create GitHub issues
npm run todos:help # Show all options
npm run todos:scan # Run TODO scan report
5. GitHub Action Workflow
.github/workflows/todo-to-issues.yml:
- Manually triggered workflow with configurable options
- Supports all filtering options
- Can run dry-run, export JSON, or create issues
- Automatic artifact upload for JSON exports
- Creates workflow summary with results
Workflow Inputs:
- Mode: dry-run, export-json, or create-issues
- Filter by priority
- Filter by label
- Exclude checklist items
- Limit number of items
6. Comprehensive Documentation
New Guides:
docs/guides/TODO_TO_ISSUES.md- Complete user guide with examples- Updated
tools/project-management/README.md- Technical reference
Documentation Includes:
- Quick start guide
- Usage examples for all filters
- Combining multiple filters
- Batch creation strategies
- Troubleshooting common issues
- CI/CD integration examples
- NPM scripts reference
7. Configuration Updates
- Updated
.gitignoreto exclude TODO baseline and export files - Enhanced
package.jsonwith convenience scripts - All scripts have proper shebangs and are executable
Statistics
Current TODO State:
- Total files: 20 markdown files
- Total items: 775 TODO items
- Breakdown:
- 🔴 Critical: 40 items (5%)
- 🟠 High: 386 items (50%)
- 🟡 Medium: 269 items (35%)
- 🟢 Low: 80 items (10%)
With Filters:
- Excluding checklists: ~763 items (12 fewer)
- Critical only: 40 items
- Security label: ~40 items
Example Usage Scenarios
Scenario 1: Start Small (Critical Items)
# Preview critical items
python3 tools/project-management/populate-kanban.py --filter-priority critical --dry-run
# Create critical items only (40 issues)
python3 tools/project-management/populate-kanban.py --filter-priority critical --create
Scenario 2: Focus on Security
# Export security-related items to review
npm run todos:export
cat todos.json | jq '[.[] | select(.labels | contains(["security"]))]' > security.json
# Or use built-in filter
python3 tools/project-management/populate-kanban.py --filter-label security --create
Scenario 3: Track New TODOs in CI
# .github/workflows/pr-check.yml
- name: Check for new TODOs
run: |
npm run todos:check
if [ $? -eq 1 ]; then
echo "::warning::New TODO items detected. Consider creating issues."
fi
Scenario 4: Exclude Procedural Checklists
# Create issues but skip "Done Criteria" type checklists
python3 tools/project-management/populate-kanban.py --exclude-checklist --create
Testing
All functionality has been thoroughly tested:
# Run test suite
npm run todos:test
# Result: 15 tests, 15 passed
# Test filtering
python3 tools/project-management/populate-kanban.py --filter-priority critical --dry-run --limit 3
# Result: Shows 3 critical priority items
# Test baseline tracking
npm run todos:baseline
npm run todos:check
# Result: No new items detected
Migration Notes
No Breaking Changes:
- All existing functionality preserved
- Original command-line interface unchanged
- New options are additive only
- Existing scripts and documentation still valid
Enhancements Only:
- More filtering options
- Better monitoring capabilities
- Improved automation support
- More comprehensive documentation
Files Changed
Added:
tools/project-management/check-new-todos.py(new script, 142 lines)tools/project-management/test_populate_kanban.py(test suite, 312 lines)docs/guides/TODO_TO_ISSUES.md(user guide, 349 lines).github/workflows/todo-to-issues.yml(workflow, 165 lines)
Modified:
tools/project-management/populate-kanban.py(added filtering, +38 lines)tools/project-management/README.md(comprehensive update, +162 lines)package.json(added scripts, +10 lines).gitignore(added TODO patterns, +4 lines)
Total:
- ~1,182 lines added
- 4 new files
- 4 files modified
- 0 files deleted
Benefits
- Flexibility: Create issues incrementally by priority or area
- Automation: GitHub Action for automated conversion
- Monitoring: Track TODO growth and detect new items
- Quality: Comprehensive test coverage ensures reliability
- Documentation: Complete guides for all use cases
- Convenience: NPM scripts make commands memorable
- CI/CD Ready: Exit codes and baseline tracking for automation
Next Steps
After this PR is merged:
- Initial Baseline: Run
npm run todos:baselineto establish baseline - Start Small: Create critical issues first:
python3 tools/project-management/populate-kanban.py --filter-priority critical --create - Monitor Growth: Add check to PR workflow to detect new TODOs
- Incremental Creation: Create issues in batches by priority/label
- Update TODOs: Mark completed items with
[x]and issue references
Related Documentation
- KANBAN_READY.md - Original implementation summary
- docs/guides/TODO_TO_ISSUES.md - Complete user guide
- tools/project-management/README.md - Technical reference
- docs/todo/README.md - TODO system overview
Questions?
See the documentation files above or run:
npm run todos:help
python3 tools/project-management/check-new-todos.py --help