feat: add media command (mediaStorage), deprecate upload#78
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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
This PR introduces a new runware media command group backed by the mediaStorage API task (upload + delete), refactors the shared local-path/URL/data-URI input handling into internal/cmdutil, and marks the legacy runware upload command as deprecated.
Changes:
- Add
runware media uploadandrunware media deletecommands wired toClient.MediaStorage. - Extract the shared image input builder into
internal/cmdutil.BuildImageInputwith unit tests. - Deprecate (but keep)
runware upload, and update end-user docs to highlightmedia.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Replaces the “Upload” section with “Media”, documenting media upload/delete and noting upload is deprecated. |
| internal/cmdutil/mediainput.go | New shared helper to turn `<file |
| internal/cmdutil/mediainput_test.go | Updates and relocates tests to cover cmdutil.BuildImageInput. |
| internal/cmd/upload/upload.go | Deprecates upload command and switches to using cmdutil.BuildImageInput. |
| internal/cmd/root.go | Registers the new media command group on the root command. |
| internal/cmd/media/upload.go | Implements runware media upload (calls MediaStorage(upload, ...)) and prints mediaUUID/mediaURL/taskUUID. |
| internal/cmd/media/media.go | Defines the media command group and attaches upload/delete subcommands. |
| internal/cmd/media/delete.go | Implements runware media delete (calls MediaStorage(delete, <uuid>)) and prints mediaUUID/taskUUID. |
| internal/api/types.go | Adds MediaStorageRequest / MediaStorageResult types for the new task. |
| internal/api/media_storage_test.go | Adds unit tests validating request construction and response parsing for upload/delete operations. |
| internal/api/constants.go | Adds taskTypeMediaStorage and operation constants (upload, delete). |
| internal/api/client.go | Adds Client.MediaStorage and documents UploadImage as superseded. |
| docs/runware.md | Adds runware media to top-level docs list (but removes runware upload entry). |
| docs/runware_media.md | Adds docs page for the runware media command group. |
| docs/runware_media_upload.md | Adds docs page for runware media upload. |
| docs/runware_media_delete.md | Adds docs page for runware media delete. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
danmrichards
left a comment
There was a problem hiding this comment.
Linter isn't happy with one of your tests
ee4c360 to
c499ee2
Compare
Adds a
mediacommand group backed by themediaStoragetask:runware media upload <file|url>— store media, returns mediaUUID + mediaURLrunware media delete <mediaUUID>— permanently delete stored mediaDeprecates the
uploadcommand (kept, still works) in favor ofmedia upload, matching the SDK deprecation ofimageUpload→mediaStorage. Extracts the shared image-input builder intocmdutil.