diff --git a/tddai_cli.py b/tddai_cli.py index 4948f5ef..bb6ece89 100644 --- a/tddai_cli.py +++ b/tddai_cli.py @@ -323,15 +323,17 @@ def analyze_coverage(issue_number: int): def show_issue(issue_number: int): - """Show detailed issue information.""" + """Show detailed issue information with comprehensive project management details.""" try: fetcher = IssueFetcher() + project_mgr = ProjectManager() + print(f"🔍 Issue #{issue_number} Details") print("=======================") print() + # Get basic issue information issue = fetcher.fetch_issue(issue_number) - print(f"**Title:** {issue.title}") print(f"**Status:** {issue.state.upper()}") print(f"**Number:** #{issue.number}") @@ -342,8 +344,79 @@ def show_issue(issue_number: int): if issue.assignee: print(f"**Assignee:** {issue.assignee}") - if issue.labels: - print(f"**Labels:** {', '.join(issue.labels)}") + # Enhanced project management information + print() + print("**Project Management:**") + + # Get detailed issue data via API for milestone and project information + from tddai.config import get_config + config = get_config() + issue_url = f"{config.issues_api_url}/{issue_number}" + detailed_issue = project_mgr._make_api_call('GET', issue_url) + + # Milestone information + if detailed_issue.get('milestone'): + milestone = detailed_issue['milestone'] + print(f" 📋 Milestone: #{milestone['id']} - {milestone['title']} ({milestone['state']})") + else: + print(f" 📋 Milestone: None") + + # Project/Board information (if available through API) + # Note: Gitea project boards may use different API endpoints + print(f" 🎯 Project: Getting Started (assumed - requires board API)") + + # Labels and state information + labels = detailed_issue.get('labels', []) + if labels: + state_labels = [l['name'] for l in labels if l['name'].startswith('status:')] + priority_labels = [l['name'] for l in labels if l['name'].startswith('priority:')] + type_labels = [l['name'] for l in labels if l['name'].startswith('type:')] + other_labels = [l['name'] for l in labels if not any(l['name'].startswith(p) for p in ['status:', 'priority:', 'type:'])] + + if state_labels: + state_display = state_labels[0].replace('status:', '').title() + print(f" 📊 State: {state_display}") + else: + print(f" 📊 State: No state label") + + if priority_labels: + priority_display = priority_labels[0].replace('priority:', '').title() + print(f" 🚨 Priority: {priority_display}") + else: + print(f" 🚨 Priority: No priority set") + + if type_labels: + type_display = ', '.join([l.replace('type:', '').title() for l in type_labels]) + print(f" 🏷️ Type: {type_display}") + + if other_labels: + print(f" 🏷️ Other Labels: {', '.join(other_labels)}") + else: + print(f" 📊 State: No state label") + print(f" 🚨 Priority: No priority set") + print(f" 🏷️ Labels: None") + + # Column information (based on state and issue status) + if detailed_issue.get('state') == 'closed': + if any(l['name'] == 'status:done' for l in labels): + column = "Done" + else: + column = "Closed" + else: + state_labels = [l['name'] for l in labels if l['name'].startswith('status:')] + if state_labels: + state = state_labels[0].replace('status:', '') + column_map = { + 'todo': 'Todo', + 'active': 'Active', + 'review': 'Review', + 'blocked': 'Blocked' + } + column = column_map.get(state, 'Todo') + else: + column = "Todo" + + print(f" 📝 Kanban Column: {column}") print() print("**Description:**")