Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Hubspot New Notes and New Tasks #15209

Merged
merged 3 commits into from
Jan 7, 2025
Merged

Hubspot New Notes and New Tasks #15209

merged 3 commits into from
Jan 7, 2025

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jan 6, 2025

Resolves #15161

Summary by CodeRabbit

Based on the comprehensive summary, here are the release notes:

Release Notes for HubSpot Integration v0.13.0

New Features

  • Added two new methods to HubSpot integration:
    • listNotes(): Retrieve a list of notes from HubSpot
    • listTasks(): Fetch tasks from HubSpot

New Sources

  • Introduced new event sources:
    • New Note events
    • New Task events

Version Updates

  • Multiple components and sources have been updated with minor version increments
  • Package version bumped from 0.12.1 to 0.13.0

Minor Improvements

  • Updated async handling in common source methods
  • Various internal optimizations across components

Copy link

vercel bot commented Jan 6, 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) Visit Preview Jan 6, 2025 11:29pm
pipedream-docs ⬜️ Ignored (Inspect) Jan 6, 2025 11:29pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jan 6, 2025 11:29pm

Copy link
Contributor

coderabbitai bot commented Jan 6, 2025

Walkthrough

This pull request introduces two new source modules for HubSpot: new-note.mjs and new-task.mjs, which enable tracking of newly created notes and tasks. Additionally, the PR updates version numbers across multiple HubSpot components and the package version. The changes primarily focus on expanding event source capabilities for HubSpot engagement types, specifically notes and tasks, while maintaining the existing codebase structure.

Changes

File Change Summary
components/hubspot/sources/new-note/new-note.mjs New source module for tracking new HubSpot notes
components/hubspot/sources/new-task/new-task.mjs New source module for tracking new HubSpot tasks
components/hubspot/hubspot.app.mjs Added listNotes and listTasks methods
components/hubspot/sources/common/common.mjs Updated run method to use async getParams
Multiple action and source files Version number increments
components/hubspot/package.json Package version updated from 0.12.1 to 0.13.0

Assessment against linked issues

Objective Addressed Explanation
Create New Note trigger
Create New Task trigger
Optional "Created After" prop Implemented via createdAfter parameter
Return all properties and associations getParams() method retrieves comprehensive properties
Use highest permitted page limit Limit set to maximize data retrieval

Possibly related PRs

Suggested reviewers

  • jcortes
  • GTFalcao

Poem

🐰 Hop, hop, hooray! New triggers are here to play,
Notes and tasks, now tracked with glee,
HubSpot's data flows, wild and free!
A rabbit's code, precise and bright,
Bringing integration's pure delight! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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. (Beta)
  • @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
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (3)
components/hubspot/sources/new-note/new-note.mjs (1)

21-23: Consider adding more metadata fields

The metadata could be enriched with additional useful fields from the note properties, such as the associated contact/company name if available.

 return {
   id: note.id,
   summary: `New Note: ${note.properties.hs_body_preview || note.id}`,
+  timestamp: note.createdAt,
+  associatedWith: note.associations || [],
   ts: this.getTs(note),
 };
components/hubspot/sources/new-task/new-task.mjs (2)

51-54: Add retry mechanism for API calls

The processResults method makes API calls but doesn't handle retries. Consider adding retry logic for resilience.

 async processResults(after, params) {
+  const maxRetries = 3;
+  let retries = 0;
+  while (retries < maxRetries) {
+    try {
       const tasks = await this.getPaginatedItems(this.hubspot.listTasks.bind(this), params);
       await this.processEvents(tasks, after);
+      break;
+    } catch (error) {
+      retries++;
+      if (retries === maxRetries) throw error;
+      await new Promise(resolve => setTimeout(resolve, 1000 * retries));
+    }
+  }
 }

11-11: Version number suggestion

Since this is part of a larger HubSpot components update (as indicated in the summary), consider aligning the version with the overall component version update to "0.13.0" instead of starting at "0.0.1".

-  version: "0.0.1",
+  version: "0.13.0",
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between af6dda5 and 8b4a26d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (49)
  • components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs (1 hunks)
  • components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs (1 hunks)
  • components/hubspot/actions/create-associations/create-associations.mjs (1 hunks)
  • components/hubspot/actions/create-communication/create-communication.mjs (1 hunks)
  • components/hubspot/actions/create-company/create-company.mjs (1 hunks)
  • components/hubspot/actions/create-custom-object/create-custom-object.mjs (1 hunks)
  • components/hubspot/actions/create-deal/create-deal.mjs (1 hunks)
  • components/hubspot/actions/create-engagement/create-engagement.mjs (1 hunks)
  • components/hubspot/actions/create-lead/create-lead.mjs (1 hunks)
  • components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs (1 hunks)
  • components/hubspot/actions/create-ticket/create-ticket.mjs (1 hunks)
  • components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs (1 hunks)
  • components/hubspot/actions/get-company/get-company.mjs (1 hunks)
  • components/hubspot/actions/get-contact/get-contact.mjs (1 hunks)
  • components/hubspot/actions/get-deal/get-deal.mjs (1 hunks)
  • components/hubspot/actions/get-file-public-url/get-file-public-url.mjs (1 hunks)
  • components/hubspot/actions/search-crm/search-crm.mjs (1 hunks)
  • components/hubspot/actions/update-company/update-company.mjs (1 hunks)
  • components/hubspot/actions/update-contact/update-contact.mjs (1 hunks)
  • components/hubspot/actions/update-custom-object/update-custom-object.mjs (1 hunks)
  • components/hubspot/actions/update-deal/update-deal.mjs (1 hunks)
  • components/hubspot/actions/update-lead/update-lead.mjs (1 hunks)
  • components/hubspot/hubspot.app.mjs (1 hunks)
  • components/hubspot/package.json (1 hunks)
  • components/hubspot/sources/common/common.mjs (1 hunks)
  • components/hubspot/sources/delete-blog-article/delete-blog-article.mjs (1 hunks)
  • components/hubspot/sources/new-company-property-change/new-company-property-change.mjs (1 hunks)
  • components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs (1 hunks)
  • components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs (1 hunks)
  • components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs (1 hunks)
  • components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs (1 hunks)
  • components/hubspot/sources/new-email-event/new-email-event.mjs (1 hunks)
  • components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs (1 hunks)
  • components/hubspot/sources/new-engagement/new-engagement.mjs (1 hunks)
  • components/hubspot/sources/new-event/new-event.mjs (1 hunks)
  • components/hubspot/sources/new-form-submission/new-form-submission.mjs (1 hunks)
  • components/hubspot/sources/new-note/new-note.mjs (1 hunks)
  • components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs (1 hunks)
  • components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs (1 hunks)
  • components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs (1 hunks)
  • components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs (1 hunks)
  • components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs (1 hunks)
  • components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs (1 hunks)
  • components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs (1 hunks)
  • components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs (1 hunks)
  • components/hubspot/sources/new-social-media-message/new-social-media-message.mjs (1 hunks)
  • components/hubspot/sources/new-task/new-task.mjs (1 hunks)
  • components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs (1 hunks)
  • components/hubspot/sources/new-ticket/new-ticket.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (45)
  • components/hubspot/actions/create-associations/create-associations.mjs
  • components/hubspot/actions/create-custom-object/create-custom-object.mjs
  • components/hubspot/actions/create-ticket/create-ticket.mjs
  • components/hubspot/sources/new-ticket/new-ticket.mjs
  • components/hubspot/sources/new-or-updated-contact/new-or-updated-contact.mjs
  • components/hubspot/package.json
  • components/hubspot/actions/create-or-update-contact/create-or-update-contact.mjs
  • components/hubspot/sources/new-or-updated-line-item/new-or-updated-line-item.mjs
  • components/hubspot/sources/new-or-updated-deal/new-or-updated-deal.mjs
  • components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs
  • components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs
  • components/hubspot/actions/update-company/update-company.mjs
  • components/hubspot/sources/new-form-submission/new-form-submission.mjs
  • components/hubspot/sources/new-or-updated-product/new-or-updated-product.mjs
  • components/hubspot/sources/new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs
  • components/hubspot/actions/create-engagement/create-engagement.mjs
  • components/hubspot/actions/get-contact/get-contact.mjs
  • components/hubspot/actions/update-contact/update-contact.mjs
  • components/hubspot/actions/update-lead/update-lead.mjs
  • components/hubspot/actions/create-deal/create-deal.mjs
  • components/hubspot/actions/get-deal/get-deal.mjs
  • components/hubspot/sources/new-email-event/new-email-event.mjs
  • components/hubspot/actions/get-company/get-company.mjs
  • components/hubspot/sources/new-or-updated-custom-object/new-or-updated-custom-object.mjs
  • components/hubspot/sources/delete-blog-article/delete-blog-article.mjs
  • components/hubspot/actions/create-communication/create-communication.mjs
  • components/hubspot/sources/new-event/new-event.mjs
  • components/hubspot/sources/new-deal-property-change/new-deal-property-change.mjs
  • components/hubspot/sources/new-ticket-property-change/new-ticket-property-change.mjs
  • components/hubspot/sources/new-or-updated-blog-article/new-or-updated-blog-article.mjs
  • components/hubspot/actions/enroll-contact-into-workflow/enroll-contact-into-workflow.mjs
  • components/hubspot/sources/new-company-property-change/new-company-property-change.mjs
  • components/hubspot/sources/new-social-media-message/new-social-media-message.mjs
  • components/hubspot/actions/create-lead/create-lead.mjs
  • components/hubspot/actions/create-company/create-company.mjs
  • components/hubspot/sources/new-deal-in-stage/new-deal-in-stage.mjs
  • components/hubspot/sources/new-custom-object-property-change/new-custom-object-property-change.mjs
  • components/hubspot/actions/update-custom-object/update-custom-object.mjs
  • components/hubspot/actions/get-file-public-url/get-file-public-url.mjs
  • components/hubspot/actions/update-deal/update-deal.mjs
  • components/hubspot/sources/new-engagement/new-engagement.mjs
  • components/hubspot/actions/search-crm/search-crm.mjs
  • components/hubspot/actions/batch-create-or-update-contact/batch-create-or-update-contact.mjs
  • components/hubspot/sources/new-or-updated-company/new-or-updated-company.mjs
  • components/hubspot/sources/new-or-updated-crm-object/new-or-updated-crm-object.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (1)
components/hubspot/hubspot.app.mjs (1)

1011-1024: LGTM! Well-structured implementation of new HubSpot CRM methods.

The new listNotes and listTasks methods are well-implemented, following the established patterns in the codebase. They correctly utilize the CRMV3 API endpoints and maintain consistency with other similar methods.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TRIGGER] Hubspot New Notes and New Tasks
2 participants