[PR #72] [MERGED] fix: support Google Shared Drives in gdrive connector #98

Closed
opened 2026-10-18 21:14:20 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/oikb/pull/72
Author: @joelchrist
Created: 7/1/2026
Status: ✅ Merged
Merged: 7/17/2026
Merged by: @tjbck

Base: main ← Head: fix/gdrive-shared-drives


📝 Commits (1)

  • e4ceaaf fix: support Google Shared Drives in gdrive connector

📊 Changes

2 files changed (+27 additions, -3 deletions)

View changed files

📝 CHANGELOG.md (+6 -0)
📝 src/oikb/connectors/gdrive.py (+21 -3)

📄 Description

Summary

Fixes #52 — the gdrive connector reported "nothing to do" when the target folder lives inside a Google Shared Drive (formerly Team Drive), even with correct service-account permissions.

The Drive API's files.list does not return items from Shared Drives unless the request opts in with supportsAllDrives=True and includeItemsFromAllDrives=True. Personal "My Drive" folders work because they don't require these flags — which is why the connector worked in that case but silently returned an empty listing for Shared Drives.

Changes

src/oikb/connectors/gdrive.py:

  • Add supportsAllDrives=True and includeItemsFromAllDrives=True to all files.list calls — one in _walk_folder() and both in _find_file().
  • Pass supportsAllDrives=True to files.get and files.get_media in read_file() so Shared Drive files can be downloaded. (files.export accepts only fileId/mimeType and works by ID, so it is left unchanged.)

The flags are a no-op for My Drive folders, so existing behaviour is unchanged.

Testing

  • python -m py_compile src/oikb/connectors/gdrive.py passes.
  • Manual: with a service account granted access to a Shared Drive folder, oikb diff gdrive:<shared-drive-folder-id> --kb-id <kb> now lists files instead of reporting "nothing to do".

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/oikb/pull/72 **Author:** [@joelchrist](https://github.com/joelchrist) **Created:** 7/1/2026 **Status:** ✅ Merged **Merged:** 7/17/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `fix/gdrive-shared-drives` --- ### 📝 Commits (1) - [`e4ceaaf`](https://github.com/open-webui/oikb/commit/e4ceaaf67273b93a2a5183e11afc976471fc6b09) fix: support Google Shared Drives in gdrive connector ### 📊 Changes **2 files changed** (+27 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+6 -0) 📝 `src/oikb/connectors/gdrive.py` (+21 -3) </details> ### 📄 Description ## Summary Fixes #52 — the `gdrive` connector reported "nothing to do" when the target folder lives inside a Google **Shared Drive** (formerly Team Drive), even with correct service-account permissions. The Drive API's `files.list` does not return items from Shared Drives unless the request opts in with `supportsAllDrives=True` and `includeItemsFromAllDrives=True`. Personal "My Drive" folders work because they don't require these flags — which is why the connector worked in that case but silently returned an empty listing for Shared Drives. ## Changes `src/oikb/connectors/gdrive.py`: - Add `supportsAllDrives=True` and `includeItemsFromAllDrives=True` to all `files.list` calls — one in `_walk_folder()` and both in `_find_file()`. - Pass `supportsAllDrives=True` to `files.get` and `files.get_media` in `read_file()` so Shared Drive files can be downloaded. (`files.export` accepts only `fileId`/`mimeType` and works by ID, so it is left unchanged.) The flags are a no-op for My Drive folders, so existing behaviour is unchanged. ## Testing - `python -m py_compile src/oikb/connectors/gdrive.py` passes. - Manual: with a service account granted access to a Shared Drive folder, `oikb diff gdrive:<shared-drive-folder-id> --kb-id <kb>` now lists files instead of reporting "nothing to do". 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:14:20 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/oikb#98
No description provided.