Skip to content

Commit fa42fdf

Browse files
celebdorclaude
andcommitted
feat(jira): add summarize_issue.py and enrich gathered data with author names
Add a summarize_issue.py script that extracts structured, human-readable summaries from pre-gathered JSON files, avoiding context window overflow when processing large issue data. Update update-weekly-status to use it. Enrich gather_status_data.py to capture author_name (display names) for PR reviews, commits, and review comments alongside login handles, and collect issue labels. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a6f6680 commit fa42fdf

3 files changed

Lines changed: 346 additions & 29 deletions

File tree

plugins/jira/commands/update-weekly-status.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -156,32 +156,24 @@ For each issue listed in the manifest:
156156

157157
##### a. Read Pre-Gathered Data
158158

159-
Read the issue's JSON file from `.work/weekly-status/{date}/issues/{ISSUE-KEY}.json`
159+
Use the `summarize_issue.py` script to extract a structured, human-readable summary from the pre-gathered JSON. This avoids reading large JSON files directly (which can exceed context limits) and produces output optimized for LLM analysis.
160160

161-
The file contains:
162-
163-
```json
164-
{
165-
"issue": {
166-
"key": "OCPSTRAT-1234",
167-
"summary": "...",
168-
"status": "In Progress",
169-
"assignee": {"email": "...", "name": "..."},
170-
"current_status_summary": "...",
171-
"last_status_summary_update": "..."
172-
},
173-
"descendants": {
174-
"total": 15,
175-
"by_status": {"Closed": 5, "In Progress": 8, "To Do": 2},
176-
"updated_in_range": [...],
177-
"completion_pct": 33.3
178-
},
179-
"changelog_in_range": [...],
180-
"comments_in_range": [...],
181-
"prs": [...]
182-
}
161+
```bash
162+
python3 {plugins-dir}/jira/skills/status-analysis/scripts/summarize_issue.py \
163+
{ISSUE-KEY} --date-dir .work/weekly-status/{date}
183164
```
184165

166+
The script outputs a structured summary with sections for:
167+
- Issue header (key, summary, status, assignee, current status summary)
168+
- Descendants (total, completion %, by-status breakdown, updated in range)
169+
- Changelog entries (formatted as `date by author: field: old -> new`)
170+
- Comments (non-bot only, with body truncated to 300 chars)
171+
- PRs (active in range, merged this week, open)
172+
173+
**Script location**: `plugins/jira/skills/status-analysis/scripts/summarize_issue.py`
174+
175+
The underlying JSON file is at `.work/weekly-status/{date}/issues/{ISSUE-KEY}.json` if you need to read additional details not shown in the summary.
176+
185177
##### b. Analyze Activity (using Status Analysis Engine)
186178

187179
Using the pre-gathered data, apply the activity analysis rules from `activity-analysis.md`:
@@ -546,4 +538,5 @@ See the Jira plugin's skills directory for examples of project-specific customiz
546538

547539
- **Shared skill**: `plugins/jira/skills/status-analysis/SKILL.md`
548540
- **Data gatherer script**: `plugins/jira/skills/status-analysis/scripts/gather_status_data.py`
541+
- **Issue summarizer script**: `plugins/jira/skills/status-analysis/scripts/summarize_issue.py`
549542
- **Single-issue rollup**: `/jira:status-rollup` - Generate comprehensive status comment for one issue

plugins/jira/skills/status-analysis/scripts/gather_status_data.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ def _build_pr_query(self, pr_refs: List[PRRef]) -> str:
551551
reviewDecision
552552
reviews(last: 30) {{
553553
nodes {{
554-
author {{ login }}
554+
author {{ login ... on User {{ name }} }}
555555
state
556556
body
557557
submittedAt
@@ -562,7 +562,7 @@ def _build_pr_query(self, pr_refs: List[PRRef]) -> str:
562562
isResolved
563563
comments(first: 5) {{
564564
nodes {{
565-
author {{ login }}
565+
author {{ login ... on User {{ name }} }}
566566
body
567567
createdAt
568568
path
@@ -577,7 +577,7 @@ def _build_pr_query(self, pr_refs: List[PRRef]) -> str:
577577
oid
578578
messageHeadline
579579
committedDate
580-
author {{ email }}
580+
author {{ email name }}
581581
}}
582582
}}
583583
}}
@@ -833,8 +833,10 @@ def _filter_pr_to_range(
833833
for review in (pr_data.get("reviews", {}).get("nodes") or []):
834834
submitted = self._parse_datetime(review.get("submittedAt"))
835835
if submitted and date_range.contains(submitted):
836+
author_obj = review.get("author") or {}
836837
reviews_in_range.append({
837-
"author": (review.get("author") or {}).get("login", "Unknown"),
838+
"author": author_obj.get("login", "Unknown"),
839+
"author_name": author_obj.get("name") or author_obj.get("login", "Unknown"),
838840
"state": review.get("state"),
839841
"body": (review.get("body") or "")[:500],
840842
"submitted_at": review.get("submittedAt"),
@@ -846,11 +848,13 @@ def _filter_pr_to_range(
846848
commit = node.get("commit", {})
847849
committed = self._parse_datetime(commit.get("committedDate"))
848850
if committed and date_range.contains(committed):
851+
commit_author = commit.get("author") or {}
849852
commits_in_range.append({
850853
"sha": (commit.get("oid") or "")[:7],
851854
"message": commit.get("messageHeadline", ""),
852855
"date": commit.get("committedDate"),
853-
"author": (commit.get("author") or {}).get("email", "Unknown"),
856+
"author": commit_author.get("email", "Unknown"),
857+
"author_name": commit_author.get("name") or commit_author.get("email", "Unknown"),
854858
})
855859

856860
# Filter review comments
@@ -859,8 +863,10 @@ def _filter_pr_to_range(
859863
for comment in (thread.get("comments", {}).get("nodes") or []):
860864
created = self._parse_datetime(comment.get("createdAt"))
861865
if created and date_range.contains(created):
866+
comment_author = comment.get("author") or {}
862867
review_comments_in_range.append({
863-
"author": (comment.get("author") or {}).get("login", "Unknown"),
868+
"author": comment_author.get("login", "Unknown"),
869+
"author_name": comment_author.get("name") or comment_author.get("login", "Unknown"),
864870
"path": comment.get("path"),
865871
"line": comment.get("line"),
866872
"body": (comment.get("body") or "")[:300],
@@ -1216,6 +1222,7 @@ def _build_manifest(
12161222

12171223
# Build issue data
12181224
assignee = fields.get("assignee") or {}
1225+
labels = [l for l in fields.get("labels", []) if isinstance(l, str)]
12191226
issue_data = {
12201227
"issue": {
12211228
"key": issue_key,
@@ -1225,6 +1232,7 @@ def _build_manifest(
12251232
"email": assignee.get("emailAddress"),
12261233
"name": assignee.get("displayName"),
12271234
},
1235+
"labels": labels,
12281236
"current_status_summary": fields.get(self.config.status_summary_field),
12291237
"last_status_summary_update": last_status_update,
12301238
},

0 commit comments

Comments
 (0)