-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Hubspot - Search CRM #15417
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 - Search CRM #15417
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis pull request introduces modifications to the Hubspot Search CRM action, specifically enhancing error handling in the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
✅ Files skipped from review due to trivial changes (10)
⏰ Context from checks skipped due to timeout of 90000ms (3)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
components/hubspot/actions/search-crm/search-crm.mjs (2)
207-209
: Optimize by reusing the schema from additionalProps.The schema is already fetched in
additionalProps()
. Consider storing it in a class property to avoid redundant API calls.- const schema = await this.hubspot.getSchema({ - objectType, - }); + if (!this._schema) { + this._schema = await this.hubspot.getSchema({ + objectType, + }); + } + const schema = this._schema;
211-213
: Enhance error message with available properties.Consider including the list of available searchable properties in the error message to help users correct their configuration.
- throw new ConfigurationError(`\`${searchProperty}\` is not a searchable property of object type \`${objectType}\``); + throw new ConfigurationError( + `\`${searchProperty}\` is not a searchable property of object type \`${objectType}\`. ` + + `Available searchable properties are: ${schema.searchableProperties.join(", ")}` + );
📜 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 (2)
components/hubspot/actions/search-crm/search-crm.mjs
(2 hunks)components/hubspot/package.json
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- components/hubspot/package.json
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (3)
components/hubspot/actions/search-crm/search-crm.mjs (3)
13-13
: LGTM! Good error handling practice.The addition of
ConfigurationError
import is appropriate for handling invalid configuration scenarios.
19-19
: LGTM! Appropriate version bump.The version increment from 0.0.11 to 0.0.12 follows semantic versioning and is appropriate for the added validation enhancement.
211-213
: LGTM! Good validation practice.The validation ensures that only searchable properties are used, preventing runtime errors.
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/hubspot/actions/search-crm/search-crm.mjs (2)
207-216
: Add error handling for schema retrieval.While the validation logic is good, the schema retrieval should include error handling in case the API call fails.
- const schema = await this.hubspot.getSchema({ - objectType, - }); + let schema; + try { + schema = await this.hubspot.getSchema({ + objectType, + }); + } catch (error) { + throw new ConfigurationError( + `Failed to retrieve schema for object type \`${objectType}\`: ${error.message}` + ); + }
207-209
: Consider caching the schema to avoid duplicate API calls.The schema is fetched twice - once in
additionalProps()
and once inrun()
. Consider storing the schema result fromadditionalProps()
in a class property to avoid the duplicate API call.async additionalProps() { // ... existing code ... try { schema = await this.hubspot.getSchema({ objectType, }); + this._cachedSchema = schema; // ... existing code ... } } async run({ $ }) { // ... existing code ... - const schema = await this.hubspot.getSchema({ - objectType, - }); + const schema = this._cachedSchema || await this.hubspot.getSchema({ + objectType, + }); // ... existing code ... }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/hubspot/actions/search-crm/search-crm.mjs
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (2)
components/hubspot/actions/search-crm/search-crm.mjs (2)
13-13
: LGTM! Import of ConfigurationError is well-placed.The addition of ConfigurationError import aligns with the new validation logic and follows Pipedream's best practices.
19-19
: LGTM! Version bump is appropriate.The increment from 0.0.11 to 0.0.12 correctly reflects the addition of new validation functionality without breaking changes.
/approve |
/approve |
Resolves #15403
Summary by CodeRabbit