-
Notifications
You must be signed in to change notification settings - Fork 5.6k
GrowSurf - new components #19361
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?
GrowSurf - new components #19361
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds a GrowSurf integration: a request layer with pagination, a polling-source base class, and three polling sources (campaign-completed, new-participant-added, new-campaign-referral-made). Also bumps package version and adds a platform dependency. Changes
Sequence Diagram(s)sequenceDiagram
participant Timer
participant Source as Polling Source
participant Base as Base Class (base.mjs)
participant App as GrowSurf App (growsurf.app.mjs)
participant API as GrowSurf API
participant DB as Pipedream DB
Timer->>Source: trigger run()
Source->>Base: run()
Base->>Base: processEvent()
Base->>Source: getResources(max)
Source->>DB: _getLastTs()
DB-->>Source: lastTs
Source->>App: paginate(fn=listParticipants/listReferrals, args={campaignId,...}, resourceKey, max)
loop pages
App->>API: GET /... (with nextId)
API-->>App: items batch + nextId
App-->>Source: yield item
Source->>Source: if item.createdAt > lastTs -> collect
Source->>DB: _setLastTs(newMaxTs)
end
Source-->>Base: return filtered items
Base->>Source: generateMeta(item)
Source-->>Base: {id, summary, ts}
Base->>Base: emit(item, {meta})
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. 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: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
components/growsurf/growsurf.app.mjs(1 hunks)components/growsurf/package.json(2 hunks)components/growsurf/sources/campaign-completed/campaign-completed.mjs(1 hunks)components/growsurf/sources/common/base.mjs(1 hunks)components/growsurf/sources/new-campaign-referral-made/new-campaign-referral-made.mjs(1 hunks)components/growsurf/sources/new-participant-added/new-participant-added.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
Applied to files:
components/growsurf/package.json
📚 Learning: 2024-07-24T02:06:47.016Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Applied to files:
components/growsurf/sources/new-campaign-referral-made/new-campaign-referral-made.mjscomponents/growsurf/sources/new-participant-added/new-participant-added.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
Applied to files:
components/growsurf/growsurf.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.
Applied to files:
components/growsurf/growsurf.app.mjs
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Applied to files:
components/growsurf/sources/new-participant-added/new-participant-added.mjs
🧬 Code graph analysis (2)
components/growsurf/sources/new-campaign-referral-made/new-campaign-referral-made.mjs (2)
components/growsurf/sources/common/base.mjs (1)
results(31-31)components/growsurf/sources/new-participant-added/new-participant-added.mjs (4)
results(23-32)lastTs(34-34)maxTs(35-35)ts(37-37)
components/growsurf/growsurf.app.mjs (2)
components/elastic_email/actions/update-campaign/update-campaign.mjs (1)
campaign(105-108)components/zep/actions/get-threads/get-threads.mjs (1)
max(39-39)
⏰ 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: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (8)
components/growsurf/package.json (1)
3-16: LGTM!Version bump to 0.1.0 is appropriate for introducing new features, and the
@pipedream/platformdependency is correctly added to support the new API integration layer.components/growsurf/growsurf.app.mjs (2)
20-56: LGTM!The request helper and API methods are well-structured with proper authentication and consistent patterns.
57-78: LGTM!The pagination helper correctly implements cursor-based pagination with the
nextIdparameter and supports limiting results via themaxparameter.components/growsurf/sources/new-campaign-referral-made/new-campaign-referral-made.mjs (2)
50-56: LGTM!The
generateMetamethod provides a clear summary with appropriate fallback from email to ID.
36-47: > Likely an incorrect or invalid review comment.components/growsurf/sources/campaign-completed/campaign-completed.mjs (1)
17-23: LGTM!Using
Date.now()for the timestamp is appropriate here since we're detecting campaign completion status rather than a creation event.components/growsurf/sources/common/base.mjs (1)
30-48: LGTM!The
processEventmethod correctly iterates over resources and emits events with generated metadata. Thedeployhook sensibly limits initial fetch to 10 items.components/growsurf/sources/new-participant-added/new-participant-added.mjs (1)
33-47: Critical: Data loss whenmaxtruncates results.The
maxTsis updated based on all collected participants (line 43), but the array is truncated afterward (lines 44-46). If there are more participants thanmax, the skipped participants will never be emitted becauselastTsadvances past them.Apply this diff to only track
maxTsfor participants that will actually be returned:const participants = []; const lastTs = this._getLastTs(); let maxTs = lastTs; for await (const participant of results) { const ts = participant.createdAt; if (ts > lastTs) { participants.push(participant); - maxTs = Math.max(ts, maxTs); + if (!max || participants.length <= max) { + maxTs = Math.max(ts, maxTs); + } } } this._setLastTs(maxTs); if (max && participants.length > max) { participants.length = max; } return participants;Alternatively, compute
maxTsfrom the final truncated array before persisting.⛔ Skipped due to learnings
Learnt from: GTFalcao Repo: PipedreamHQ/pipedream PR: 14265 File: components/the_magic_drip/sources/common.mjs:35-43 Timestamp: 2024-10-10T19:18:27.998Z Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
components/growsurf/sources/new-participant-added/new-participant-added.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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
components/growsurf/growsurf.app.mjs(1 hunks)components/growsurf/sources/common/base.mjs(1 hunks)components/growsurf/sources/new-participant-added/new-participant-added.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Applied to files:
components/growsurf/sources/new-participant-added/new-participant-added.mjs
📚 Learning: 2024-07-24T02:06:47.016Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Applied to files:
components/growsurf/sources/new-participant-added/new-participant-added.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
Applied to files:
components/growsurf/growsurf.app.mjs
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.
Applied to files:
components/growsurf/growsurf.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.
Applied to files:
components/growsurf/growsurf.app.mjs
🧬 Code graph analysis (3)
components/growsurf/sources/new-participant-added/new-participant-added.mjs (2)
components/growsurf/sources/common/base.mjs (1)
results(31-31)components/growsurf/sources/new-campaign-referral-made/new-campaign-referral-made.mjs (4)
results(23-34)lastTs(36-36)maxTs(37-37)ts(39-39)
components/growsurf/sources/common/base.mjs (3)
components/growsurf/sources/new-participant-added/new-participant-added.mjs (2)
lastTs(34-34)results(23-32)components/growsurf/sources/new-campaign-referral-made/new-campaign-referral-made.mjs (2)
lastTs(36-36)results(23-34)components/zep/actions/get-threads/get-threads.mjs (1)
max(39-39)
components/growsurf/growsurf.app.mjs (1)
components/zep/actions/get-threads/get-threads.mjs (1)
max(39-39)
⏰ 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: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
🔇 Additional comments (4)
components/growsurf/sources/common/base.mjs (1)
1-49: LGTM! Base class follows standard abstract pattern.The polling source base class is well-structured with:
- Proper abstract method enforcement via ConfigurationError
- Clean state management for timestamp tracking
- Standard deploy/run lifecycle hooks
The previous concern about
getResourceFnvsgetResourceshas been addressed.components/growsurf/growsurf.app.mjs (2)
6-56: LGTM! API integration methods are well-structured.The request wrapper, authentication header, and API endpoint methods follow standard patterns. The campaignId prop definition with async options provides a good user experience.
57-78: Paginate logic looks correct for cursor-based pagination.The async generator properly:
- Yields items incrementally
- Respects the max limit
- Handles cursor-based pagination via nextId
Minor note: Line 60 mutates
args.params, which is intentional for maintaining pagination state but could theoretically cause issues if args is reused externally. Given this is an internal helper, it's acceptable.components/growsurf/sources/new-participant-added/new-participant-added.mjs (1)
49-59: LGTM! Name handling properly addresses missing fields.The
generateMetaimplementation correctly handles cases wherefirstNameorlastNamemight be undefined by usingfilter(Boolean)and providing fallbacks toid. This prevents "undefined" from appearing in summaries.
components/growsurf/sources/new-participant-added/new-participant-added.mjs
Show resolved
Hide resolved
lcaresia
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.
LGTM!
For Integration QA: |
Resolves #13339
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.