Skip to content

feat: bl priority list + bl resolution list#75

Merged
23prime merged 1 commit intomainfrom
feature/43-priority-resolution-list
Mar 17, 2026
Merged

feat: bl priority list + bl resolution list#75
23prime merged 1 commit intomainfrom
feature/43-priority-resolution-list

Conversation

@23prime
Copy link
Owner

@23prime 23prime commented Mar 17, 2026

Checklist

  • Target branch is main
  • Status checks are passing
  • Documentation updated if user-visible behavior changed (website/docs/, website/i18n/ja/, README.md)

Summary

  • Add bl priority listGET /api/v2/priorities
  • Add bl resolution listGET /api/v2/resolutions

Reason for change

Implements Issue #43. These two space-global reference lists were Planned in the coverage table.

Changes

File Change
src/api/priority.rs New: Priority struct + get_priorities method + httpmock test
src/api/resolution.rs New: Resolution struct + get_resolutions method + httpmock test
src/api/mod.rs Added modules, trait methods, and BacklogApi for BacklogClient delegations
src/cmd/priority/list.rs New: PriorityListArgs, list_with, MockApi tests
src/cmd/resolution/list.rs New: ResolutionListArgs, list_with, MockApi tests
src/main.rs Added PriorityCommands, ResolutionCommands enums and match arms
website/docs/commands.md Added command docs, marked both as ✅ Implemented
website/i18n/ja/.../commands.md Same for Japanese

Notes

Both commands have no parameters beyond --json. Tested against real Backlog API — response fields confirmed as id: u64, name: String.

Closes #43

Copilot AI review requested due to automatic review settings March 17, 2026 03:25
@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

📝 Walkthrough

Walkthrough

This pull request introduces two new CLI commands—bl priority list and bl resolution list—that fetch and display priority and resolution lists from the Backlog API. The implementation extends the API trait layer with new endpoints, adds command modules with output formatting, and updates CLI routing to dispatch these commands.

Changes

Cohort / File(s) Summary
API Layer: Core Trait & Client
src/api/mod.rs
Extended BacklogApi trait and BacklogClient implementation with new trait methods get_priorities() and get_resolutions() to retrieve priority and resolution lists; imported Priority and Resolution types.
API Layer: Entity Implementations
src/api/priority.rs, src/api/resolution.rs
Added Priority and Resolution domain structs with id and name fields; implemented get_priorities() and get_resolutions() methods to fetch from /priorities and /resolutions endpoints respectively, with JSON deserialization error handling and unit tests.
Command Layer: Module Structure
src/cmd/mod.rs, src/cmd/priority/mod.rs, src/cmd/resolution/mod.rs
Added priority and resolution submodules to cmd layer; declared and re-exported list submodules to expose PriorityListArgs/list and ResolutionListArgs/list functions.
Command Layer: List Implementation
src/cmd/priority/list.rs, src/cmd/resolution/list.rs
Implemented PriorityListArgs and ResolutionListArgs with json output flag; list functions fetch data via BacklogApi and output in JSON or text format ([id] name per entry); includes unit tests with MockApi.
CLI Routing
src/main.rs
Added Priority and Resolution top-level commands with List subcommands; wired CLI argument parsing to dispatch to cmd::priority::list and cmd::resolution::list with json flag forwarding.
Documentation
website/docs/commands.md, website/i18n/ja/docusaurus-plugin-content-docs/current/commands.md
Added documentation blocks for bl priority list and bl resolution list with usage examples and sample outputs; updated command coverage table to mark both commands as implemented.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI as CLI (main.rs)
    participant Cmd as Command Handler<br/>(cmd/priority/list)
    participant API as BacklogApi<br/>(BacklogClient)
    participant Backlog as Backlog Server

    User->>CLI: bl priority list [--json]
    CLI->>Cmd: list(PriorityListArgs)
    Cmd->>API: get_priorities()
    API->>Backlog: GET /api/v2/priorities
    Backlog-->>API: [Priority {...}, ...]
    API-->>Cmd: Vec<Priority>
    alt json flag set
        Cmd->>Cmd: serde_json::to_string_pretty()
        Cmd-->>User: JSON output
    else text output
        Cmd->>Cmd: format "[id] name" per entry
        Cmd-->>User: Text output
    end
Loading
sequenceDiagram
    participant User
    participant CLI as CLI (main.rs)
    participant Cmd as Command Handler<br/>(cmd/resolution/list)
    participant API as BacklogApi<br/>(BacklogClient)
    participant Backlog as Backlog Server

    User->>CLI: bl resolution list [--json]
    CLI->>Cmd: list(ResolutionListArgs)
    Cmd->>API: get_resolutions()
    API->>Backlog: GET /api/v2/resolutions
    Backlog-->>API: [Resolution {...}, ...]
    API-->>Cmd: Vec<Resolution>
    alt json flag set
        Cmd->>Cmd: serde_json::to_string_pretty()
        Cmd-->>User: JSON output
    else text output
        Cmd->>Cmd: format "[id] name" per entry
        Cmd-->>User: Text output
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Two new lists I bring with glee,
Priorities and resolutions so free,
With --json flags and text displays bright,
The CLI hops with commands so right! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.81% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: adding two new CLI commands (bl priority list and bl resolution list) that are the primary focus of the pull request.
Linked Issues check ✅ Passed The pull request fully implements the requirements from issue #43: both bl priority list (GET /api/v2/priorities) and bl resolution list (GET /api/v2/resolutions) commands are implemented with proper API integration, CLI wiring, and documentation.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the two new commands and their supporting infrastructure, with no unrelated modifications detected outside the stated objectives.
Description check ✅ Passed The pull request description clearly relates to the changeset, detailing the addition of two new CLI commands (bl priority list and bl resolution list) with corresponding API integrations and documentation updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/43-priority-resolution-list
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feature/43-priority-resolution-list
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds two new space-global reference-list commands to the Backlog CLI (bl): bl priority list and bl resolution list, backed by new API client methods and documented in the command reference/coverage tables.

Changes:

  • Added API support for listing priorities and resolutions (GET /api/v2/priorities, GET /api/v2/resolutions) with httpmock tests.
  • Added CLI commands bl priority list and bl resolution list, including --json support and MockApi-based tests.
  • Updated English/Japanese command documentation and marked both commands as implemented in the coverage tables.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/api/priority.rs Adds Priority model + BacklogClient::get_priorities() + httpmock test.
src/api/resolution.rs Adds Resolution model + BacklogClient::get_resolutions() + httpmock test.
src/api/mod.rs Registers new modules, adds BacklogApi trait methods, and delegates for BacklogClient.
src/cmd/priority/mod.rs Adds priority command module and re-exports.
src/cmd/priority/list.rs Implements bl priority list with --json and unit tests via MockApi.
src/cmd/resolution/mod.rs Adds resolution command module and re-exports.
src/cmd/resolution/list.rs Implements bl resolution list with --json and unit tests via MockApi.
src/cmd/mod.rs Exposes new priority and resolution command modules.
src/main.rs Wires new clap subcommands and dispatch to command handlers.
website/docs/commands.md Documents new commands and updates coverage status to ✅ Implemented.
website/i18n/ja/.../commands.md Japanese documentation + coverage status update to ✅ 実装済み.

You can also share your feedback on Copilot code review. Take the survey.

Copy link

@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.

🧹 Nitpick comments (1)
src/cmd/resolution/list.rs (1)

75-89: Add assertions for emitted output, not just success.

These tests currently verify only is_ok(). Please add checks for actual text/JSON output shape so formatting regressions are caught.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/cmd/resolution/list.rs` around lines 75 - 89, Update the two tests
list_with_text_output_succeeds and list_with_json_output_succeeds to assert the
actual emitted output instead of just is_ok(): invoke list_with(&args(...),
&api) while capturing its stdout (use a capture helper or assert_cmd/gag to
capture printed output), then for the text test assert the output string
contains expected human-readable pieces from sample_resolutions() (e.g.,
resolution titles or IDs), and for the JSON test parse the captured output with
serde_json into a Vec or struct and assert length and that key fields
(id/title/status) match sample_resolutions(); keep MockApi, sample_resolutions,
list_with and args as the references to locate the code to change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/cmd/resolution/list.rs`:
- Around line 75-89: Update the two tests list_with_text_output_succeeds and
list_with_json_output_succeeds to assert the actual emitted output instead of
just is_ok(): invoke list_with(&args(...), &api) while capturing its stdout (use
a capture helper or assert_cmd/gag to capture printed output), then for the text
test assert the output string contains expected human-readable pieces from
sample_resolutions() (e.g., resolution titles or IDs), and for the JSON test
parse the captured output with serde_json into a Vec or struct and assert length
and that key fields (id/title/status) match sample_resolutions(); keep MockApi,
sample_resolutions, list_with and args as the references to locate the code to
change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d970eace-9ef8-4ef6-ab76-f540d967b05b

📥 Commits

Reviewing files that changed from the base of the PR and between e498fa5 and 95d1283.

📒 Files selected for processing (11)
  • src/api/mod.rs
  • src/api/priority.rs
  • src/api/resolution.rs
  • src/cmd/mod.rs
  • src/cmd/priority/list.rs
  • src/cmd/priority/mod.rs
  • src/cmd/resolution/list.rs
  • src/cmd/resolution/mod.rs
  • src/main.rs
  • website/docs/commands.md
  • website/i18n/ja/docusaurus-plugin-content-docs/current/commands.md

@23prime 23prime merged commit f8eb286 into main Mar 17, 2026
16 checks passed
@23prime 23prime deleted the feature/43-priority-resolution-list branch March 17, 2026 03:47
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.

feat: bl priority list + bl resolution list

2 participants