feat(adapters): Jira task-management adapter — talk to Archon inside a ticket#1752
feat(adapters): Jira task-management adapter — talk to Archon inside a ticket#1752coleam00 wants to merge 6 commits into
Conversation
Add JiraAdapter implementing IPlatformAdapter for Jira Cloud webhooks. Receives comment_created events, detects @mentions via ADF tree walking, posts replies as ADF comments with Basic auth. Includes webhook secret verification, accountId allowlist, self-trigger guard, and 25 unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add null guard on commentEvent.issue?.key before dereferencing (plan risk mitigation) - Remove dead optional chain on non-nullable secret parameter - Skip empty trailing lines in buildAdfDocument to avoid malformed ADF text nodes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…arker-based self-trigger guard - Bot detection now matches by display name (case-insensitive) via ADF mention attrs.text/attrs.displayName or plain text @name patterns - JIRA_BOT_MENTION is now optional (defaults to 'Archon'); removed from required env gate - Self-trigger guard replaced: outgoing comments embed U+200B x3 marker; incoming webhooks containing the marker are skipped before JSON parsing - extractTextFromAdf strips the marker so it never reaches the model - Updated adapter.test.ts: 28 tests covering name-based detection (case-insensitive), Archon default, text-node @mention, and marker self-trigger guard; no botAccountId Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ields, JIRA_DOMAIN) Found while testing the adapter end-to-end against a live Jira instance: - Read the Atlassian site from JIRA_DOMAIN; accept a bare domain or a full URL (scheme auto-added). - Jira comment webhooks deliver the comment body as a plain string, not ADF -- hasMention and extractTextFromAdf now handle both string and ADF node bodies. - The webhook issue-fields payload is partial (labels/status/priority/summary may be absent) -- build the issue context defensively. - Trim the account email and API credential so stray whitespace cannot break Basic auth. - Document the new variable in the example env template. Verified live: an @archon comment on a Jira ticket is detected and answered with a reply posted back; the zero-width self-trigger marker prevents loops. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
- New community adapter page documenting the conversation-point model, API-token auth, ?secret= webhook config, env vars, conversation-id format, and troubleshooting (from the live end-to-end test). - Listed Jira in the Community Adapters table and the "choosing an adapter" list. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The server already reports Jira in activePlatforms, but the Settings page hardcoded the adapter list and omitted it — every other adapter (incl. the community ones) was listed. Add the Jira row for parity. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@$coleam00 related to #1348 — overlapping area or partial fix. |
|
@$coleam00 related to #1469 — overlapping area or partial fix. |
|
@$coleam00 related to #1348 — overlapping area or partial fix. |
|
@$coleam00 related to #1469 — overlapping area or partial fix. |
Summary
Adds a Jira adapter in a new
task-managementadapter category (sibling tochat/andforge/), so each Jira issue becomes a live Archon conversation:@mentionthe bot in a comment, it runs through the orchestrator and replies back as a comment on the same ticket. Many tickets = many parallel conversations, the same way Slack threads work.This is a conversation point, not an end-to-end auto-resolver — the adapter only routes the conversation (webhook in →
handleMessage→ comment back). Actually resolving a ticket (explore → implement → PR → transition) stays a workflow concern, with a futurejiraskill for status transitions.Closes #1750.
What it adds
packages/adapters/src/community/task-management/jira/—adapter.ts(JiraAdapter),auth.ts,types.ts,index.ts,adapter.test.tscommunity/task-management/README.md— category conventions/webhooks/jiraroute + env-gated init inpackages/server/src/index.tspackages/adapters/src/index.ts; example env-template entryKey design decisions
task-managementcategory — Jira is a work tracker, not a chat platform or a code forge. It borrows chat-style conversation semantics (conversation = issue key; no repo/clone/worktree) and forge-style webhook transport.JIRA_BOT_MENTION, optional, defaults toArchon, case-insensitive) — no Jira accountId required. Mention detection matches a real ADF mention node or plain@nametext.?secret=(Jira doesn't HMAC-sign its webhooks).Validated live (end-to-end)
Tested against a real Jira site + ticket: an
@Archoncomment → webhook → mention detected → orchestrator reply posted back to the ticket; a follow-up message worked too; no self-trigger loop. The live run surfaced and fixed several real payload-shape issues:JIRA_DOMAIN(accepts a bare domain or a full URL).hasMentionandextractTextFromAdf.issue.fieldsis partial — issue-context building is now defensive.Test plan
type-check(all packages),lint --max-warnings 0,format:checkcleantask-managementcategory placement + READMEjiraworkflow skill (status transitions) + docs-web page🤖 Generated with Claude Code