-
Notifications
You must be signed in to change notification settings - Fork 152
Add jira:issues-by-component command for component-wise issue analysis #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Introduces a new command to list and analyze JIRA issues organized by component with comprehensive filtering capabilities including: - Component-wise grouping with overview and detail modes - Time period filtering (last-week, last-2-weeks, custom ranges) - User filtering by assignee or reporter - Status filtering for workflow states - Text search in summary with optional description search - Dual output modes: overview for all components or detailed view for specific component This command helps with workload distribution analysis, component-specific issue tracking, and team capacity planning. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: asood-rh The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
WalkthroughAdded a new Jira plugin command Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CmdProc as Command Processor
participant MCP as MCP Config
participant JiraAPI as Jira API
participant Py as Python Processor
participant Out as Markdown Report
User->>CmdProc: Invoke /jira:issues-by-component with args
CmdProc->>MCP: Load Jira credentials
MCP-->>CmdProc: Return credentials
CmdProc->>CmdProc: Parse args & build JQL (project, time, filters)
CmdProc->>JiraAPI: curl request with JQL (paginated)
JiraAPI-->>CmdProc: Return issue batches
CmdProc->>Py: Send raw issue JSON batches
Py->>Py: Group by component & aggregate stats
Py-->>CmdProc: Grouped results / summaries
CmdProc->>Out: Render overview or per-component detail Markdown
Out-->>User: Present generated report
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (7 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
|
Hi @asood-rh. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
plugins/jira/commands/issues-by-component.md (2)
113-118: Resolve repetitive sentence structure in argument parsing section.Three consecutive sentences ("Parse project key...", "Parse optional time-period...", "Parse optional flags...") begin with the same word "Parse". Restructure these sentences for better readability.
Example refactor:
-Parse project key from $1 (required): "OCPBUGS", "JIRA", "HYPE", etc. -Parse optional time-period from $2: - - `last-week` (default if not specified) +Extract the project key from $1 (required): "OCPBUGS", "JIRA", "HYPE", etc. +For the optional time-period parameter ($2): - `last-2-weeks` - `last-month` - Custom range: `YYYY-MM-DD:YYYY-MM-DD` -Parse optional flags: +Handle optional filtering flags: - `--component <name>`: Filter to specific component (enables Detail Mode)
37-88: Clearly document the credential configuration requirement more prominently.The credentials section (lines 37-88) is thorough but lengthy. Consider restructuring to emphasize that while this command uses curl instead of MCP, it STILL requires MCP configuration to exist. The critical point—that credentials must be in
~/.config/claude-code/mcp.json—could be stated more concisely up-front.The explanation of "why not use MCP commands" (lines 49-53) is good for context, but recommend pulling the core requirement to the start of the Prerequisites section:
## Prerequisites +**⚠️ IMPORTANT:** This command requires JIRA credentials configured in `~/.config/claude-code/mcp.json`, even though it uses `curl` instead of MCP commands for performance reasons. + This command requires JIRA credentials to be configured via the JIRA MCP server setup...
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (3)
PLUGINS.md(1 hunks)docs/data.json(1 hunks)plugins/jira/commands/issues-by-component.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
plugins/jira/commands/issues-by-component.md
[style] ~114-~114: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...red): "OCPBUGS", "JIRA", "HYPE", etc. - Parse optional time-period from $2: - `last...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🪛 markdownlint-cli2 (0.18.1)
plugins/jira/commands/issues-by-component.md
10-10: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
486-486: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
497-497: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
509-509: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
523-523: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
557-557: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
563-563: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
569-569: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
575-575: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
583-583: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
589-589: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
595-595: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
601-601: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
609-609: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
615-615: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
621-621: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (2)
PLUGINS.md (1)
161-161: Command documentation entry is consistent and complete.The new command entry follows the established format for Jira plugin commands, with proper command signature, filters, and description.
docs/data.json (1)
111-116: JSON command declaration is properly structured and positioned.The new command entry follows the same format as other Jira commands, maintains alphabetical ordering within the commands array, and includes all required fields with consistent syntax.
| ``` | ||
| /jira:issues-by-component <project-key> [time-period] [--component component-name] [--assignee username] [--reporter username] [--status status] [--search search-term] [--search-description] | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Add language specifiers to all fenced code blocks to comply with Markdown standards.
Multiple code blocks throughout the document lack language specifications, which violates markdownlint standards and reduces syntax highlighting for readers. Identify all fenced code blocks and add appropriate language identifiers:
- Bash/shell commands:
```bash - Python code:
```python - JSON data:
```json - JQL queries:
```jql(or```sqlas fallback) - Markdown output examples:
```markdown
This affects approximately 15 code blocks across the document (lines ~10, ~98, ~134, ~196, ~260, ~371, ~486, ~497, ~509, ~523, ~557, ~563, ~569, ~575, ~601, ~609, ~615, ~621).
Example fix for line 10 (bash block):
-```
+```bash
/jira:issues-by-component <project-key> [time-period] [--component component-name] [--assignee username] [--reporter username] [--status status] [--search search-term] [--search-description]
-```
+```Apply similar fixes to all other fenced code blocks in the document.
Also applies to: 98-108, 134-173, 196-243, 260-351, 371-468, 557-625
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
10-10: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai User does not need to run the command as bash command. This is claude command.
I do not think language specifier is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asood-rh You're absolutely right! The command synopsis at line 10 is indeed a Claude command invocation format, not a bash command. I should not have suggested bash as the language identifier for that block.
For the command synopsis itself, you could either:
- Leave it without a language specifier (as you prefer)
- Use a generic identifier like
textif you want to suppress the linter warning
However, if there are other code blocks in the full document that contain actual bash/shell scripts, Python code, JSON examples, or JQL queries (which the markdownlint report suggests exist at various lines), those specific blocks might still benefit from appropriate language identifiers for better syntax highlighting and readability. But I understand if you prefer to keep the documentation style consistent without language specifiers throughout.
I'll defer to your judgment on the documentation style for this command!
|
/ok-to-test |
|
@LiangquanLi930 Would you be able to review this PR? |
| ```python | ||
| import json | ||
| import glob | ||
| import sys | ||
| from collections import defaultdict | ||
| from datetime import datetime | ||
|
|
||
| # Parse command-line arguments | ||
| search_terms = sys.argv[1] if len(sys.argv) > 1 else None | ||
| search_description = sys.argv[2] == "true" if len(sys.argv) > 2 else False | ||
|
|
||
| # Load all batches | ||
| all_issues = [] | ||
| for batch_file in sorted(glob.glob('.work/jira-issues-by-component/{project-key}/batch-*.json')): | ||
| with open(batch_file) as f: | ||
| data = json.load(f) | ||
| all_issues.extend(data['issues']) | ||
|
|
||
| # Apply text search filter if provided | ||
| if search_terms: | ||
| keywords = [k.strip().lower() for k in search_terms.replace(',', ' ').split()] | ||
| filtered_issues = [] | ||
|
|
||
| for issue in all_issues: | ||
| summary = issue['fields'].get('summary', '').lower() | ||
| description = issue['fields'].get('description', '').lower() if search_description else '' | ||
|
|
||
| # Check if any keyword matches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don’t need any Python code, we should use the JIRA MCP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I tested the command does work without using intermediate python code. I used personal token from JIRA to test out. It is indicated just need JIRA personal token and email address in mcp json. Need to confirm if MCP server is used while processing the command or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LiangquanLi930 Thanks for reviewing. Makes sense for removing python code reference. Use of API versus MCP is transparent to user.
Let me know if the commit needs to be squashed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
plugins/jira/commands/issues-by-component.md (4)
61-76: Add language specifier to JSON configuration example.This block contains actual JSON configuration, which would benefit from syntax highlighting and language specification for readability.
Apply this diff:
-```json +```json { "mcpServers": { "atlassian": {This ensures proper syntax highlighting without being a Claude command invocation (which correctly has no specifier per your preference).
98-108: Add language specifier to bash credential extraction code block.This block contains actual bash/shell commands and would benefit from syntax highlighting. Note: this is executable shell code, not a Claude command invocation.
Apply this diff:
-```bash +```bash MCP_CONFIG="$HOME/.config/claude-code/mcp.json" JIRA_URL=$(jq -r '.mcpServers.atlassian.env.JIRA_URL' "$MCP_CONFIG")This maintains clarity for readers without affecting Claude command formatting (which you correctly prefer without specifiers).
196-243: Add language specifier to bash batch processing loop.This is the longest and most complex bash code block in the documentation. Adding a
bashlanguage specifier will improve syntax highlighting and readability without affecting the Claude command invocation examples elsewhere.Apply this diff:
-```bash +```bash START_AT=0 BATCH_NUM=0 TOTAL_FETCHED=0This block is actual shell code (not a Claude command), so a language specifier is appropriate.
113-119: Vary sentence structure to reduce repetition.Three consecutive sentences begin with "Parse," which impacts readability. The LanguageTool hint is valid here.
Apply this diff to improve variety:
- Parse project key from $1 (required): "OCPBUGS", "JIRA", "HYPE", etc. - Parse optional time-period from $2: + Extract the project key from $1 (required): "OCPBUGS", "JIRA", "HYPE", etc. + The optional time-period argument ($2) accepts: - `last-week` (default if not specified) - `last-2-weeks` - `last-month` - Custom range: `YYYY-MM-DD:YYYY-MM-DD` - Parse optional flags: + Handle optional flag arguments as follows:This maintains clarity while reducing successive sentence repetition.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
plugins/jira/commands/issues-by-component.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
plugins/jira/commands/issues-by-component.md
[style] ~114-~114: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...red): "OCPBUGS", "JIRA", "HYPE", etc. - Parse optional time-period from $2: - `last...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🪛 markdownlint-cli2 (0.18.1)
plugins/jira/commands/issues-by-component.md
10-10: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
374-374: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
385-385: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
397-397: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
411-411: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
445-445: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
451-451: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
457-457: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
463-463: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
471-471: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
477-477: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
483-483: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
489-489: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
497-497: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
503-503: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
509-509: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (5)
plugins/jira/commands/issues-by-component.md (5)
1-12: Documentation structure is clear and well-organized.The frontmatter metadata and synopsis provide good orientation. The frontmatter description and argument-hint are concise and actionable. However, note that the synopsis block (lines 10-12) is a Claude command invocation format (not bash), so per your earlier feedback, no language specifier is appropriate here.
Verify that the command syntax in the synopsis matches the implementation (argument parsing section in the Implementation part). For example, confirm that the argument order and optional flags are correctly documented.
371-420: Error handling section is comprehensive.The error handling covers all major failure modes: missing credentials, invalid credentials, authentication failures, invalid inputs, missing components, and API rate limiting. The error messages are clear and helpful to users.
Consider adding language specifiers (
textorconsole) to the error output blocks (lines 374, 385, 397, 411) for consistency with the code blocks in the implementation section, though this is optional and not critical.
37-56: Clarify Python processing requirement.The prerequisites section states "uses
curlto fetch data directly from JIRA and save to disk, then processes it with Python" (line 55), but an earlier review comment from asood-rh indicated testing without intermediate Python code. This creates potential ambiguity.Please clarify:
- Is Python processing mandatory for the command to function?
- Or is Python optional (with fallback bash-only processing)?
- If Python is required, should this be listed as a prerequisite tool?
If the command has been tested and works without Python, consider revising line 55 to reflect this, or ensure Python is explicitly listed as a system dependency alongside jq and curl.
438-512: Examples section is comprehensive and well-organized.The examples progressively demonstrate the command from basic usage through advanced scenarios. The progression (overview → detail → advanced) makes it easy for users to understand capabilities. The examples correctly use the Claude command invocation format without language specifiers, consistent with your documented preference.
14-35: Description and feature overview are clear.The description clearly explains the command's purpose, the two modes of operation (overview vs. detail), and the use cases. The feature list is well-organized and easy to scan. This sets good expectations for users.
Summary
Adds a new
/jira:issues-by-componentcommand to list and analyze JIRA issues organized by component with comprehensive filtering capabilities.Features
last-week,last-2-weeks,last-month, or custom date ranges--assigneeor--reporter--search, optionally include description with--search-descriptionUse Cases
Test Output
/jira:issues-by-component OCPBUGS last-week --component "Networking / ovn-kubernetes" --status "New" https://file.corp.redhat.com/~asood/issues-report.html
/jira:issues-by-component OCPBUGS last-week
https://file.corp.redhat.com/~asood/overview-report.md
Example Usage