Skip to content

Support Shared Drives and improve file ID extraction in DriveService#7

Open
raybell-md wants to merge 3 commits intomainfrom
fix-shared-drive-download-14910952148528428578
Open

Support Shared Drives and improve file ID extraction in DriveService#7
raybell-md wants to merge 3 commits intomainfrom
fix-shared-drive-download-14910952148528428578

Conversation

@raybell-md
Copy link
Owner

This PR addresses an issue where downloading files from Google Shared Drives failed with a "File not found" error. It also makes the drive.downloadFile tool more robust by allowing it to accept full Drive URLs as input. Consistently applied Shared Drive support across other Workspace services (Docs, Sheets, Slides) for search, create, and move operations.

Fixes #6


PR created automatically by Jules for task 14910952148528428578 started by @raybell-md

- Added `supportsAllDrives: true` and `includeItemsFromAllDrives: true` to Drive API calls in `DriveService`, `DocsService`, `SheetsService`, and `SlidesService`.
- Improved `drive.downloadFile` to robustly handle full Drive URLs by extracting the file ID using `extractDocumentId`.
- Updated unit tests to verify Shared Drive support and URL handling.

Co-authored-by: raybell-md <196701227+raybell-md@users.noreply.github.com>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

fileId: id,
fields: 'id, name, mimeType',
supportsAllDrives: true,
});
Copy link
Owner Author

@raybell-md raybell-md Feb 9, 2026

Choose a reason for hiding this comment

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

@jules Shouldn't this have includeItemsFromAllDrives: true?

Choose a reason for hiding this comment

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

Actually, drive.files.get (which is used here) only supports supportsAllDrives, not includeItemsFromAllDrives. The latter is used for list operations to include items from all drives in results. I have ensured supportsAllDrives: true is present for all get calls, which is what the API requires for retrieving a specific file from a shared drive.

@raybell-md
Copy link
Owner Author

@jules Shouldn't drive.downloadFile have includeItemsFromAllDrives: true?

@google-labs-jules
Copy link

@jules Shouldn't drive.downloadFile have includeItemsFromAllDrives: true?

Hi! I checked the Google Drive API documentation and verified with the TypeScript types in the googleapis library. drive.files.get does not support includeItemsFromAllDrives; it only uses supportsAllDrives to indicate shared drive support for single-file operations. I've already added includeItemsFromAllDrives: true to all drive.files.list calls across the services (Drive, Docs, Sheets, Slides) to ensure comprehensive shared drive support for searches and listings.

- Added `supportsAllDrives: true` and `includeItemsFromAllDrives: true` to Drive API calls in `DriveService`, `DocsService`, `SheetsService`, and `SlidesService`.
- Improved `drive.downloadFile` to robustly handle full Drive URLs by extracting the file ID using `extractDocumentId`.
- Updated unit tests to verify Shared Drive support and URL handling.

Co-authored-by: raybell-md <196701227+raybell-md@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

unable to download a file from a shared drive

2 participants