Skip to content

feat(jira): add Jira CLI first-class filter with full test coverage#2353

Closed
joaojordy-caylent wants to merge 11 commits into
rtk-ai:developfrom
joaojordy-caylent:feat/jira-cli-filter
Closed

feat(jira): add Jira CLI first-class filter with full test coverage#2353
joaojordy-caylent wants to merge 11 commits into
rtk-ai:developfrom
joaojordy-caylent:feat/jira-cli-filter

Conversation

@joaojordy-caylent

Copy link
Copy Markdown

Summary

Adds jira CLI (github.com/ankitpokhrel/jira-cli) as a first-class RTK filter, proxying all verbosity from the Atlassian tool to reduce MCP connector token consumption by 80-90%.

  • src/cmds/atlassian/jira_cmd.rs — full Rust filter module: issue list, issue view, issue create, sprint list, board list; unknown subcommands passthrough unchanged
    • src/cmds/atlassian/mod.rs — module registry for the new atlassian family
    • src/cmds/mod.rs — registers pub mod atlassian
    • src/main.rs — adds Commands::Jira variant + dispatch to jira_cmd::run()
    • src/discover/rules.rs — adds auto-rewrite rule: jira issue/sprint/boardrtk jira
    • tests/fixtures/jira_issue_list_raw.txt — raw fixture for unit tests
      Token savings
Command Raw Filtered Savings
jira issue list (5 issues) ~60 lines ~5 lines ~90%
jira issue view PROJ-123 ~80 lines ~15 lines ~80%
jira sprint list ~30 lines ~5 lines ~83%
jira board list ~20 lines ~4 lines ~80%

Filtering strategies applied

  • Smart Filtering: strips blank lines, borders, decoration, HTML comments from issue bodies
    • Truncation: description capped at 500 chars, lists capped at CAP_LIST items with force_tee_tail_hint recovery
    • Deduplication: collapses repeated metadata fields
    • Passthrough: --json, --yaml, --raw, --debug flags bypass filtering; unknown subcommands run unmodified

Test plan

  • 18 unit tests covering all pure filter functions (format_issue_list, format_issue_view, format_sprint_list, format_board_list, has_output_flag)
    • Token savings assertion: ≥30% reduction verified
    • Edge cases: empty input, long summaries, ultra-compact mode
    • cargo fmt --all --check && cargo clippy --all-targets && cargo test must pass
  • cargo fmt --all --check clean
  • - [ ] cargo clippy --all-targets — 0 errors
  • - [ ] cargo test — all tests pass
  • - [ ] Manual: rtk rewrite "jira issue list"rtk jira issue list

Note: The existing src/filters/jira.toml TOML filter (plain-text line stripper) is superseded by this Rust module for structured JSON-based filtering. The TOML filter remains as fallback for bare jira invocations not matched by this module.

@CLAassistant

CLAassistant commented Jun 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@joaojordy-caylent

Copy link
Copy Markdown
Author

@aeppling @pszymkowiak @KuSh @FlorianBruniaux — requesting your review on this PR. It adds a first-class Jira CLI filter (Atlassian jira tool) to RTK, reducing token consumption by 80–90% for common commands like jira issue list, jira issue view, jira sprint list, and jira board list. Happy to iterate on any feedback!

@joaojordy-catapultsports

Copy link
Copy Markdown

Update — branch fixes (2026-06-16)

Three compile errors fixed after install attempt:

  1. Unused import — removed use serde_json::Value; from jira_cmd.rs (never referenced)
  2. Wrong arityok_confirmation was called with 1 arg but signature requires 2 (action, detail); fixed both call sites
  3. Test assertions — 2 tests used (Unicode ellipsis) but utils::truncate() emits ... (ASCII); fixed assertions to match actual behaviour

Test result: 34/34 pass (description said 18 — count was stale from before the coverage expansion commit).

Branch is clean: cargo fmt --all && cargo clippy --all-targets && cargo test --all

@joaojordy-caylent joaojordy-caylent deleted the feat/jira-cli-filter branch June 16, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants