Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Nov 18, 2025

WHY

Resolves #19118

Summary by CodeRabbit

  • New Features
    • Added four new Google Drive polling sources for enhanced monitoring: detect new files, track comment activity, monitor folder changes, and identify new spreadsheets. Each source supports custom folder filtering and provides sample data for testing.

@jcortes jcortes self-assigned this Nov 18, 2025
@vercel
Copy link

vercel bot commented Nov 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Nov 18, 2025 9:50pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 18, 2025 9:50pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

Walkthrough

This PR introduces four new polling-based sources for Google Drive—new files, new/modified comments, new/modified folders, and new spreadsheets—each with associated test-event fixtures. The package version is bumped to 1.4.0. These sources offer alternatives to webhook-based triggers by using page tokens and timestamps for state tracking across runs.

Changes

Cohort / File(s) Summary
Package Version Update
components/google_drive/package.json
Version bumped from 1.3.1 to 1.4.0
New Files (Polling) Source
components/google_drive/sources/new-files-instant-polling/new-files-instant-polling.mjs, ...test-event.mjs
Polling source emitting events for new non-folder files in watched Google Drive, using page tokens and last-run timestamps for state tracking. Deploy hook initializes state and emits up to 5 sample files from the last 30 days. Test event provides sample file metadata.
New or Modified Comments (Polling) Source
components/google_drive/sources/new-or-modified-comments-polling/new-or-modified-comments-polling.mjs, ...test-event.mjs
Polling source streaming new or modified comments on a specified file with init-time and last-seen timestamps. Deploy hook seeds up to 5 sample comments. Test event includes sample comment with nested reply structure.
New or Modified Folders (Polling) Source
components/google_drive/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs, ...test-event.mjs
Polling source tracking new or modified folders with optional subfolder inclusion via parent traversal. Page token and per-file timestamp management. Deploy hook seeds initial folder events from last 30 days. Test event provides sample folder metadata.
New Spreadsheet (Polling) Source
components/google_drive/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs, ...test-event.mjs
Polling source for new spreadsheets with page token and last-run timestamp state management. Filters by MIME type and optional folder restrictions. Deploy hook initializes state and emits up to 5 sample spreadsheets from last 30 days. Test event provides sample spreadsheet file resource.

Sequence Diagram(s)

sequenceDiagram
    participant Deploy as Deploy Hook
    participant Run as Run Loop
    participant DB as State (DB)
    participant GDrive as Google Drive API
    participant Emit as Event Emission

    Deploy->>DB: Initialize pageToken & timestamp
    Deploy->>GDrive: Fetch recent items (last 30 days)
    Deploy->>Emit: Emit up to 5 sample events
    
    loop Every trigger interval
        Run->>DB: Get pageToken & lastRunTimestamp
        Run->>GDrive: listChanges(pageToken)
        GDrive-->>Run: Return change pages
        
        loop For each change
            Run->>Run: Filter by type (file/folder/comment)
            Run->>Run: Apply folder/visibility rules
            Run->>Run: Check timestamp > lastRunTimestamp
            alt Passes filter
                Run->>GDrive: Fetch full metadata
                Run->>Emit: Emit event with meta
            end
        end
        
        Run->>DB: Update pageToken
        Run->>DB: Update lastRunTimestamp
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Key areas requiring attention:
    • Verify state management consistency across all four polling sources (page token and timestamp handling)
    • Validate filtering logic correctness for each source type (files, comments, folders, spreadsheets)
    • Ensure deploy hook sample-emit limits (5 items) and 30-day windows are correct
    • Check parent traversal logic in folders source for includeSubfolders feature
    • Confirm test-event structures match actual Google Drive API response formats

Possibly related PRs

Suggested reviewers

  • michelle0927

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR implements 3 of 4 required polling components (#19118): New or Modified Comments, New or Modified Folders, and New Spreadsheet, but omits New Presentation. Clarify whether New Presentation polling component is intended for this PR or a separate deliverable, as issue #19118 lists it as a required component.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding polling-based Google Drive components as alternatives to webhook-based ones, which directly matches the changeset.
Description check ✅ Passed The PR description is minimal, containing only 'Resolves #19118' without substantive detail, but it appropriately references the linked issue that contains full context.
Out of Scope Changes check ✅ Passed All changes align with #19118 objectives: new polling sources for Google Drive and test fixtures for Comments, Folders, and Spreadsheet components plus a version bump.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch google-drive-polling-sources-alternative-to-webhook-sources

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 12

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b616f42 and 0f0e353.

📒 Files selected for processing (9)
  • components/google_drive/package.json (1 hunks)
  • components/google_drive/sources/new-files-instant-polling/new-files-instant-polling.mjs (1 hunks)
  • components/google_drive/sources/new-files-instant-polling/test-event.mjs (1 hunks)
  • components/google_drive/sources/new-or-modified-comments-polling/new-or-modified-comments-polling.mjs (1 hunks)
  • components/google_drive/sources/new-or-modified-comments-polling/test-event.mjs (1 hunks)
  • components/google_drive/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs (1 hunks)
  • components/google_drive/sources/new-or-modified-folders-polling/test-event.mjs (1 hunks)
  • components/google_drive/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs (1 hunks)
  • components/google_drive/sources/new-spreadsheet-polling/test-event.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
components/google_drive/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs (3)
components/google_drive/sources/new-files-instant-polling/new-files-instant-polling.mjs (15)
  • driveId (52-52)
  • driveId (141-141)
  • startPageToken (53-53)
  • daysAgo (59-59)
  • timeString (61-61)
  • args (63-68)
  • args (70-70)
  • pageToken (140-140)
  • fileId (118-122)
  • ts (123-123)
  • meta (132-132)
  • currentRunTimestamp (137-137)
  • changedFilesStream (143-143)
  • changedFilesPage (147-150)
  • fullFile (163-165)
components/google_drive/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs (15)
  • driveId (51-51)
  • driveId (139-139)
  • startPageToken (52-52)
  • daysAgo (58-58)
  • timeString (60-60)
  • args (62-67)
  • args (69-69)
  • pageToken (138-138)
  • fileId (116-120)
  • ts (121-121)
  • meta (130-130)
  • currentRunTimestamp (135-135)
  • changedFilesStream (141-141)
  • changedFilesPage (145-148)
  • fullFile (161-163)
components/google_drive/google_drive.app.mjs (1)
  • changedFiles (424-426)
components/google_drive/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs (1)
components/google_drive/google_drive.app.mjs (1)
  • changedFiles (424-426)
components/google_drive/sources/new-files-instant-polling/new-files-instant-polling.mjs (1)
components/google_drive/google_drive.app.mjs (1)
  • changedFiles (424-426)
components/google_drive/sources/new-or-modified-comments-polling/new-or-modified-comments-polling.mjs (3)
components/google_drive/sources/new-files-instant-polling/new-files-instant-polling.mjs (2)
  • ts (123-123)
  • meta (132-132)
components/google_drive/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs (2)
  • ts (154-154)
  • meta (163-163)
components/google_drive/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs (2)
  • ts (121-121)
  • meta (130-130)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (8)
components/google_drive/sources/new-or-modified-folders-polling/test-event.mjs (1)

1-51: LGTM! Test fixture is well-structured.

The test event fixture correctly represents a Google Drive folder resource with appropriate fields and sample data for testing the polling source.

components/google_drive/sources/new-or-modified-folders-polling/new-or-modified-folders-polling.mjs (1)

167-222: Run method logic is sound.

The polling logic correctly:

  • Tracks state with page tokens and timestamps
  • Fetches full metadata for changed folders
  • Optimizes by skipping unmodified folders (lines 197-204)
  • Applies filtering with shouldProcess
  • Persists state after each page for resumability

This follows the same solid pattern as other polling sources in this PR.

components/google_drive/package.json (1)

3-3: Version bump looks consistent with new sources

Updating the package version to 1.4.0 to ship the new polling sources is appropriate; no issues here.

components/google_drive/sources/new-files-instant-polling/test-event.mjs (1)

1-99: Fixture shape is appropriate for sample file events

The exported object provides realistic Drive file metadata (id, name, parents, mimeType, timestamps, permissions) and matches what the polling source expects for sampleEmit. No issues spotted.

components/google_drive/sources/new-files-instant-polling/new-files-instant-polling.mjs (1)

136-188: Run loop and state updates look logically sound

The run loop correctly:

  • Streams changes via listChanges(pageToken, driveId)
  • Filters out folders and then fetches full metadata
  • Uses createdTime vs lastRunTimestamp to detect truly new files
  • Applies shouldProcess (folder filter) and emits via emitFile
  • Updates pageToken on each page and lastRunTimestamp at the end

The overall polling behavior and deduplication logic look consistent with the intended “new files since last run” semantics.

components/google_drive/sources/new-spreadsheet-polling/test-event.mjs (1)

1-111: Spreadsheet test fixture is well‑formed

The exported spreadsheet payload includes the expected fields (id, name, mimeType, parents, timestamps, permissions, capabilities, exportLinks) and matches what the polling source will emit as a sample. No issues found.

components/google_drive/sources/new-spreadsheet-polling/new-spreadsheet-polling.mjs (1)

134-186: Spreadsheet run loop aligns with desired polling behavior

The run() implementation:

  • Streams changes from Drive using listChanges
  • Filters to spreadsheet mime types, fetches full metadata, and skips already‑created spreadsheets based on createdTime vs lastRunTimestamp
  • Applies folder filters via shouldProcess and emits via emitSpreadsheet
  • Updates pageToken per page and lastRunTimestamp at the end

The logic is consistent with the “new spreadsheet since last run” requirement and mirrors the new‑files implementation appropriately.

components/google_drive/sources/new-or-modified-comments-polling/test-event.mjs (1)

1-35: Fixture shape and data look appropriate

The sample payload is a realistic Drive comment (with a single reply), matches the fields this source uses (id, content, modifiedTime, author, replies), and uses safe placeholder identities. No issues from a testing or privacy perspective.

Copy link
Collaborator

@michelle0927 michelle0927 left a comment

Choose a reason for hiding this comment

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

LGTM! Ready for QA!

@vunguyenhung
Copy link
Collaborator

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.

[ACTION] Google Drive - Polling-based components as an alternative to webhook-based ones

4 participants