-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Google Sheets new source + drive improvement #19111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughPackage 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
⏰ 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)
🔇 Additional comments (8)
Comment |
There was a problem hiding this 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
📒 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
fileIdpropDefinition incomponents/google_drive/google_drive.app.mjs(lines 86-98) accepts thedriveparameter in itsasync options()method and uses it correctly by passing it tothis.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
folderIdpropDefinition incomponents/google_drive/google_drive.app.mjs(lines 68-84) has anasync optionsmethod that accepts bothdriveandbaseOptsparameters. The method signature showsbaseOptswith a default value, and it's passed tothis.listDriveFilesOptions()for processing. The polling source correctly provides a context function that returns both parameters, with a custom query filtermimeType = '${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
processSpreadsheetwith the configured sheetID, following the expected pattern for polling sources.
components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs
Show resolved
Hide resolved
components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs
Show resolved
Hide resolved
There was a problem hiding this 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
staticbut should usedefaultbased 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
getDriveIdtransformation is necessary, it should happen in thesheetIDpropDefinition itself within the app file, not in the source configuration.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 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.methodsfrom 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
processSpreadsheetwith the configured spreadsheet ID. The implementation is appropriate for a polling source, assumingprocessSpreadsheetis properly defined in the common module.
components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs
Show resolved
Hide resolved
michelle0927
left a comment
There was a problem hiding this 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!
components/google_sheets/sources/new-worksheet-polling/new-worksheet-polling.mjs
Outdated
Show resolved
Hide resolved
For Integration QA: |
…ksheet-polling.mjs Co-authored-by: michelle0927 <michelle0927@users.noreply.github.com>
Adding 'New Worksheet' polling equivalent source, and adjusting on the newly shipped Google Drive source
Summary by CodeRabbit
New Features
Improvements
Tests