Conversation
…le commands
- bl issue attachment delete <key> <id> — DELETE /api/v2/issues/{key}/attachments/{id}
- bl issue participant list <key> — GET /api/v2/issues/{key}/participants
- bl issue shared-file list <key> — GET /api/v2/issues/{key}/sharedFiles
- bl issue shared-file link <key> --shared-file-id <id> — POST (try_new validates non-empty)
- bl issue shared-file unlink <key> <id> — DELETE /api/v2/issues/{key}/sharedFiles/{id}
📝 WalkthroughWalkthroughThis PR introduces five new issue-related CLI commands for managing attachments, participants, and shared files. It adds Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
✨ Simplify code
📝 Coding Plan
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 |
There was a problem hiding this comment.
Pull request overview
This PR adds new bl issue subcommands for deleting issue attachments, listing issue participants, and managing shared files linked to issues, including the necessary Backlog API client endpoints and documentation updates (EN + JA).
Changes:
- Add CLI subcommands:
bl issue attachment delete,bl issue participant list, andbl issue shared-file {list,link,unlink}. - Extend the API layer with participant/shared-file models and new endpoints (delete attachment, list participants, list/link/unlink shared files).
- Update the commands documentation and endpoint mapping tables in both English and Japanese docs.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/commands.md | Documents new commands and marks their API mappings as implemented. |
| website/i18n/ja/docusaurus-plugin-content-docs/current/commands.md | Japanese docs equivalent updates for the new commands and mapping table. |
| src/main.rs | Registers new clap subcommands and wires them to cmd handlers. |
| src/cmd/issue/mod.rs | Exposes new participant and shared_file modules under cmd::issue. |
| src/cmd/issue/attachment/mod.rs | Adds delete submodule and re-exports its args/handler. |
| src/cmd/issue/attachment/delete.rs | Implements attachment deletion command + unit tests via BacklogApi mock. |
| src/cmd/issue/participant/mod.rs | Module wiring and re-exports for participant commands. |
| src/cmd/issue/participant/list.rs | Implements participant listing command + tests. |
| src/cmd/issue/shared_file/mod.rs | Module wiring and re-exports for shared-file commands. |
| src/cmd/issue/shared_file/list.rs | Implements shared-file listing command + tests (includes shared test helper). |
| src/cmd/issue/shared_file/link.rs | Implements shared-file link command with validation + tests. |
| src/cmd/issue/shared_file/unlink.rs | Implements shared-file unlink command + tests. |
| src/api/mod.rs | Extends BacklogApi trait and client impl with new issue attachment/participant/shared-file methods. |
| src/api/issue.rs | Adds IssueParticipant/IssueSharedFile models, client endpoints, and httpmock-based API tests. |
You can also share your feedback on Copilot code review. Take the survey.
website/i18n/ja/docusaurus-plugin-content-docs/current/commands.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/cmd/issue/participant/list.rs (1)
113-118: Assert the numeric-id fallback instead of only success.
list_with_bot_falls_back_to_numeric_idcurrently only checksis_ok(), so a regression in the[99] Botrendering would still pass. Please capture the output, or extract the formatter into a helper and assert the fallback string.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/cmd/issue/participant/list.rs` around lines 113 - 118, Update the test list_with_bot_falls_back_to_numeric_id to assert the actual fallback output rather than only checking is_ok(): call list_with(...) and capture its Result output (or stdout string) and assert that the rendered participant string contains the numeric-id fallback (e.g. "[99] Bot" or the numeric id produced by bot_participant()). Alternatively, extract the formatting logic used by list_with into a helper formatter function (the code path that formats Participant entries) and call that helper directly with bot_participant(), then assert the returned string equals the expected numeric-id fallback. Ensure you reference the existing functions list_with, bot_participant, and args(false) when locating the test and the formatter helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/api/issue.rs`:
- Around line 248-252: The form parameter name is wrong when linking shared
files: change the params created from mapping shared_file_ids (in the block that
builds Vec<(String,String)> and calls
self.post_form(&format!("/issues/{}/sharedFiles", key), ¶ms) ) to use
"fileId[]" as the key instead of "sharedFileId[]", so the request matches the
Backlog API contract; leave the rest (post_form call and URL) unchanged.
In `@website/docs/commands.md`:
- Line 911: Update the command signature line that currently reads "bl issue
shared-file unlink <id-or-key> <id>" to use a clearer parameter name: change the
second parameter to "<shared-file-id>" so it reads "bl issue shared-file unlink
<id-or-key> <shared-file-id>"; this replaces the ambiguous "<id>" in the command
signature (the line containing "bl issue shared-file unlink <id-or-key> <id>" in
the docs) to improve consistency and clarity.
In `@website/i18n/ja/docusaurus-plugin-content-docs/current/commands.md`:
- Line 915: Update the command example string `bl issue shared-file unlink
<id-or-key> <id>` to use the clearer parameter name `bl issue shared-file unlink
<id-or-key> <shared-file-id>` so it matches other command lines and the CLI
intent; edit the literal table cell text containing that command (the row with
`DELETE /api/v2/issues/{issueIdOrKey}/sharedFiles/{id}`) and verify any other
occurrences of `<id>` in the "shared-file" command rows are renamed to
`<shared-file-id>` for consistency.
---
Nitpick comments:
In `@src/cmd/issue/participant/list.rs`:
- Around line 113-118: Update the test list_with_bot_falls_back_to_numeric_id to
assert the actual fallback output rather than only checking is_ok(): call
list_with(...) and capture its Result output (or stdout string) and assert that
the rendered participant string contains the numeric-id fallback (e.g. "[99]
Bot" or the numeric id produced by bot_participant()). Alternatively, extract
the formatting logic used by list_with into a helper formatter function (the
code path that formats Participant entries) and call that helper directly with
bot_participant(), then assert the returned string equals the expected
numeric-id fallback. Ensure you reference the existing functions list_with,
bot_participant, and args(false) when locating the test and the formatter
helper.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 55e3bfb6-dd9c-4e5e-999c-49e068ea40ea
📒 Files selected for processing (14)
src/api/issue.rssrc/api/mod.rssrc/cmd/issue/attachment/delete.rssrc/cmd/issue/attachment/mod.rssrc/cmd/issue/mod.rssrc/cmd/issue/participant/list.rssrc/cmd/issue/participant/mod.rssrc/cmd/issue/shared_file/link.rssrc/cmd/issue/shared_file/list.rssrc/cmd/issue/shared_file/mod.rssrc/cmd/issue/shared_file/unlink.rssrc/main.rswebsite/docs/commands.mdwebsite/i18n/ja/docusaurus-plugin-content-docs/current/commands.md
Checklist
mainSummary
bl issue attachment delete <key> <attachment-id>— DELETE attachmentbl issue participant list <key>— list issue participants (bot-safe: falls back to numeric ID whenuserIdis null)bl issue shared-file list <key>— list linked shared filesbl issue shared-file link <key> --shared-file-id <id>— link shared files (try_newvalidates non-empty list)bl issue shared-file unlink <key> <shared-file-id>— unlink a shared fileReason for change
Implements missing issue attachment/participant/shared-file endpoints (closes #60 area).
Changes
src/api/issue.rs: addIssueParticipant,IssueSharedFilestructs + 5 newBacklogClientmethods + httpmock testssrc/api/mod.rs: add 5 trait methods with defaultunimplemented!()+BacklogApi for BacklogClientdelegatessrc/cmd/issue/attachment/delete.rs: newsrc/cmd/issue/participant/: newlistsubcommandsrc/cmd/issue/shared_file/: newlist,link,unlinksubcommandssrc/main.rs: clap wiringNotes
Reimplementation from scratch on current
main(previous draft PR #60 had widespread conflicts due toBacklogApidefault impl refactor in #63).