Skip to content

feat(jira): add jira:post-summary-comment command to post PR summaries or plain notes as Jira comments#432

Open
deepsm007 wants to merge 1 commit into
openshift-eng:mainfrom
deepsm007:feat/jira-comment-from-pr
Open

feat(jira): add jira:post-summary-comment command to post PR summaries or plain notes as Jira comments#432
deepsm007 wants to merge 1 commit into
openshift-eng:mainfrom
deepsm007:feat/jira-comment-from-pr

Conversation

@deepsm007
Copy link
Copy Markdown

@deepsm007 deepsm007 commented Apr 23, 2026

What this PR does / why we need it:

Adds a new jira:post-summary-comment command 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 paragraph
  • detailed — full breakdown with key changes and diff highlights

Note 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:

  • Uses Jira Markdown (via MCP jira_add_comment) rather than wiki markup, consistent with the approach introduced in fix(jira): use Markdown instead of wiki markup in description templates #408
  • Local git is preferred over GitHub API for diff/commit data when the PR branch is available — reduces API calls and works before a PR is opened
  • jira:update is 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 conflict

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.

Summary by CodeRabbit

  • New Features

    • Added new /jira:update command 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

    • Updated Jira plugin version to 0.4.0.

@openshift-ci openshift-ci Bot requested review from enxebre and zaneb April 23, 2026 13:37
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 23, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepsm007
Once this PR has been reviewed and has the lgtm label, please assign theobarberbany for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Walkthrough

The changes introduce Jira plugin version 0.4.0 with a new /jira:update command that enables posting PR summaries or plain-text notes as Jira ticket comments. Version numbers are updated in the marketplace and plugin manifest, and comprehensive documentation is added for the new command functionality.

Changes

Cohort / File(s) Summary
Version Updates
.claude-plugin/marketplace.json, plugins/jira/.claude-plugin/plugin.json
Bump Jira plugin version from 0.3.9 to 0.4.0 in both the marketplace registry and plugin manifest.
New jira:update Command
plugins/jira/commands/update.md
Introduces comprehensive documentation for the new update command, detailing workflow for posting PR summaries (standup or detailed format) or plain-text notes to Jira tickets, including authentication, validation, local-first git workflow, truncation strategy, and error handling.
Plugin Metadata & Documentation
docs/data.json, PLUGINS.md
Register new update command in plugin data file with command signature and optional parameters; add entry to plugin docs listing the new command capability.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
No Assumed Git Remote Names ❌ Error Documentation hardcodes git remote name 'origin' without discovery mechanism; assumes remote exists but provides no code to detect actual remote names. Add git remote discovery step using 'git remote -v' to identify actual remote URL, store in variable like TARGET_REMOTE, and use throughout Phase 3 instead of hardcoding origin.
Title check ⚠️ Warning The PR title mentions 'jira:post-summary-comment' but the actual implementation and PR objectives describe the command as 'jira:update', creating a discrepancy. Update the PR title to reflect the actual command name: 'feat(jira): add jira:update command to post PR summaries or plain notes as Jira comments'
✅ Passed checks (8 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Real People Names In Style References ✅ Passed Comprehensive examination of all modified files in the pull request found no instances of real people's names used as style references, examples, or instructions, fully complying with policy requirements.
Git Push Safety Rules ✅ Passed The pull request contains no git push commands of any kind. Changes consist solely of version updates in JSON manifest files, plugin documentation updates, and a new command documentation file (update.md). The only push reference is in the context of checking git branches locally, not executing push operations. The PR makes no automated or manual recommendations to execute git push to any branch.
No Untrusted Mcp Servers ✅ Passed PR only adds documentation and a new command using the pre-existing sooperset/mcp-atlassian MCP server that was already configured in the repository.
Ai-Helpers Overlap Detection ✅ Passed The jira:update command introduces novel functionality combining GitHub PR data extraction with Jira comment posting, with no existing commands providing similar functionality.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@deepsm007 deepsm007 force-pushed the feat/jira-comment-from-pr branch from 91fff9e to c88e35f Compare April 23, 2026 13:39
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ef00907 and 91fff9e.

📒 Files selected for processing (5)
  • .claude-plugin/marketplace.json
  • PLUGINS.md
  • docs/data.json
  • plugins/jira/.claude-plugin/plugin.json
  • plugins/jira/commands/update.md

Comment thread plugins/jira/commands/post-summary-comment.md
Comment thread plugins/jira/commands/post-summary-comment.md
Comment thread plugins/jira/commands/update.md Outdated
Comment thread plugins/jira/commands/post-summary-comment.md
Comment thread plugins/jira/commands/post-summary-comment.md
@deepsm007 deepsm007 force-pushed the feat/jira-comment-from-pr branch from c88e35f to df16c02 Compare April 23, 2026 13:50
Comment thread .claude-plugin/marketplace.json
Comment thread plugins/jira/commands/update.md Outdated
@deepsm007 deepsm007 force-pushed the feat/jira-comment-from-pr branch from df16c02 to 5d98bff Compare April 23, 2026 14:09
@deepsm007 deepsm007 changed the title feat(jira): add jira:update command to post PR summaries or plain notes as Jira comments feat(jira): add jira:post-summary-comment command to post PR summaries or plain notes as Jira comments Apr 23, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 28, 2026

PR needs rebase.

Details

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.

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants