close
Skip to content

fix(drive): pass supportsAllDrives=true in +upload to support Shared Drives#748

Open
hoyt-harness wants to merge 1 commit intogoogleworkspace:mainfrom
hoyt-harness:fix/722-drive-upload-shared-drives
Open

fix(drive): pass supportsAllDrives=true in +upload to support Shared Drives#748
hoyt-harness wants to merge 1 commit intogoogleworkspace:mainfrom
hoyt-harness:fix/722-drive-upload-shared-drives

Conversation

@hoyt-harness
Copy link
Copy Markdown

Problem

drive +upload calls files.create without the supportsAllDrives=true query parameter. The Drive API rejects any request that targets a Shared Drive folder (via --parent) unless this parameter is present, returning a 404 or 403 even when the user has full access to the Shared Drive.

Reported in #722.

Fix

Pass supportsAllDrives: true unconditionally in the query params for every +upload call. This parameter is documented as harmless for My Drive uploads — it simply opts the request into Shared Drive awareness.

$ gws drive +upload ./file.txt --parent SHARED_DRIVE_FOLDER_ID --dry-run
{
  "query_params": [["supportsAllDrives", "true"]],
  ...
}

Updated after_help text to document Shared Drive support.

Test plan

  • Dry-run output confirms supportsAllDrives=true appears in query_params
  • All 5 existing helpers::drive unit tests pass
  • My Drive uploads unaffected (parameter is a no-op when not targeting a Shared Drive)

Closes #722

🤖 Generated with Claude Code

…lders work

Previously the files.create call omitted supportsAllDrives, causing the API
to reject --parent values that point to Shared Drive folders (404/403 even
when the user had access). The parameter is harmless for My Drive uploads.

Fixes googleworkspace#722
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where file uploads to Shared Drive folders were failing due to missing API parameters. By unconditionally including supportsAllDrives=true in the upload request, the CLI now correctly interacts with Shared Drive structures while maintaining compatibility with standard My Drive uploads.

Highlights

  • Shared Drive Support: Enabled support for uploading files directly to Shared Drive folders by passing the supportsAllDrives=true parameter to the Google Drive API.
  • Documentation Update: Updated the CLI help text to explicitly mention support for Shared Drive folders via the --parent flag.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@googleworkspace-bot googleworkspace-bot added the area: core Core CLI parsing, commands, error handling, utilities label Apr 22, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables file uploads to Shared Drive folders in the drive +upload command by passing the supportsAllDrives=true parameter to the API request. It also updates the command's help documentation and examples to reflect this support. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Core CLI parsing, commands, error handling, utilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gws drive +upload doesn't work with Shared Drive folders

2 participants