feat(jira): add summarize_issue.py and enrich gathered data with author names#484
feat(jira): add summarize_issue.py and enrich gathered data with author names#484celebdor wants to merge 1 commit into
Conversation
WalkthroughAdds a CLI summarizer for pre-gathered per-issue JSON, enriches GitHub GraphQL PR data and Jira issue output with additional author metadata and labels, and updates docs plus plugin/version metadata to reference the new summarization step. ChangesIssue Summarization Tool with Enriched Data Gathering
🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (9 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/jira/skills/status-analysis/scripts/gather_status_data.py`:
- Line 1225: The list comprehension creating labels uses a single-letter loop
variable `l` which triggers Ruff E741; change the loop variable in that
comprehension to a descriptive name like `label` (e.g., labels = [label for
label in fields.get("labels", []) if isinstance(label, str)]) so the
comprehension in gather_status_data.py that references fields.get("labels", [])
uses a non-ambiguous identifier.
In `@plugins/jira/skills/status-analysis/scripts/summarize_issue.py`:
- Line 240: Replace unnecessary f-strings that have no interpolation with plain
string literals in summarize_issue.py: locate the print calls using f-strings
(e.g., the print(f"Examples:", file=sys.stderr) and the similar print at the
later occurrence) and change them to use normal strings (print("Examples:",
file=sys.stderr)). Update any other non-interpolated f-strings in the same file
to avoid Ruff F541 warnings, keeping the rest of the print arguments (like
file=sys.stderr) unchanged.
- Around line 67-73: The code checks color changes using
item.get("fromString")/item.get("toString") but the gathered changelog stores
values under "from"/"to", causing summaries to show "? -> ?"; update both places
(the block computing from_has/to_has around variables field/field_id and the
similar block at lines 113-117) to read item.get("from") and item.get("to")
(falling back to fromString/toString only if absent), convert them to strings
before searching for "Red"/"Yellow"/"Green", and use those values when building
the changelog summary so the output shows the actual from -> to values instead
of "? -> ?".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 0269f937-2556-4d1f-a224-6bb003cff6ea
📒 Files selected for processing (3)
plugins/jira/commands/update-weekly-status.mdplugins/jira/skills/status-analysis/scripts/gather_status_data.pyplugins/jira/skills/status-analysis/scripts/summarize_issue.py
|
|
||
| # Build issue data | ||
| assignee = fields.get("assignee") or {} | ||
| labels = [l for l in fields.get("labels", []) if isinstance(l, str)] |
There was a problem hiding this comment.
Rename the one-letter loop variable to avoid Ruff E741.
Line 1225 uses l, which is flagged as ambiguous and may fail lint checks.
Suggested fix
- labels = [l for l in fields.get("labels", []) if isinstance(l, str)]
+ labels = [label for label in fields.get("labels", []) if isinstance(label, str)]🧰 Tools
🪛 Ruff (0.15.13)
[error] 1225-1225: Ambiguous variable name: l
(E741)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/jira/skills/status-analysis/scripts/gather_status_data.py` at line
1225, The list comprehension creating labels uses a single-letter loop variable
`l` which triggers Ruff E741; change the loop variable in that comprehension to
a descriptive name like `label` (e.g., labels = [label for label in
fields.get("labels", []) if isinstance(label, str)]) so the comprehension in
gather_status_data.py that references fields.get("labels", []) uses a
non-ambiguous identifier.
| field = item.get("field", "") | ||
| field_id = str(item.get("fieldId", "")) | ||
| if "Status Summary" in field or "customfield_12320841" in field_id: | ||
| for color in ("Red", "Yellow", "Green"): | ||
| from_has = color in (item.get("fromString") or "") | ||
| to_has = color in (item.get("toString") or "") | ||
| if from_has != to_has: |
There was a problem hiding this comment.
Use the gathered changelog keys (from/to) when summarizing.
The summarizer reads fromString/toString, but gathered issue JSON stores from/to. This makes changelog output degrade to ? -> ? and can miss color-change signals.
Suggested fix
- from_has = color in (item.get("fromString") or "")
- to_has = color in (item.get("toString") or "")
+ before = item.get("from", item.get("fromString")) or ""
+ after = item.get("to", item.get("toString")) or ""
+ from_has = color in before
+ to_has = color in after
@@
- f"{i.get('field', '?')}: {i.get('fromString', '?')} -> {i.get('toString', '?')}"
+ f"{i.get('field', '?')}: "
+ f"{i.get('from', i.get('fromString', '?'))} -> "
+ f"{i.get('to', i.get('toString', '?'))}"Also applies to: 113-117
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/jira/skills/status-analysis/scripts/summarize_issue.py` around lines
67 - 73, The code checks color changes using
item.get("fromString")/item.get("toString") but the gathered changelog stores
values under "from"/"to", causing summaries to show "? -> ?"; update both places
(the block computing from_has/to_has around variables field/field_id and the
similar block at lines 113-117) to read item.get("from") and item.get("to")
(falling back to fromString/toString only if absent), convert them to strings
before searching for "Red"/"Yellow"/"Green", and use those values when building
the changelog summary so the output shows the actual from -> to values instead
of "? -> ?".
|
|
||
| if not args: | ||
| print(f"Usage: {sys.argv[0]} <ISSUE-KEY|issue.json|issues-dir/> [...] [--date-dir DIR] [--only-significant] [--label LABEL]", file=sys.stderr) | ||
| print(f"Examples:", file=sys.stderr) |
There was a problem hiding this comment.
Remove unnecessary f-strings to satisfy Ruff F541.
These strings have no interpolation and should be plain string literals.
Suggested fix
- print(f"Examples:", file=sys.stderr)
+ print("Examples:", file=sys.stderr)
@@
- print(f"Confirm with the user whether to include them in the report.\n")
+ print("Confirm with the user whether to include them in the report.\n")Also applies to: 306-306
🧰 Tools
🪛 Ruff (0.15.13)
[error] 240-240: f-string without any placeholders
Remove extraneous f prefix
(F541)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/jira/skills/status-analysis/scripts/summarize_issue.py` at line 240,
Replace unnecessary f-strings that have no interpolation with plain string
literals in summarize_issue.py: locate the print calls using f-strings (e.g.,
the print(f"Examples:", file=sys.stderr) and the similar print at the later
occurrence) and change them to use normal strings (print("Examples:",
file=sys.stderr)). Update any other non-interpolated f-strings in the same file
to avoid Ruff F541 warnings, keeping the rest of the print arguments (like
file=sys.stderr) unchanged.
|
/assign |
…or 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>
fa42fdf to
9408802
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: celebdor The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
plugins/jira/skills/status-analysis/scripts/summarize_issue.py (1)
67-73:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUse gathered changelog keys (
from/to) instead of onlyfromString/toString.The summarizer is still reading the wrong keys for this pipeline contract, so color transitions and changelog lines can be incorrect.
Proposed fix
- from_has = color in (item.get("fromString") or "") - to_has = color in (item.get("toString") or "") + before = str(item.get("from", item.get("fromString", "")) or "") + after = str(item.get("to", item.get("toString", "")) or "") + from_has = color in before + to_has = color in after @@ - f"{i.get('field', '?')}: {i.get('fromString', '?')} -> {i.get('toString', '?')}" + f"{i.get('field', '?')}: " + f"{i.get('from', i.get('fromString', '?'))} -> " + f"{i.get('to', i.get('toString', '?'))}"Also applies to: 113-115
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/jira/skills/status-analysis/scripts/summarize_issue.py` around lines 67 - 73, The code is checking changelog color transitions using only item.get("fromString")/item.get("toString") which misses cases where the changelog uses keys "from"/"to"; update the color-detection logic in the loop that inspects item (the block using field, field_id, color, from_has, to_has) to check item.get("from") and item.get("to") (falling back to fromString/toString if needed) — i.e. compute from_val = (item.get("from") or item.get("fromString") or "") and to_val = (item.get("to") or item.get("toString") or "") and then use color in from_val / to_val for from_has/to_has; make the same change for the other occurrence around the lines referenced (the second block using fromString/toString).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@plugins/jira/skills/status-analysis/scripts/summarize_issue.py`:
- Around line 67-73: The code is checking changelog color transitions using only
item.get("fromString")/item.get("toString") which misses cases where the
changelog uses keys "from"/"to"; update the color-detection logic in the loop
that inspects item (the block using field, field_id, color, from_has, to_has) to
check item.get("from") and item.get("to") (falling back to fromString/toString
if needed) — i.e. compute from_val = (item.get("from") or item.get("fromString")
or "") and to_val = (item.get("to") or item.get("toString") or "") and then use
color in from_val / to_val for from_has/to_has; make the same change for the
other occurrence around the lines referenced (the second block using
fromString/toString).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 5d84fa42-1a2d-4869-a5e3-292efbf7820a
📒 Files selected for processing (6)
.claude-plugin/marketplace.jsondocs/data.jsonplugins/jira/.claude-plugin/plugin.jsonplugins/jira/commands/update-weekly-status.mdplugins/jira/skills/status-analysis/scripts/gather_status_data.pyplugins/jira/skills/status-analysis/scripts/summarize_issue.py
✅ Files skipped from review due to trivial changes (3)
- plugins/jira/.claude-plugin/plugin.json
- .claude-plugin/marketplace.json
- docs/data.json
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What this PR does / why we need it:
Adds a
summarize_issue.pyscript that extracts structured, human-readable summaries from pre-gathered JSON files, avoiding context window overflow when processing large issue data during weekly status updates. Also enrichesgather_status_data.pyto captureauthor_name(display names) for PR reviews, commits, and review comments alongside login handles, and collects issue labels. Updates theupdate-weekly-statuscommand to use the summarizer instead of reading raw JSON directly.Which issue(s) this PR fixes:
Special notes for your reviewer:
Split out from a larger branch that also adds
/jira:generate-feature-updates— this PR contains only the general-purpose improvements to the status analysis pipeline.Checklist:
🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
New Features
Improvements
Chores