feat(jira): add jira:post-summary-comment command to post PR summaries or plain notes as Jira comments#432
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepsm007 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 |
WalkthroughThe changes introduce Jira plugin version 0.4.0 with a new Changes
Sequence DiagramsequenceDiagram
participant User
participant Local as Local Git
participant GitHub as GitHub API
participant Jira as Jira (MCP/REST)
participant Creds as Credential System
User->>Creds: Provide Jira ticket & PR URL
activate Creds
Creds->>Creds: Validate credentials
Creds-->>User: Ready
deactivate Creds
rect rgba(100, 200, 100, 0.5)
Note over User,Local: Local-First Mode
User->>Local: Check for PR branch
activate Local
Local->>Local: Extract commit/diff data
Local-->>User: Local data available
deactivate Local
end
rect rgba(100, 150, 200, 0.5)
Note over User,GitHub: Remote-Only Metadata
User->>GitHub: Fetch PR metadata (if branch absent)
activate GitHub
GitHub-->>User: PR details
deactivate GitHub
end
rect rgba(200, 150, 100, 0.5)
Note over User,User: Summary Generation
User->>User: Format PR summary (standup/detailed)
User->>User: Truncate for Jira size limits
User->>User: Scan for secrets
end
User->>Jira: Post comment to ticket
activate Jira
alt Success
Jira-->>User: Comment posted
else Failure
Jira-->>User: Error (not found, post failed, etc.)
end
deactivate Jira
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (8 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
91fff9e to
c88e35f
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@plugins/jira/commands/update.md`:
- Around line 146-152: The first git fetch example uses an invalid remote name
pattern and is misleading; update the step to use the correct fetch form (the
one mentioned in the next sentence) and remove or replace the incorrect snippet
so readers run a valid fetch command for pull requests (use the
pull/$PR_NUMBER/head:pr-$PR_NUMBER pattern and set LOCAL_REF="pr-$PR_NUMBER"
accordingly), and ensure references to ORG/REPO and PR_NUMBER only appear as
explanatory variables rather than as a literal remote name.
- Around line 78-85: Documentation references a --note flag used by the Detect
mode logic and examples but the flag is missing from the Synopsis and Arguments;
either document it or remove its usage. Add an explicit --note <text> entry to
the Synopsis and to the Arguments section (including short description,
required/optional, and example), and update the Detect mode note to state that
providing --note forces "note mode" (treat remaining args as note text and skip
Phases 3 and 4); alternatively, if you prefer not to support --note, remove its
handling from the Detect mode branching and update example/error text
accordingly so examples and implementation match.
- Around line 224-297: Phase 4 docs use format names `short`/`long` but the
frontmatter, Synopsis, Arguments, and Error Handling reference `standup`
(default) and `detailed`; make the format names consistent across the file by
choosing one naming scheme and updating all occurrences. Locate the `--format`
flag description in Phase 4 and the frontmatter/Synopsis/Arguments/Error
Handling sections and either (A) change Phase 4 to document `standup` (default)
and `detailed` instead of `short`/`long`, or (B) change the frontmatter,
Synopsis, CLI examples, Arguments, and Error Handling to use `short` (default)
and `long`; update any example outputs and references (e.g., "default: short",
format headings, and any mention of `standup`/`detailed`) so they match the
chosen names.
- Around line 114-118: The doc/commands use mixed Jira API versions: the curl in
Phase 2 calls /rest/api/3/issue/... while Phase 6 posts comments to
/rest/api/2/issue/... with a plain text body; switch both operations to use the
same v2 endpoints and plain-text payloads so comment POSTs match the API
(replace any /rest/api/3/issue/... usages with /rest/api/2/issue/... and ensure
the comment POST uses the plain string body format referenced in Phase 6).
- Around line 311-316: Update the example tool calls to use the actual MCP
server tool names: replace any usage of jira_add_issue_comment with
jira_add_comment and ensure any reference to jira_get_issue (not jira_getissue
or similar) is used where appropriate; specifically change the example block
showing mcp__atlassian__jira_add_issue_comment(...) to call
mcp__atlassian__jira_add_comment(...) and update the earlier reference at the
symbol around line 109 to use mcp__atlassian__jira_get_issue (or
mcp__atlassian__jira_get_issue) so the documented function names match the
sooperset/ghcr.io/sooperset/mcp-atlassian interface.
🪄 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: Pro Plus
Run ID: 64cc58ff-4365-4c67-b20f-d9523d833ee1
📒 Files selected for processing (5)
.claude-plugin/marketplace.jsonPLUGINS.mddocs/data.jsonplugins/jira/.claude-plugin/plugin.jsonplugins/jira/commands/update.md
c88e35f to
df16c02
Compare
…s or plain notes as Jira comments
df16c02 to
5d98bff
Compare
|
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 new
jira:post-summary-commentcommand that posts a comment on a Jira ticket from a GitHub PR summary or a plain freeform note.PR summary mode — given a PR URL, the command fetches diff and commit data (local git first, GitHub API as fallback), generates a structured Jira comment in one of two formats:
standup(default) — status line + concise what/why paragraphdetailed— full breakdown with key changes and diff highlightsNote mode — when no PR URL is given, the remaining text is posted verbatim as a plain comment, useful for quick status updates or blockers without needing a linked PR.
Which issue(s) this PR fixes:
Fixes N/A — new command
Special notes for your reviewer:
jira_add_comment) rather than wiki markup, consistent with the approach introduced in fix(jira): use Markdown instead of wiki markup in description templates #408jira:updateis also the name of an existing command in the plugin that updates issue fields — this new command is additive and targets comments only, so there is no conflictChecklist:
Summary by CodeRabbit
New Features
/jira:updatecommand to post PR summaries or plain notes as comments to Jira tickets. Supports optional PR URL parameter and output format selection (standup or detailed mode) for customized comment formatting. Includes additional context parameters for flexible note composition.Version