-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Elastic Email - new components #18943
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
|
WalkthroughAdds multiple new Elastic Email actions and a delivery-event source, extends the app with new propDefinitions and API methods, adds an email format validator, and bumps several action/source versions and the component package version. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Action as Action Module
participant App as elastic_email.app
participant API as Elastic Email API
User->>Action: Trigger action (create/update/list or source)
Action->>Action: Validate inputs (e.g., email formats), build payload
Action->>App: Call app method (createX/updateX/listX/getX)
App->>API: HTTP request
API-->>App: Response
App-->>Action: Return data
Action->>Action: $.export(summary)
Action-->>User: Return response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (3 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: 1
🧹 Nitpick comments (2)
components/elastic_email/actions/create-contact/create-contact.mjs (1)
17-21: Consider adding email validation.Adding a basic email validation pattern could improve UX by catching format errors before the API call.
Apply this diff to add email validation:
email: { type: "string", label: "Email", description: "The email of the contact", + pattern: /^[^\s@]+@[^\s@]+\.[^\s@]+$/, },components/elastic_email/elastic_email.app.mjs (1)
143-246: Consider URL encoding for path parameters.Methods like
updateContactandupdateCampaigninterpolate contact emails and campaign names directly into URL paths. If these contain special characters (e.g.,+in emails), the request may fail.Apply this pattern to encode path parameters:
updateContact({ contact, ...opts }) { return this._makeRequest({ method: "PUT", - path: `/contacts/${contact}`, + path: `/contacts/${encodeURIComponent(contact)}`, ...opts, }); },Similar encoding should be applied to
getCampaignandupdateCampaign.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (13)
components/elastic_email/actions/add-contact/add-contact.mjs(1 hunks)components/elastic_email/actions/create-campaign/create-campaign.mjs(1 hunks)components/elastic_email/actions/create-contact/create-contact.mjs(1 hunks)components/elastic_email/actions/create-segment/create-segment.mjs(1 hunks)components/elastic_email/actions/list-campaigns/list-campaigns.mjs(1 hunks)components/elastic_email/actions/list-contacts/list-contacts.mjs(1 hunks)components/elastic_email/actions/send-email/send-email.mjs(1 hunks)components/elastic_email/actions/unsubscribe-contact/unsubscribe-contact.mjs(1 hunks)components/elastic_email/actions/update-campaign/update-campaign.mjs(1 hunks)components/elastic_email/actions/update-contact/update-contact.mjs(1 hunks)components/elastic_email/elastic_email.app.mjs(5 hunks)components/elastic_email/package.json(2 hunks)components/elastic_email/sources/new-delivery-event/new-delivery-event.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📚 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/elastic_email/package.json
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.
Applied to files:
components/elastic_email/actions/send-email/send-email.mjscomponents/elastic_email/actions/unsubscribe-contact/unsubscribe-contact.mjscomponents/elastic_email/sources/new-delivery-event/new-delivery-event.mjs
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Applied to files:
components/elastic_email/actions/update-campaign/update-campaign.mjscomponents/elastic_email/actions/list-campaigns/list-campaigns.mjscomponents/elastic_email/actions/create-contact/create-contact.mjscomponents/elastic_email/actions/create-segment/create-segment.mjscomponents/elastic_email/actions/create-campaign/create-campaign.mjs
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Applied to files:
components/elastic_email/actions/list-campaigns/list-campaigns.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/elastic_email/sources/new-delivery-event/new-delivery-event.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
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/elastic_email/sources/new-delivery-event/new-delivery-event.mjs
🧬 Code graph analysis (8)
components/elastic_email/actions/update-campaign/update-campaign.mjs (1)
components/elastic_email/actions/create-campaign/create-campaign.mjs (1)
response(91-115)
components/elastic_email/actions/update-contact/update-contact.mjs (2)
components/elastic_email/actions/create-contact/create-contact.mjs (1)
response(48-59)components/elastic_email/actions/add-contact/add-contact.mjs (1)
response(81-100)
components/elastic_email/actions/list-campaigns/list-campaigns.mjs (1)
components/elastic_email/actions/list-contacts/list-contacts.mjs (1)
response(32-38)
components/elastic_email/actions/create-contact/create-contact.mjs (2)
components/elastic_email/actions/update-contact/update-contact.mjs (1)
response(43-51)components/elastic_email/actions/add-contact/add-contact.mjs (1)
response(81-100)
components/elastic_email/actions/list-contacts/list-contacts.mjs (1)
components/elastic_email/actions/list-campaigns/list-campaigns.mjs (1)
response(38-45)
components/elastic_email/actions/create-segment/create-segment.mjs (2)
components/elastic_email/actions/create-campaign/create-campaign.mjs (1)
response(91-115)components/elastic_email/actions/create-contact/create-contact.mjs (1)
response(48-59)
components/elastic_email/actions/create-campaign/create-campaign.mjs (1)
components/elastic_email/actions/update-campaign/update-campaign.mjs (1)
response(101-130)
components/elastic_email/elastic_email.app.mjs (1)
components/elastic_email/actions/update-campaign/update-campaign.mjs (1)
campaign(96-99)
⏰ 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: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
🔇 Additional comments (22)
components/elastic_email/actions/unsubscribe-contact/unsubscribe-contact.mjs (1)
8-8: LGTM! Version bump aligns with the coordinated updates.The version increment is consistent with other actions being updated in this PR.
components/elastic_email/actions/add-contact/add-contact.mjs (1)
13-13: LGTM! Version bump aligns with the coordinated updates.The version increment is consistent with other actions being updated in this PR.
components/elastic_email/actions/send-email/send-email.mjs (1)
12-12: LGTM! Version bump aligns with the coordinated updates.The version increment is consistent with other actions being updated in this PR.
components/elastic_email/actions/create-campaign/create-campaign.mjs (2)
87-89: Good validation!The check ensures at least one recipient source is provided before proceeding, preventing invalid API calls.
91-117: LGTM! Campaign creation logic is well-structured.The payload construction properly handles both required and optional fields, with conditional
ExcludeRecipientsonly when exclusions are specified.components/elastic_email/actions/create-segment/create-segment.mjs (1)
27-37: LGTM! Clean and straightforward implementation.The segment creation logic is simple and effective, with helpful documentation for building segment rules.
components/elastic_email/actions/update-campaign/update-campaign.mjs (1)
96-99: Good pattern: fetching existing campaign first.Retrieving the current campaign state allows proper merging of updates with existing values.
components/elastic_email/package.json (1)
3-3: LGTM! Version bumps align with the feature expansion.The package version bump to 0.2.0 and the platform dependency update to ^3.1.0 are appropriate for this feature addition. The npm registry confirms that @pipedream/platform@3.1.0 exists and the minor version bump is a safe, non-breaking change.
components/elastic_email/sources/new-delivery-event/new-delivery-event.mjs (1)
1-44: Fix missing parameter ingetSummary()methodThe base class calls
this.getSummary(item)with the event item as a parameter, but the implementation has no parameters. Update the signature:getSummary(item) { return "New delivery event"; }Alternatively, if the summary should reflect event-specific details, use the
itemparameter to provide more context (e.g.,item.EventType).⛔ Skipped due to learnings
Learnt from: GTFalcao Repo: PipedreamHQ/pipedream PR: 12697 File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71 Timestamp: 2024-10-08T15:33:38.240Z 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.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.Learnt from: js07 Repo: PipedreamHQ/pipedream PR: 18744 File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64 Timestamp: 2025-10-20T01:01:02.970Z Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.components/elastic_email/actions/update-contact/update-contact.mjs (3)
1-14: LGTM!The metadata and imports are correctly structured. The
destructiveHint: trueannotation is appropriate since this action modifies existing data.
15-41: LGTM!The props are well-structured with appropriate optional fields for a partial update operation.
42-54: The PUT /contacts/{email} endpoint expects a JSON object (ContactUpdatePayload), which is exactly what the code provides. The different data structures betweencreate-contact,add-contact, andupdate-contactreflect the appropriate formats for their respective API endpoints—not an inconsistency.components/elastic_email/actions/list-contacts/list-contacts.mjs (3)
1-13: LGTM!The metadata and annotations are correctly configured for a read-only list operation.
14-30: LGTM!Standard pagination props with sensible defaults.
31-41: LGTM!The summary message format is correct and uses optional chaining to safely handle the response.
components/elastic_email/actions/create-contact/create-contact.mjs (2)
1-14: LGTM!The metadata is correctly configured and the action name properly matches its purpose.
47-62: LGTM!The data structure correctly wraps the contact object in an array, consistent with the
add-contactaction pattern.components/elastic_email/actions/list-campaigns/list-campaigns.mjs (2)
1-36: LGTM!The action metadata and props are correctly structured with appropriate read-only annotations and pagination support.
37-48: LGTM!The run method is correctly implemented with proper summary formatting and safe response handling.
components/elastic_email/elastic_email.app.mjs (3)
32-32: LGTM!Good cleanup removing the trailing period for consistency.
50-123: LGTM!The new prop definitions follow consistent patterns with proper pagination, optional chaining, and appropriate fallback values.
134-142: LGTM!Good refactor to use template literals for URL construction.
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: 0
🧹 Nitpick comments (1)
components/elastic_email/sources/new-email-click/new-email-click.mjs (1)
25-27: Consider consistent summary text format.The summary text "New event click" differs in capitalization and phrasing from the similar source
new-email-openwhich uses "New Email opened". Consider standardizing the format across all event sources for consistency, e.g., "New Email Click" or "New email click".
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
components/elastic_email/sources/new-contact-added/new-contact-added.mjs(1 hunks)components/elastic_email/sources/new-email-click/new-email-click.mjs(1 hunks)components/elastic_email/sources/new-email-open/new-email-open.mjs(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- components/elastic_email/sources/new-contact-added/new-contact-added.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). (3)
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (2)
components/elastic_email/sources/new-email-click/new-email-click.mjs (1)
9-9: Version bump looks good.The version increment from "0.0.1" to "0.0.2" is appropriate and consistent with the other source/action updates in this PR.
components/elastic_email/sources/new-email-open/new-email-open.mjs (1)
9-9: Version bump looks good.The version increment from "0.0.1" to "0.0.2" aligns with the PR's objective to extend Elastic Email component functionality.
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.
Hi @michelle0927 lgtm! Ready for QA!
For Integration QA:
|
For Integration QA: |
|
Hello everyone, I have tested this PR and there're some test cases failed or needed improvement. Please check test reports below for more information:
|
1 similar comment
|
Hello everyone, I have tested this PR and there're some test cases failed or needed improvement. Please check test reports below for more information:
|
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: 3
♻️ Duplicate comments (1)
components/elastic_email/actions/update-campaign/update-campaign.mjs (1)
128-135: Add null safety when reading existing exclusionsAccessing
campaign.ExcludeRecipients.ListNamesand.SegmentNamesthrows whenever the existing campaign has no exclusions (the common case). Please use optional chaining or guard the object before dereferencing. This was flagged previously and is still unresolved.ExcludeRecipients: this.excludeRecipientListNames || this.excludeRecipientSegmentNames ? { ListNames: this.excludeRecipientListNames - || campaign.ExcludeRecipients.ListNames + || campaign.ExcludeRecipients?.ListNames || undefined, SegmentNames: this.excludeRecipientSegmentNames - || campaign.ExcludeRecipients.SegmentNames + || campaign.ExcludeRecipients?.SegmentNames || undefined, } : undefined,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
components/elastic_email/actions/create-campaign/create-campaign.mjs(1 hunks)components/elastic_email/actions/send-email/send-email.mjs(4 hunks)components/elastic_email/actions/update-campaign/update-campaign.mjs(1 hunks)components/elastic_email/common/utils.mjs(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Applied to files:
components/elastic_email/actions/create-campaign/create-campaign.mjs
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.
Applied to files:
components/elastic_email/actions/send-email/send-email.mjs
🧬 Code graph analysis (3)
components/elastic_email/actions/create-campaign/create-campaign.mjs (3)
components/elastic_email/common/utils.mjs (1)
isValidEmailFormat(26-29)components/elastic_email/actions/send-email/send-email.mjs (1)
response(118-146)components/elastic_email/actions/update-campaign/update-campaign.mjs (1)
response(110-139)
components/elastic_email/actions/send-email/send-email.mjs (1)
components/elastic_email/common/utils.mjs (1)
isValidEmailFormat(26-29)
components/elastic_email/actions/update-campaign/update-campaign.mjs (2)
components/elastic_email/common/utils.mjs (1)
isValidEmailFormat(26-29)components/elastic_email/actions/create-campaign/create-campaign.mjs (1)
response(99-123)
⏰ 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: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (1)
components/elastic_email/actions/send-email/send-email.mjs (1)
111-116: Nice proactive input validationValidating the
FromandReply Tofields up front withConfigurationErrors keeps bad payloads from ever reaching Elastic Email. Good defensive addition.
|
Hi everyone, all test cases are passed! Ready for release! Test reports
|
Resolves #18856
Summary by CodeRabbit
New Features
Chores