Skip to content

feat: add bl space upload-attachment command#126

Merged
23prime merged 3 commits intomainfrom
feature/121-space-upload-attachment
Mar 22, 2026
Merged

feat: add bl space upload-attachment command#126
23prime merged 3 commits intomainfrom
feature/121-space-upload-attachment

Conversation

@23prime
Copy link
Copy Markdown
Owner

@23prime 23prime commented Mar 22, 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 space upload-attachment <file> command (POST /api/v2/space/attachment)
  • New SpaceAttachment / SpaceAttachmentUser structs in src/api/space.rs
  • New post_multipart() method on BacklogClient (no 401 retry; documented)
  • Output: text (ID / Name / Size / Created) or --json
  • Coverage table updated from "Planned" to "✅ Implemented"

Reason for change

Completes full API v2 space endpoint coverage.

Changes

  • Cargo.toml: add "multipart" to reqwest features
  • src/api/space.rs: SpaceAttachmentUser, SpaceAttachment, upload_space_attachment()
  • src/api/mod.rs: post_multipart(), trait + impl for upload_space_attachment
  • src/cmd/space/upload_attachment.rs: command implementation + tests
  • src/cmd/space/mod.rs: re-export
  • src/main.rs: SpaceCommands::UploadAttachment variant + dispatch
  • website/docs/commands.md, website/i18n/ja/.../commands.md: docs + coverage table

Notes

POST command — real API test skipped to avoid modifying live data.

Closes #121

23prime added 2 commits March 22, 2026 23:19
Implements POST /api/v2/space/attachment via multipart form upload.
Outputs attachment metadata (ID, name, size, created) as text or JSON.

Closes #121
Copilot AI review requested due to automatic review settings March 22, 2026 14:29
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 22, 2026

Warning

Rate limit exceeded

@23prime has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b218f459-0399-465c-be31-eeaa88b94676

📥 Commits

Reviewing files that changed from the base of the PR and between 89bbd1e and 4543aab.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • Cargo.toml
  • src/api/mod.rs
  • src/api/space.rs
  • src/api/user.rs
  • src/cmd/space/mod.rs
  • src/cmd/space/upload_attachment.rs
  • src/cmd/user/icon.rs
  • src/cmd/user/mod.rs
  • src/main.rs
  • website/docs/commands.md
  • website/i18n/ja/docusaurus-plugin-content-docs/current/commands.md
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feature/121-space-upload-attachment

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
Copy Markdown

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 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 by POST /api/v2/space/attachment (multipart upload) with text or --json output.
  • Add bl user icon <id> backed by GET /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
@23prime 23prime merged commit a02081f into main Mar 22, 2026
8 checks passed
@23prime 23prime deleted the feature/121-space-upload-attachment branch March 22, 2026 14:40
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: implement bl space upload-attachment (POST /api/v2/space/attachment)

2 participants