Skip to content

feat: add bl issue comment count/show and comment notification list/add#64

Merged
23prime merged 2 commits intomainfrom
feature/issue-comment-enhancements
Mar 15, 2026
Merged

feat: add bl issue comment count/show and comment notification list/add#64
23prime merged 2 commits intomainfrom
feature/issue-comment-enhancements

Conversation

@23prime
Copy link
Owner

@23prime 23prime commented Mar 15, 2026

Checklist

  • Target branch is main
  • Status checks are passing

Summary

  • bl issue comment count <key> — GET /api/v2/issues/{key}/comments/count
  • bl issue comment show <key> <comment-id> — GET /api/v2/issues/{key}/comments/{id}
  • bl issue comment notification list <key> <comment-id> — GET /api/v2/issues/{key}/comments/{id}/notifications
  • bl issue comment notification add <key> <comment-id> --notified-user-id <id> — POST /api/v2/issues/{key}/comments/{id}/notifications

Reason for change

Implements missing issue comment endpoints (closes #46 area).

Changes

  • src/api/issue.rs: add IssueCommentCount and IssueCommentNotification structs + 4 new BacklogClient methods + httpmock tests
  • src/api/mod.rs: add 4 trait methods with default unimplemented!() + BacklogApi for BacklogClient delegates
  • src/cmd/issue/comment/count.rs: new — bl issue comment count
  • src/cmd/issue/comment/show.rs: new — bl issue comment show
  • src/cmd/issue/comment/notification/: new — list and add subcommands
  • src/main.rs: clap wiring for new subcommands
  • website/docs/commands.md, website/i18n/ja/.../commands.md: docs + coverage table updated

Notes

Reimplementation from scratch on current main (previous draft PR #59 had widespread conflicts due to BacklogApi default impl refactor in #63).

- bl issue comment count <key> — GET /api/v2/issues/{key}/comments/count
- bl issue comment show <key> <comment-id> — GET /api/v2/issues/{key}/comments/{id}
- bl issue comment notification list <key> <comment-id> — GET notifications
- bl issue comment notification add <key> <comment-id> --notified-user-id <id> — POST notifications
Copilot AI review requested due to automatic review settings March 15, 2026 09:49
@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c227a7d9-2b5f-49df-8389-88a1ecdab715

📥 Commits

Reviewing files that changed from the base of the PR and between cc5aa71 and 3a7395b.

📒 Files selected for processing (2)
  • src/cmd/issue/comment/notification/add.rs
  • src/main.rs

📝 Walkthrough

Walkthrough

This PR adds comment-focused Backlog API endpoints and CLI commands: comment count, show, notification list, and notification add, including data structures, client trait wiring, CLI handlers, tests, and documentation updates.

Changes

Cohort / File(s) Summary
API Layer - Data & Methods
src/api/issue.rs, src/api/mod.rs
Added IssueCommentCount and IssueCommentNotification public structs and four BacklogApi / BacklogClient methods: count_issue_comments, get_issue_comment, get_issue_comment_notifications, add_issue_comment_notifications with corresponding HTTP paths.
CLI - Count & Show
src/cmd/issue/comment/count.rs, src/cmd/issue/comment/show.rs
New command modules for counting comments and showing a comment; support text/JSON output, include arg structs and unit tests with MockApi.
CLI - Notifications
src/cmd/issue/comment/notification/add.rs, src/cmd/issue/comment/notification/list.rs
New modules to list and add comment notifications; construct request params, format outputs (text/JSON), validate inputs, and include unit tests.
Module Declarations & Re-exports
src/cmd/issue/comment/mod.rs, src/cmd/issue/comment/notification/mod.rs
Added new submodules and public re-exports to expose count, show, and notification commands and argument types.
CLI Dispatch Wiring
src/main.rs
Expanded command enums to include Count, Show, Notification (with List/Add) and added dispatch logic to invoke new handlers.
Docs
website/docs/commands.md, website/i18n/ja/docusaurus-plugin-content-docs/current/commands.md
Documented new CLI commands and marked the four new comment-related API endpoints as implemented in English and Japanese docs.

Sequence Diagram(s)

sequenceDiagram
  participant CLI as CLI (bl)
  participant Client as BacklogClient
  participant API as Backlog API (HTTP)
  participant Server as Backlog Server

  CLI->>Client: count_issue_comments(key) / get_issue_comment(...)
  Client->>API: HTTP GET/POST /issues/{key}/comments/...
  API->>Server: handle request, fetch data
  Server-->>API: response JSON
  API-->>Client: parsed structs (IssueCommentCount / IssueComment / IssueCommentNotification[])
  Client-->>CLI: return Result
  CLI->>CLI: render text or pretty JSON
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐇 I hopped through code with ears held high,

Counting comments beneath the sky,
Showing words and ringing bell,
Notifying friends — all is well! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.85% 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 accurately and concisely summarizes the main changes: adding four new CLI commands for issue comment operations (count, show, and notification list/add).
Description check ✅ Passed The description provides a clear summary of the four new commands, their corresponding API endpoints, implementation details, and the reason for the changes.
Linked Issues check ✅ Passed All four objectives from issue #46 are fully implemented: count, show, and notification list/add commands with their corresponding API endpoints.
Out of Scope Changes check ✅ Passed All code changes are directly related to implementing the four issue comment commands specified in issue #46; no unrelated or out-of-scope modifications detected.

✏️ 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
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/issue-comment-enhancements
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feature/issue-comment-enhancements
📝 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

Adds missing Backlog issue comment endpoints/commands to the Rust-based bl CLI, expanding the issue comment command group with count/show and comment-notification management.

Changes:

  • Added new CLI subcommands: bl issue comment count, bl issue comment show, and bl issue comment notification {list,add} (with clap wiring).
  • Extended the API layer with issue comment count/comment show/notification list+add methods and corresponding structs, including httpmock tests.
  • Updated English/Japanese command documentation and the endpoint coverage table.

Reviewed changes

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

Show a summary per file
File Description
src/api/issue.rs Adds IssueCommentCount / IssueCommentNotification types and 4 BacklogClient methods + httpmock tests.
src/api/mod.rs Extends BacklogApi trait with new methods and delegates them in impl BacklogApi for BacklogClient.
src/main.rs Adds clap subcommands/enums and dispatch for the new issue comment operations.
src/cmd/issue/comment/mod.rs Registers new comment subcommand modules and re-exports count/show.
src/cmd/issue/comment/count.rs Implements bl issue comment count command logic + unit tests.
src/cmd/issue/comment/show.rs Implements bl issue comment show command logic + unit tests.
src/cmd/issue/comment/notification/mod.rs New module wiring for notification add/list.
src/cmd/issue/comment/notification/list.rs Implements notification listing + formatting + unit tests.
src/cmd/issue/comment/notification/add.rs Implements notification add + unit tests.
website/docs/commands.md Adds documentation sections for new commands and marks endpoints as implemented.
website/i18n/ja/docusaurus-plugin-content-docs/current/commands.md Japanese documentation parity for new commands + coverage table updates.

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

… tests

- IssueCommentNotificationAddArgs::new → try_new; bail when notified_user_ids
  is empty (consistent with project validation-layer convention in AGENTS.md)
- MockApi captures params so tests can assert notifiedUserId[] key/value pairs
@23prime 23prime merged commit 7c0f1e2 into main Mar 15, 2026
11 checks passed
@23prime 23prime deleted the feature/issue-comment-enhancements branch March 15, 2026 11: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 issue comment enhancements (count / show / notifications)

2 participants