feat: Complete Issue #79 - Provide tddai issue_closer.py

Add dedicated issue closing functionality for easier issue management:

📄 New Module: tddai/issue_closer.py
• Dedicated IssueCloser class with programmatic API
• Command-line interface for manual and batch issue closure
• Enhanced functionality beyond existing tddai_cli.py close-issue
• Support for standardized completion messages
• Batch closure capability for multiple issues

🔧 Makefile Integration:
• close-issue-enhanced - Enhanced single issue closure with work completion
• close-issues-batch - Batch closure for multiple issues
• Proper help documentation and .PHONY declarations

 Key Features:
• Simple programmatic interface: IssueCloser().close_issue(42, "comment")
• CLI with multiple closure modes: comment, work-completed, batch
• Integration with existing tddai framework and issue tracking backends
• Comprehensive error handling and user feedback
• Verbose mode for detailed operation tracking

📋 Usage Examples:
• python3 tddai/issue_closer.py 42 -w "All tests passing"
• python3 tddai/issue_closer.py 42 43 44 -c "Batch closure"
• make close-issue-enhanced NUM=42 WORK="Implementation complete"
• make close-issues-batch NUMS="42 43 44" COMMENT="Sprint completion"

Provides the missing tddai function to close issues more easily with the selected issue tracking backend.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-02 22:30:53 +02:00
parent bddebbe005
commit bf84f206fe
2 changed files with 222 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
# MarkiTect - Advanced Markdown Engine
# Makefile for common development tasks
.PHONY: help setup install test build clean update status dev lint format check-deps venv-status update-digest add-diary-entry list-issues show-issue list-open-issues close-issue test-from-issue tdd-start tdd-add-test tdd-finish tdd-status test-status test-new test-coverage test-arch test-foundation test-infrastructure test-integration test-domain test-service test-application test-presentation test-quick test-layers test-random test-random-seed test-random-repeat test-install-randomly test-clean test-tdd test-changed test-module test-cache-clean test-efficient cli-help
.PHONY: help setup install test build clean update status dev lint format check-deps venv-status update-digest add-diary-entry list-issues show-issue list-open-issues close-issue close-issue-enhanced close-issues-batch test-from-issue tdd-start tdd-add-test tdd-finish tdd-status test-status test-new test-coverage test-arch test-foundation test-infrastructure test-integration test-domain test-service test-application test-presentation test-quick test-layers test-random test-random-seed test-random-repeat test-install-randomly test-clean test-tdd test-changed test-module test-cache-clean test-efficient cli-help
# Default target
help:
@@ -66,7 +66,9 @@ help:
@echo " list-issues - Show all gitea issues with status and priority"
@echo " list-open-issues - Show only open issues (active backlog)"
@echo " show-issue NUM=X - Show detailed view of specific issue"
@echo " close-issue NUM=X - Close an issue and mark as completed"
@echo " close-issue NUM=X [COMMENT='reason'] - Close an issue and mark as completed"
@echo " close-issue-enhanced NUM=X [WORK='description'] - Close issue with enhanced tddai/issue_closer.py"
@echo " close-issues-batch NUMS='X Y Z' [COMMENT='reason'] - Close multiple issues at once"
@echo " issues-get - Export compact issue index to ISSUES.index"
@echo " issues-csv - Export issues as CSV for spreadsheet processing"
@echo " issues-json - Export issues as JSON for programmatic processing"
@@ -343,11 +345,46 @@ close-issue: $(VENV)/bin/activate
echo "❌ Please specify issue number: make close-issue NUM=5"; \
exit 1; \
fi
@echo "🔄 Closing issue #$(NUM)..."
@echo " Setting issue state to 'done'..."
@PYTHONPATH=. $(VENV_PYTHON) tddai_cli.py set-issue-state $(NUM) done
@if [ -n "$(COMMENT)" ]; then \
echo "🔄 Closing issue #$(NUM) with comment..."; \
PYTHONPATH=. $(VENV_PYTHON) tddai_cli.py close-issue $(NUM) --comment "$(COMMENT)"; \
else \
echo "🔄 Closing issue #$(NUM)..."; \
PYTHONPATH=. $(VENV_PYTHON) tddai_cli.py close-issue $(NUM); \
fi
@echo "✅ Issue #$(NUM) closed successfully!"
# Close issue using dedicated issue_closer.py script (enhanced functionality)
close-issue-enhanced: $(VENV)/bin/activate
@if [ -z "$(NUM)" ]; then \
echo "❌ Please specify issue number: make close-issue-enhanced NUM=5"; \
exit 1; \
fi
@if [ -n "$(WORK)" ]; then \
echo "🔄 Closing issue #$(NUM) with completion message..."; \
PYTHONPATH=. $(VENV_PYTHON) tddai/issue_closer.py $(NUM) --work-completed "$(WORK)"; \
elif [ -n "$(COMMENT)" ]; then \
echo "🔄 Closing issue #$(NUM) with comment..."; \
PYTHONPATH=. $(VENV_PYTHON) tddai/issue_closer.py $(NUM) --comment "$(COMMENT)"; \
else \
echo "🔄 Closing issue #$(NUM)..."; \
PYTHONPATH=. $(VENV_PYTHON) tddai/issue_closer.py $(NUM); \
fi
# Close multiple issues at once using issue_closer.py
close-issues-batch: $(VENV)/bin/activate
@if [ -z "$(NUMS)" ]; then \
echo "❌ Please specify issue numbers: make close-issues-batch NUMS='42 43 44'"; \
exit 1; \
fi
@if [ -n "$(COMMENT)" ]; then \
echo "🔄 Closing issues $(NUMS) with comment..."; \
PYTHONPATH=. $(VENV_PYTHON) tddai/issue_closer.py $(NUMS) --comment "$(COMMENT)"; \
else \
echo "🔄 Closing issues $(NUMS)..."; \
PYTHONPATH=. $(VENV_PYTHON) tddai/issue_closer.py $(NUMS); \
fi
# Export compact issue index to ISSUES.index file (TSV format)
issues-get: $(VENV)/bin/activate
@echo "📋 Fetching issue index from gitea..."