Skip to content

Conversation

@GTFalcao
Copy link
Collaborator

@GTFalcao GTFalcao commented Nov 17, 2025

Adding 'New Worksheet' polling equivalent source, and adjusting on the newly shipped Google Drive source

Summary by CodeRabbit

  • New Features

    • New polling source: emit an event when a new worksheet is created in Google Sheets; supports selecting target spreadsheet.
  • Improvements

    • Google Drive file and folder selectors updated to a UI-driven selector with improved folder/file selection behavior.
    • Component package versions bumped to publish these updates.
  • Tests

    • Added a static test event payload to validate new worksheet polling.

@vercel
Copy link

vercel bot commented Nov 17, 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 17, 2025 8:39pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 17, 2025 8:39pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Walkthrough

Package versions updated for Google Drive and Google Sheets components. Google Drive source properties refactored to use propDefinition-driven selectors instead of runtime options. New Google Sheets source module added for polling newly created worksheets with timer-based triggering.

Changes

Cohort / File(s) Summary
Google Drive version update
components/google_drive/package.json
Version bumped from 1.3.0 to 1.3.1.
Google Drive source refactoring
components/google_drive/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs
Source version bumped 0.0.10.0.2. Replaced runtime options(...) providers for files and folders with propDefinition entries: files uses [ googleDrive, "fileId", ({ drive }) => ({ drive }) ]; folders uses [ googleDrive, "folderId", ({ drive }) => ({ drive, baseOpts: { q: ... } }) ]. Updated files description text; folders baseOpts enforces non-trashed folder mime-type query.
Google Sheets version update
components/google_sheets/package.json
Version bumped from 0.11.0 to 0.12.0.
Google Sheets new worksheet polling source
components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs, components/google_sheets/sources/new-worksheet-polling/test-event.mjs
Added new polling source google_sheets-new-worksheet-polling (version 0.0.1) with timer prop, watchedDrive, sheetID (driveId resolution), composed methods from base/common, run() calling processSpreadsheet({ spreadsheetId: this.sheetID }). Added test-event.mjs static worksheet fixture.

Sequence Diagram(s)

sequenceDiagram
    participant Timer
    participant Source as NewWorksheetPolling
    participant Sheets as GoogleSheetsAPI
    participant DB as StateDB

    Timer->>Source: interval trigger
    Source->>Source: run()
    Source->>Sheets: processSpreadsheet(spreadsheetId = sheetID)
    Sheets->>Sheets: list worksheets / detect new sheet
    Sheets->>DB: check/update dedupe state
    alt New worksheet detected
        Sheets->>Source: emit event (worksheet payload)
        Source->>DB: persist state
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Attention points:
    • Verify propDefinition argument shapes and baseOpts.q query in the Google Drive source.
    • Confirm Google Sheets source composes base.methods and common.methods correctly and that processSpreadsheet call uses the resolved sheetID.
    • Validate test-event.mjs payload fields (sheetId, title, index, sheetType, gridProperties) match expected consumer shape.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is minimal and lacks detail. While it mentions the main objectives, it does not follow the template structure with a 'WHY' section explaining the rationale. Consider adding a 'WHY' section explaining the motivation for these changes and how they improve the user experience or system functionality.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: adding a new Google Sheets polling source and improving the Google Drive source with propDefinitions.
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-followup

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de28550 and 067c9b9.

📒 Files selected for processing (1)
  • components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs (1 hunks)
⏰ 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: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (8)
components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs (8)

7-14: LGTM: Source metadata is well-defined.

The key, name, description, version, dedupe strategy, and type are all correctly configured for a polling source that detects new worksheets.


15-17: LGTM: Hooks correctly composed from common.


19-20: LGTM: Standard app and database props.


21-26: LGTM: Timer configuration correctly uses default.

The timer prop now correctly uses default instead of static, allowing users to adjust the polling interval.


27-32: LGTM: watchedDrive prop correctly configured.


43-46: Methods composition pattern is correct.

The composition pattern spreading base.methods and common.methods follows standard conventions. However, ensure the base import issue at line 3 is resolved so the correct polling methods are available.


47-51: LGTM: Run function correctly implements polling logic.

The run() function appropriately calls processSpreadsheet with the configured spreadsheet ID, following standard polling source patterns.


52-52: LGTM: Sample emit correctly referenced.


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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ba3f2b and 11103f8.

📒 Files selected for processing (5)
  • components/google_drive/package.json (1 hunks)
  • components/google_drive/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs (2 hunks)
  • components/google_sheets/package.json (1 hunks)
  • components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs (1 hunks)
  • components/google_sheets/sources/new-worksheet-polling/test-event.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-01T17:07:48.193Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: For "dir" props in Pipedream components, whether to mark them as optional depends on the action's file I/O behavior - if an action always writes files as output, the "dir" prop should not be marked as optional.

Applied to files:

  • components/google_drive/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs
⏰ 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: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (7)
components/google_drive/package.json (1)

3-3: LGTM! Version bump is appropriate.

The patch version increment (1.3.0 → 1.3.1) aligns with the refactoring changes in the Google Drive polling source.

components/google_sheets/package.json (1)

3-3: LGTM! Version bump is appropriate.

The minor version increment (0.11.0 → 0.12.0) correctly reflects the addition of the new worksheet polling source.

components/google_drive/sources/new-or-modified-files-polling/new-or-modified-files-polling.mjs (3)

11-11: LGTM! Version bump is appropriate.

The patch version increment reflects the refactoring to propDefinition-based configuration.


32-44: Verified: fileId propDefinition properly handles drive context.

The fileId propDefinition in components/google_drive/google_drive.app.mjs (lines 86-98) accepts the drive parameter in its async options() method and uses it correctly by passing it to this.listDriveFilesOptions(drive, nextPageToken, baseOpts). The refactored code properly scopes file selection to the specified drive.


46-60: Verification complete: folderId propDefinition correctly handles drive and baseOpts parameters.

The folderId propDefinition in components/google_drive/google_drive.app.mjs (lines 68-84) has an async options method that accepts both drive and baseOpts parameters. The method signature shows baseOpts with a default value, and it's passed to this.listDriveFilesOptions() for processing. The polling source correctly provides a context function that returns both parameters, with a custom query filter mimeType = '${GOOGLE_DRIVE_FOLDER_MIME_TYPE}' and trashed = false', which properly overrides the default options. This integration pattern is consistent with other propDefinitions in the app (fileId, fileOrFolderId).

components/google_sheets/sources/new-worksheet-polling/test-event.mjs (1)

1-12: LGTM! Test event structure is appropriate.

The sample worksheet data includes all expected fields (sheetId, title, index, sheetType, gridProperties) and provides realistic values for testing the new worksheet polling source.

components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs (1)

47-51: LGTM! Run method correctly processes the spreadsheet.

The run method properly calls processSpreadsheet with the configured sheetID, following the expected pattern for polling sources.

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: 1

♻️ Duplicate comments (2)
components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs (2)

21-26: Fix timer configuration property.

The timer prop uses static but should use default based on Pipedream platform conventions. This issue was previously flagged but not yet addressed.

Apply this diff to fix the timer configuration:

     timer: {
       type: "$.interface.timer",
-      static: {
+      default: {
         intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
       },
     },

33-41: Fix incorrect method invocation in propDefinition context.

Line 38 attempts to call googleSheets.methods.getDriveId(c.watchedDrive) at definition time, which will fail. This issue was previously flagged but not yet addressed. The function should return an object with the computed driveId, not call the method directly during prop definition.

Apply this diff:

     sheetID: {
       propDefinition: [
         googleSheets,
         "sheetID",
         (c) => ({
-          driveId: googleSheets.methods.getDriveId(c.watchedDrive),
+          driveId: c.watchedDrive,
         }),
       ],
     },

Note: If the getDriveId transformation is necessary, it should happen in the sheetID propDefinition itself within the app file, not in the source configuration.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11103f8 and de28550.

📒 Files selected for processing (1)
  • components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs (1 hunks)
⏰ 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). (3)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (2)
components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs (2)

43-46: Verify methods compatibility with polling sources.

The methods composition spreads base.methods from the HTTP-based module (line 3), which may contain lifecycle methods or behaviors incompatible with polling sources. This compounds the issue identified with the incorrect base import.

Once the base import is corrected to use a polling-specific module, verify that the methods composition is appropriate for timer-based polling.


47-51: LGTM!

The run method correctly invokes processSpreadsheet with the configured spreadsheet ID. The implementation is appropriate for a polling source, assuming processSpreadsheet is properly defined in the common module.

michelle0927
michelle0927 previously approved these changes Nov 17, 2025
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.

Left one optional comment. Ready for QA!

@michelle0927 michelle0927 moved this from Ready for PR Review to Ready for QA in Component (Source and Action) Backlog Nov 17, 2025
@vunguyenhung
Copy link
Collaborator

…ksheet-polling.mjs

Co-authored-by: michelle0927 <michelle0927@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prioritized Prioritized issue

Projects

Development

Successfully merging this pull request may close these issues.

5 participants