Expand Drive --convert-to to sheet|doc|slides#226
Closed
TheCrazyLex wants to merge 1 commit intoopenclaw:mainfrom
Closed
Expand Drive --convert-to to sheet|doc|slides#226TheCrazyLex wants to merge 1 commit intoopenclaw:mainfrom
TheCrazyLex wants to merge 1 commit intoopenclaw:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new --convert-to sheet option to Drive upload/copy commands so users can directly convert uploaded/copied files into Google Sheets by setting Drive metadata mimeType=application/vnd.google-apps.spreadsheet.
Changes:
- Add
--convert-to sheetflag togog drive uploadandgog drive copy, with validation viadriveConvertToMimeType. - Plumb optional
targetMimeTypeinto the Drive copy helper and apply it to the Drive API request metadata. - Extend tests and docs to cover conversion behavior and updated command signatures/examples.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/cmd/drive.go | Adds --convert-to flags, conversion validation helper, and sets upload metadata MimeType when requested. |
| internal/cmd/drive_copy.go | Extends copyViaDrive helper to accept/apply an optional target MIME type. |
| internal/cmd/docs.go | Updates Docs copy command callsite for new copyViaDrive signature. |
| internal/cmd/sheets.go | Updates Sheets copy command callsite for new copyViaDrive signature. |
| internal/cmd/slides.go | Updates Slides copy command callsite for new copyViaDrive signature. |
| internal/cmd/drive_helpers_test.go | Adds unit tests for driveConvertToMimeType (valid/invalid values, exit code). |
| internal/cmd/drive_commands_more_test.go | Extends integration-style Drive command test to assert conversion metadata is sent on copy/upload. |
| docs/spec.md | Updates documented CLI signatures for Drive copy/upload to include --convert-to sheet. |
| README.md | Adds examples demonstrating --convert-to sheet for Drive copy/upload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Extend Drive conversion support for both upload and copy commands by mapping --convert-to values to Google Workspace target mimeTypes for sheet, doc, and slides. Keep the CLI surface simple with one conversion flag while expanding validation and tests across all supported targets. Invalid values now report the allowed set explicitly. Harden upload conversion tests by parsing multipart upload metadata instead of brittle substring matching, addressing PR review feedback. Update Drive examples in README and command signatures in docs/spec for the expanded conversion target set.
f37ec86 to
b6ff833
Compare
Contributor
Author
|
@steipete Please review |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
N/A
Summary
Expand Drive conversion support to allow
--convert-to sheet|doc|slidesfor both upload and copy flows, with stronger request-level test coverage and updated docs.Changes
gog drive copy--convert-toto supportsheet,doc, andslidesgog drive upload--convert-toto supportsheet,doc, andslidessheet->application/vnd.google-apps.spreadsheetdoc->application/vnd.google-apps.documentslides->application/vnd.google-apps.presentationsheet|doc|slides)docs/spec.mdcommand signaturesTesting
go test ./internal/cmd/...--convert-to nopereturns usage error with allowed valuesChecklist