Skip to content
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

Hubspot custom object request updates #15506

Merged
merged 7 commits into from
Feb 20, 2025

Conversation

GTFalcao
Copy link
Collaborator

@GTFalcao GTFalcao commented Feb 6, 2025

Adhering to the breaking change announced by HubSpot

Custom objects are now referenced by their fullyQualifiedName instead of name.

Components affected by this change:

  • Create Associations
  • Create Custom Object
  • Search CRM
  • Update Custom Object
  • New Note Created
  • New Task Created

We also have 'New or Updated Custom Object' and 'New Custom Object Property Change', but those were not modified since they already use the custom object's ID instead of its name.

Summary by CodeRabbit

  • Chores
    • Upgraded the HubSpot integration to version 1.0.0 across all actions and sources.
  • Refactor
    • Refined the display of custom object options to provide clearer labels and more consistent identifiers for an improved user experience.

Copy link
Contributor

coderabbitai bot commented Feb 6, 2025

Walkthrough

This pull request updates version numbers for multiple HubSpot action and source files, with several files incrementing their version to 1.0.0. Additionally, it revises the mapping for custom object identifiers by replacing the use of “name” with “fullyQualifiedName” in specific source files and within property definitions in the hubspot.app. Minor text corrections are also applied to descriptions. No changes have been made to the underlying logic or error handling.

Changes

File(s) Change Summary
components/hubspot/actions/create-associations/create-associations.mjs, create-custom-object/create-custom-object.mjs, search-crm/search-crm.mjs, update-custom-object/update-custom-object.mjs, package.json Version numbers updated to 1.0.0 without any functional changes.
components/hubspot/sources/new-note/new-note.mjs, new-task/new-task.mjs Version bumped to 1.0.0 and mapping updated in getParams to use fullyQualifiedName instead of name for custom object identifiers.
components/hubspot/hubspot.app.mjs Corrected the description for customObjectType and updated its options mapping to return objects with label (name) and value (fullyQualifiedName); adjusted objectType mapping accordingly.
components/hubspot/actions/add-contact-to-list/add-contact-to-list.mjs, batch-create-or-update-contact/batch-create-or-update-contact.mjs, create-communication/create-communication.mjs, create-company/create-company.mjs, create-deal/create-deal.mjs, create-engagement/create-engagement.mjs, create-lead/create-lead.mjs, create-or-update-contact/create-or-update-contact.mjs, create-ticket/create-ticket.mjs, enroll-contact-into-workflow/enroll-contact-into-workflow.mjs, get-company/get-company.mjs, get-contact/get-contact.mjs, get-deal/get-deal.mjs, get-file-public-url/get-file-public-url.mjs, update-company/update-company.mjs, update-contact/update-contact.mjs, update-deal/update-deal.mjs, update-lead/update-lead.mjs, sources/delete-blog-article/delete-blog-article.mjs, new-company-property-change/new-company-property-change.mjs, new-contact-property-change/new-contact-property-change.mjs, new-custom-object-property-change/new-custom-object-property-change.mjs, new-deal-in-stage/new-deal-in-stage.mjs, new-deal-property-change/new-deal-property-change.mjs, new-email-event/new-email-event.mjs, new-email-subscriptions-timeline/new-email-subscriptions-timeline.mjs, new-engagement/new-engagement.mjs, new-event/new-event.mjs, new-form-submission/new-form-submission.mjs, new-or-updated-blog-article/new-or-updated-blog-article.mjs, new-or-updated-company/new-or-updated-company.mjs, new-or-updated-contact/new-or-updated-contact.mjs, new-or-updated-crm-object/new-or-updated-crm-object.mjs, new-or-updated-custom-object/new-or-updated-custom-object.mjs, new-or-updated-deal/new-or-updated-deal.mjs, new-or-updated-line-item/new-or-updated-line-item.mjs, new-or-updated-product/new-or-updated-product.mjs, new-social-media-message/new-social-media-message.mjs, new-ticket-property-change/new-ticket-property-change.mjs, new-ticket/new-ticket.mjs Version numbers incremented across various files, with no functional changes.

Possibly related PRs

  • Hubspot version update #14816: The changes in the main PR involve updating version numbers across various files, which is related to this PR as both involve similar version updates in the package.json and specific module files.
  • Hubspot new task version fix #15216: The changes in the main PR involve updating version numbers across various files, which is related to this PR as both involve similar version updates in the package.json and specific module files.

Suggested labels

User submitted

Suggested reviewers

  • michelle0927

Poem

I'm a rabbit with a hop so light,
Skipping through code from day to night.
Versions have leapt to one point oh-so-new,
With mappings crisp as morning dew.
Carrots and commits make my day bright!
🥕🐇 Happy coding, with delight!

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/hubspot/actions/search-crm/search-crm.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)


📜 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 2feb0e2 and 1e9bb2d.

📒 Files selected for processing (1)
  • components/hubspot/actions/search-crm/search-crm.mjs (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
🔇 Additional comments (7)
components/hubspot/actions/search-crm/search-crm.mjs (7)

19-19: LGTM! Version bump is appropriate.

The major version bump to 1.0.0 correctly reflects the breaking change in HubSpot's API for custom object references.


53-53: LGTM! Async options function ensures fresh data.

The change to an async function ensures that custom object types are fetched with their current fullyQualifiedName values.


74-81: LGTM! Enhanced property display with labels.

The mapping of searchable properties to include both labels and values improves user experience by providing clearer context for each property.


87-87: LGTM! Consistent property display.

The use of mapped searchable properties ensures consistent display of property labels throughout the component.


197-202: LGTM! Implemented HubSpot's breaking change.

The mapping now correctly uses fullyQualifiedName for custom object types, aligning with HubSpot's API changes. The use of plural labels enhances readability.


220-221: LGTM! Improved object type handling.

The introduction of actualObjectType consolidates the handling of object types, making the code more maintainable and consistent.

Also applies to: 223-223, 254-254, 262-262, 267-267


226-231: Verify error handling for custom object properties.

The error message still references objectType instead of actualObjectType, which might be confusing when dealing with custom objects.

Apply this diff to improve the error message:

-        `Property \`${searchProperty}\` is not a searchable property of object type \`${objectType}\`. ` +
+        `Property \`${searchProperty}\` is not a searchable property of object type \`${actualObjectType}\`. ` +
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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

vercel bot commented Feb 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 Feb 18, 2025 6:43pm
pipedream-docs ⬜️ Ignored (Inspect) Feb 18, 2025 6:43pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Feb 18, 2025 6:43pm

lcaresia
lcaresia previously approved these changes Feb 10, 2025
@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check the test report below for more information
https://vunguyenhung.notion.site/Hubspot-custom-object-request-updates-196bf548bb5e8120beaaeda50946c038

@GTFalcao
Copy link
Collaborator Author

This issue seems to already exist in the current live component, when selecting a custom object. Should be fixed now nonetheless.

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check the test report below for more information
https://vunguyenhung.notion.site/Hubspot-custom-object-request-updates-196bf548bb5e8120beaaeda50946c038

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check the test report below for more information
https://vunguyenhung.notion.site/Hubspot-custom-object-request-updates-196bf548bb5e8120beaaeda50946c038

@GTFalcao
Copy link
Collaborator Author

@vunguyenhung I looked into the API response, and out of the 17 properties of this object, only 1 is a "searchable property": pipedream_object which is labeled as "Pipedream TEXT".

I changed the prop to show the property label instead of only the value (in this case, label is "Pipedream TEXT" and value is pipedream_object). This should be more clear to the user.

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test report
https://vunguyenhung.notion.site/Hubspot-custom-object-request-updates-196bf548bb5e8120beaaeda50946c038

@GTFalcao
Copy link
Collaborator Author

/approve

@GTFalcao GTFalcao merged commit b3b76ca into master Feb 20, 2025
11 checks passed
@GTFalcao GTFalcao deleted the hubspot-custom-object-request-updates branch February 20, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants