Skip to content

Google Drive source: add drive_id config to scope sync to a specific shared drive #1735

@VictorMustin

Description

@VictorMustin

Problem

When authenticating with a Google account that has access to multiple shared drives (and My Drive), there's no way to scope the sync to a single shared drive. The only config option is include_patterns, which matches folder/file names — but shared drive names are not matchable since they're drive objects, not folders.

This means:

  • Users must list every top-level folder explicitly as include patterns
  • When new folders are added to the shared drive, they're silently excluded until patterns are updated
  • There's no "set and forget" way to say "sync everything in this shared drive"

Proposed solution

Add an optional drive_id (or shared_drive_id) field to GoogleDriveConfig:

class GoogleDriveConfig(SourceConfig):
    drive_id: Optional[str] = Field(
        default=None,
        title="Shared Drive ID",
        description="If set, only sync files from this specific shared drive. Omit to sync all drives.",
    )
    include_patterns: list[str] = Field(...)

The plumbing already exists — generate_entities already iterates over drive_ids and passes drive_id to _generate_file_entities. This would just filter the list to a single drive before iteration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions