Skip to content

[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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcortes
Copy link
Collaborator

@jcortes jcortes commented Apr 24, 2025

WHY

Resolves #16372

Summary by CodeRabbit

  • New Features
    • Added instant event sources for Help Scout: "New Agent Reply", "New Customer Reply", and "New Note Created". These emit events when an agent replies, a customer replies, or a note is added to a conversation.
  • Tests
    • Introduced test event data for each new Help Scout event source to support testing and validation.
  • Chores
    • Updated the Help Scout package version.

@jcortes jcortes self-assigned this Apr 24, 2025
Copy link

vercel bot commented Apr 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Apr 24, 2025 9:13pm
pipedream-docs ⬜️ Ignored (Inspect) Apr 24, 2025 9:13pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Apr 24, 2025 9:13pm

Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

Walkthrough

This 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, the package version in the Help Scout component's package.json is incremented to reflect these changes. No modifications were made to other exported or public entities.

Changes

File(s) Change Summary
components/help_scout/package.json Incremented package version from 0.1.0 to 0.1.1.
components/help_scout/sources/new-agent-reply-instant/new-agent-reply-instant.mjs
.../test-event.mjs
Added new "New Agent Reply (Instant)" event source and its test event data for Help Scout.
components/help_scout/sources/new-customer-reply-instant/new-customer-reply-instant.mjs
.../test-event.mjs
Added new "New Customer Reply (Instant)" event source and its test event data for Help Scout.
components/help_scout/sources/new-note-created-instant/new-note-created-instant.mjs
.../test-event.mjs
Added new "New Note Created (Instant)" event source and its test event data for Help Scout.

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->>UserWorkflow: Emit event with summary and payload
Loading

Assessment against linked issues

Objective Addressed Explanation
Add triggers for Help Scout conversation thread events: customer reply, agent reply, note created (#16372)

Suggested labels

User submitted

Poem

Three new triggers hop into view,
For Help Scout threads—fresh and new!
Replies from agents, customers too,
And notes that quietly peek through.
With version bumped and tests in tow,
This rabbit cheers, “Let’s ship and go!”
🐇✨

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/help_scout/sources/new-agent-reply-instant/new-agent-reply-instant.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

components/help_scout/sources/new-agent-reply-instant/test-event.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

components/help_scout/sources/new-customer-reply-instant/new-customer-reply-instant.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

  • 3 others

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 37e4be7 and cbfbd6a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • components/help_scout/package.json (1 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-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)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (9)
components/help_scout/package.json (2)

3-3: Approve version bump to 0.1.1
The package version has been correctly incremented to reflect the addition of new triggers.


1-19:

✅ Verification successful

Verify presence of the "new-customer-reply-instant" source
The PR description and version bump indicate three new triggers (agent reply, customer reply, note creation), but I don't see a new-customer-reply-instant component or its test-event. Please confirm that the new-customer-reply source and its accompanying test event file have been added.


🏁 Script executed:

#!/usr/bin/env bash
# Verify that the new-customer-reply-instant directory exists
fd 'new-customer-reply-instant' -t d components/help_scout/sources

Length of output: 124


🏁 Script executed:

#!/usr/bin/env bash
# List all files in the new-customer-reply-instant directory to verify the presence of a test-event file
fd -t f components/help_scout/sources/new-customer-reply-instant

Length of output: 596


🏁 Script executed:

#!/usr/bin/env bash
# Correctly list all files in the new-customer-reply-instant directory
fd . components/help_scout/sources/new-customer-reply-instant

Length of output: 223


Verified presence of new-customer-reply-instant source and test-event
Confirmed that both components/help_scout/sources/new-customer-reply-instant/new-customer-reply-instant.mjs and its accompanying test-event.mjs are present.

components/help_scout/sources/new-agent-reply-instant/test-event.mjs (1)

1-55: Approve test-event structure
The test-event object accurately models a Help Scout agent reply event, with comprehensive metadata and thread details. This will facilitate reliable testing of the New Agent Reply (Instant) source.

components/help_scout/sources/new-note-created-instant/test-event.mjs (1)

1-55: Approve test-event structure
The test-event correctly represents a new note creation scenario with nested thread data and all necessary fields for the New Note Created (Instant) source.

components/help_scout/sources/new-note-created-instant/new-note-created-instant.mjs (1)

1-22: Approve New Note Created (Instant) component
The component correctly extends the common base, defines metadata, filters on "convo.note.created", and generates a summary using body.subject. Implementation aligns with established patterns in the package.

components/help_scout/sources/new-agent-reply-instant/new-agent-reply-instant.mjs (1)

1-26: Approve New Agent Reply (Instant) component
This source properly extends the base, filters on "convo.agent.reply.created", and constructs a clear summary including the agent's name. The fallback to "Agent" is a sensible default for missing assignee data.

components/help_scout/sources/new-customer-reply-instant/test-event.mjs (1)

1-55: Well-structured test event for Help Scout customer reply scenarios.

The test event provides comprehensive data that accurately represents a Help Scout customer reply, including all necessary fields such as conversation metadata, participant details, and thread content. The future-dated timestamps (2025) ensure the test data won't become stale soon.

components/help_scout/sources/new-customer-reply-instant/new-customer-reply-instant.mjs (2)

1-22: Clean implementation of the customer reply trigger.

The component follows Pipedream's best practices by extending the common base and properly defining the event type filter. The getSummary method nicely formats the event with both the customer email and conversation subject for clear identification.


18-20: Good use of optional chaining for null safety.

The use of the optional chaining operator (?.) in body.primaryCustomer?.email provides protection against potential null reference errors if the primaryCustomer object is missing.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Collaborator

@luancazarine luancazarine left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants