@@ -214,71 +214,42 @@ def generate_sprint_report(all_data, week_range):
214214 md .append (f"- Due Date: { milestone ['due_on' ][:10 ]} \n " )
215215 md .append ("\n " )
216216
217- # Issues Breakdown
217+ # Issues Table
218218 if issues :
219- md .append ("### Issues Activity \n \n " )
219+ md .append ("### Issues\n \n " )
220220
221221 open_issues = [i for i in issues if i ['state' ] == 'open' ]
222222 closed_issues = [i for i in issues if i ['state' ] == 'closed' ]
223223
224- md .append (f"**Status :** { len (open_issues )} Open | { len (closed_issues )} Closed\n \n " )
224+ md .append (f"**Summary :** { len (open_issues )} Open | { len (closed_issues )} Closed\n \n " )
225225
226- # Type breakdown
227- type_counts = Counter ([categorize_issue (i ) for i in issues ])
228- md .append ("**By Type:**\n " )
229- for issue_type , count in type_counts .most_common ():
230- md .append (f"- { issue_type .capitalize ()} : { count } \n " )
231- md .append ("\n " )
232-
233- # Priority breakdown
234- priority_counts = Counter ([get_issue_priority (i ) for i in issues ])
235- md .append ("**By Priority:**\n " )
236- for priority , count in sorted (priority_counts .items (), key = lambda x : {'Critical' : 0 , 'High' : 1 , 'Medium' : 2 , 'Low' : 3 }.get (x [0 ], 4 )):
237- md .append (f"- { priority } : { count } \n " )
238- md .append ("\n " )
239-
240- # Detailed issue list
241- md .append ("### Issue Details\n \n " )
226+ # Issues table
227+ md .append ("| # | Title | Status | Type | Priority | Creator | Assigned To | Created | Completed | Time |\n " )
228+ md .append ("|---|-------|--------|------|----------|---------|-------------|---------|-----------|------|\n " )
242229
243230 for issue in sorted (issues , key = lambda x : x ['number' ]):
244- status = "Open" if issue ['state' ] == 'open' else "Closed"
245- issue_type = categorize_issue (issue )
231+ status = "🟢 Open" if issue ['state' ] == 'open' else "✅ Closed"
232+ issue_type = categorize_issue (issue ). capitalize ()
246233 priority = get_issue_priority (issue )
234+ creator = issue .get ('user' , {}).get ('login' , 'N/A' )
247235
248- md .append (f"#### #{ issue ['number' ]} - { issue ['title' ]} \n \n " )
249- md .append (f"**Link:** { issue ['html_url' ]} \n \n " )
250- md .append (f"**Details:**\n " )
251- md .append (f"- Status: { status } \n " )
252- md .append (f"- Type: { issue_type .capitalize ()} \n " )
253- md .append (f"- Priority: { priority } \n " )
254- md .append (f"- Created: { issue ['created_at' ][:10 ]} by { issue .get ('user' , {}).get ('login' , 'unknown' )} \n " )
255-
256- if issue .get ('closed_at' ):
257- completion_time = calculate_completion_time (issue )
258- md .append (f"- Closed: { issue ['closed_at' ][:10 ]} (took { completion_time } )\n " )
236+ # Get assignees
237+ assignees = ', ' .join ([a ['login' ] for a in issue .get ('assignees' , [])]) or 'Unassigned'
259238
260- # Labels
261- if issue . get ( 'labels' ):
262- labels_str = ', ' . join ([ f"` { l [ 'name' ] } `" for l in issue [ 'labels' ]])
263- md . append ( f"- Labels: { labels_str } \n " )
239+ # Dates
240+ created_date = issue [ 'created_at' ][: 10 ]
241+ closed_date = issue [ 'closed_at' ][: 10 ] if issue . get ( 'closed_at' ) else '-'
242+ completion_time = calculate_completion_time ( issue ) or '-'
264243
265- # Assignees
266- if issue .get ('assignees' ):
267- assignees_str = ', ' .join ([a ['login' ] for a in issue ['assignees' ]])
268- md .append (f"- Assigned To: { assignees_str } \n " )
244+ # Issue title with link
245+ title_link = f"[{ issue ['title' ]} ]({ issue ['html_url' ]} )"
269246
270- # Assignment history
271- assignments = extract_assignment_history (issue )
272- if assignments :
273- md .append (f"- Assignment History:\n " )
274- for assignment in assignments :
275- md .append (f" - { assignment ['assigner' ]} assigned to { assignment ['assignee' ]} on { assignment ['date' ][:10 ]} \n " )
276-
277- # Milestone
278- if issue .get ('milestone' ):
279- md .append (f"- Milestone: { issue ['milestone' ]['title' ]} \n " )
280-
281- md .append ("\n " )
247+ md .append (
248+ f"| #{ issue ['number' ]} | { title_link } | { status } | { issue_type } | { priority } | "
249+ f"{ creator } | { assignees } | { created_date } | { closed_date } | { completion_time } |\n "
250+ )
251+
252+ md .append ("\n " )
282253
283254 # Pull Requests Summary
284255 if prs :
@@ -422,7 +393,7 @@ def main():
422393 markdown = generate_sprint_report (all_data , (start , end ))
423394
424395 # Save report
425- reports_dir = Path ('reports ' )
396+ reports_dir = Path ('sprint_reports ' )
426397 reports_dir .mkdir (exist_ok = True )
427398
428399 week_num = end .isocalendar ()[1 ]
0 commit comments