feat: add bl space upload-attachment command#126
Conversation
Implements POST /api/v2/space/attachment via multipart form upload. Outputs attachment metadata (ID, name, size, created) as text or JSON. Closes #121
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
✨ Finishing Touches✨ Simplify code
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
Adds new CLI coverage for Backlog API v2 space attachment upload (and also introduces a user icon download command), extending the BacklogClient API surface and updating the command reference docs accordingly.
Changes:
- Add
bl space upload-attachment <file>backed byPOST /api/v2/space/attachment(multipart upload) with text or--jsonoutput. - Add
bl user icon <id>backed byGET /api/v2/users/{userId}/icon, including filename fallback behavior. - Enable reqwest multipart support and update English/Japanese command docs + endpoint coverage tables.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Enable reqwest multipart feature required for file uploads. |
| Cargo.lock | Lockfile updates for newly pulled transitive deps. |
| src/api/mod.rs | Add BacklogApi trait methods and new BacklogClient::post_multipart() helper. |
| src/api/space.rs | Add SpaceAttachment* structs and upload_space_attachment() implementation. |
| src/api/user.rs | Add download_user_icon() API wrapper. |
| src/cmd/space/mod.rs | Export the new upload_attachment subcommand wiring. |
| src/cmd/space/upload_attachment.rs | Implement CLI command + unit tests + text formatting. |
| src/cmd/user/mod.rs | Add module/export wiring for the new user icon command. |
| src/cmd/user/icon.rs | Implement icon download command + default filename logic + tests. |
| src/main.rs | Add CLI variants + dispatch for space upload-attachment and user icon. |
| website/docs/commands.md | Document new commands and update endpoint coverage table. |
| website/i18n/ja/.../commands.md | Japanese docs for new commands + coverage table updates. |
Addresses review comment: post_multipart bypasses execute() retry on 401 and reads entire file into memory
Checklist
mainwebsite/docs/,website/i18n/ja/,README.md)Summary
bl space upload-attachment <file>command (POST /api/v2/space/attachment)SpaceAttachment/SpaceAttachmentUserstructs insrc/api/space.rspost_multipart()method onBacklogClient(no 401 retry; documented)--jsonReason for change
Completes full API v2 space endpoint coverage.
Changes
Cargo.toml: add"multipart"to reqwest featuressrc/api/space.rs:SpaceAttachmentUser,SpaceAttachment,upload_space_attachment()src/api/mod.rs:post_multipart(), trait + impl forupload_space_attachmentsrc/cmd/space/upload_attachment.rs: command implementation + testssrc/cmd/space/mod.rs: re-exportsrc/main.rs:SpaceCommands::UploadAttachmentvariant + dispatchwebsite/docs/commands.md,website/i18n/ja/.../commands.md: docs + coverage tableNotes
POST command — real API test skipped to avoid modifying live data.
Closes #121