-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[Components] Hep Scout - Added new triggers #16444
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis update introduces three new instant event source components for the Help Scout integration, each corresponding to a specific conversation thread event: customer reply, agent reply, and note creation. Each source module is implemented with event type filtering and summary generation logic, accompanied by a respective test event file for simulation and validation. Additionally, a new method to generate event metadata was added to the common base module to simplify event emission. The package version in the Help Scout component's Changes
Sequence Diagram(s)sequenceDiagram
participant HelpScoutWebhook as Help Scout Webhook
participant PipedreamSource as Pipedream Event Source
participant UserWorkflow as User Workflow
HelpScoutWebhook->>PipedreamSource: Send event (e.g. convo.customer.reply.created)
PipedreamSource->>PipedreamSource: Filter event type
PipedreamSource->>PipedreamSource: Generate event metadata (id, summary, timestamp)
PipedreamSource->>UserWorkflow: Emit event with summary and payload
Assessment against linked issues
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/help_scout/sources/new-agent-reply-instant/new-agent-reply-instant.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/help_scout/sources/common/base.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/help_scout/sources/new-agent-reply-instant/test-event.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (11)
🚧 Files skipped from review as they are similar to previous changes (11)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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 @jcortes, LGTM! Ready for QA!
cbfbd6a
to
f11602a
Compare
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 (2)
components/help_scout/sources/common/base.mjs (2)
35-42
: Good abstraction of metadata creation logic.The new
getMetadata
method nicely encapsulates the event metadata creation, providing consistent structure across all extending components. This refactoring improves maintainability and ensures consistent event structure for all Help Scout webhooks.Consider using
Date.now()
instead ofDate.parse(new Date())
for a more direct and efficient timestamp generation.getMetadata(body) { - const ts = Date.parse(new Date()); + const ts = Date.now(); return { id: `${body.id}-${ts}`, summary: this.getSummary(body), ts: ts, }; },
39-39
: Consider adding a fallback for getSummary method.The
getMetadata
method callsthis.getSummary(body)
, but there's no implementation or fallback in this base class. While child components likely implement this method, adding a default implementation or validation would improve robustness.getMetadata(body) { const ts = Date.parse(new Date()); return { id: `${body.id}-${ts}`, - summary: this.getSummary(body), + summary: typeof this.getSummary === 'function' ? this.getSummary(body) : `Help Scout event ${body.id}`, ts: ts, }; },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
components/help_scout/package.json
(1 hunks)components/help_scout/sources/common/base.mjs
(2 hunks)components/help_scout/sources/new-agent-reply-instant/new-agent-reply-instant.mjs
(1 hunks)components/help_scout/sources/new-agent-reply-instant/test-event.mjs
(1 hunks)components/help_scout/sources/new-conversation-assigned-instant/new-conversation-assigned-instant.mjs
(1 hunks)components/help_scout/sources/new-conversation-created-instant/new-conversation-created-instant.mjs
(1 hunks)components/help_scout/sources/new-customer-instant/new-customer-instant.mjs
(1 hunks)components/help_scout/sources/new-customer-reply-instant/new-customer-reply-instant.mjs
(1 hunks)components/help_scout/sources/new-customer-reply-instant/test-event.mjs
(1 hunks)components/help_scout/sources/new-note-created-instant/new-note-created-instant.mjs
(1 hunks)components/help_scout/sources/new-note-created-instant/test-event.mjs
(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- components/help_scout/sources/new-conversation-created-instant/new-conversation-created-instant.mjs
- components/help_scout/sources/new-customer-instant/new-customer-instant.mjs
- components/help_scout/package.json
- components/help_scout/sources/new-conversation-assigned-instant/new-conversation-assigned-instant.mjs
🚧 Files skipped from review as they are similar to previous changes (6)
- components/help_scout/sources/new-note-created-instant/new-note-created-instant.mjs
- components/help_scout/sources/new-note-created-instant/test-event.mjs
- components/help_scout/sources/new-agent-reply-instant/test-event.mjs
- components/help_scout/sources/new-customer-reply-instant/test-event.mjs
- components/help_scout/sources/new-customer-reply-instant/new-customer-reply-instant.mjs
- components/help_scout/sources/new-agent-reply-instant/new-agent-reply-instant.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (1)
components/help_scout/sources/common/base.mjs (1)
81-81
: LGTM: Simplified event emission.Great refactoring to use the new
getMetadata
method for event emission, which simplifies the code and ensures consistent metadata structure.
b6ab84b
to
02ce224
Compare
/approve |
02ce224
to
2b2251d
Compare
2b2251d
to
54d62dc
Compare
/approve |
WHY
Resolves #16372
Summary by CodeRabbit