Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Dec 17, 2025

Resolves ##19497

Summary by CodeRabbit

  • New Features
    • New actions for searching/retrieving contact and company signals, signal options, recommendations, and single-item searches with enhanced filters.
    • App-level support for signals, companySignals, and startDate options and new signal-related API operations.
  • Chores
    • Multiple action version bumps and package version update to 0.3.0.
    • Added read-only hints to search-and-enrich actions.

✏️ Tip: You can customize this high-level summary in your review settings.

- Added new actions: Get Company Recommendations, Get Contact Recommendations, Get Company Signals By IDs, Get Contact Signals By IDs, Search Company Signals, and Search Contact Signals.
- Introduced new properties for signal retrieval, including startDate and various signal types.
- Updated existing actions to improve functionality and added new methods for single company and contact searches.
- Bumped package version to 0.3.0 and updated action versions accordingly.
@vercel
Copy link

vercel bot commented Dec 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Dec 18, 2025 7:33pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Walkthrough

Adds multiple new Lusha action modules (signals, searches, recommendations), new constants and app API wrappers to support them, bumps package and several action versions, and adds readOnlyHint annotations to two existing actions.

Changes

Cohort / File(s) Summary
Version bumps for existing actions
components/lusha/actions/company-enrich/company-enrich.mjs, components/lusha/actions/company-search/company-search.mjs, components/lusha/actions/contact-enrich/contact-enrich.mjs, components/lusha/actions/contact-search/contact-search.mjs
Incremented exported action version fields (company-enrich 0.0.5→0.0.6; company-search, contact-enrich, contact-search 0.0.4→0.0.5). No logic changes.
Annotations & import reorder
components/lusha/actions/search-and-enrich-companies/search-and-enrich-companies.mjs, components/lusha/actions/search-and-enrich-contacts/search-and-enrich-contacts.mjs
Added annotations.readOnlyHint: true, bumped versions 0.0.3→0.0.4, and reordered imports; runtime logic unchanged.
New signal retrieval actions
components/lusha/actions/get-company-signals/get-company-signals.mjs, components/lusha/actions/get-contact-signals/get-contact-signals.mjs, components/lusha/actions/get-signal-options/get-signal-options.mjs
New actions to fetch company/contact signals and to list available signal options; define props (lusha, signals/companySignals, startDate, ids) and run() implementations that call corresponding lusha app methods and export summaries.
New signal search actions
components/lusha/actions/search-company-signals/search-company-signals.mjs, components/lusha/actions/search-contact-signals/search-contact-signals.mjs
New actions combining search with signal enrichment; accept identifier lists, signals filter, optional startDate, call new app endpoints, return responses and export summaries.
New single-entity search actions
components/lusha/actions/single-company-search/single-company-search.mjs, components/lusha/actions/single-contact-search/single-contact-search.mjs
New actions to search a single company or contact; validate required inputs, call new app methods (searchSingleCompany / searchSingleContact), export summary, and return API results.
New recommendation actions
components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs, components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs
New actions exposing getCompanyRecommendations and getContactRecommendations; accept identifiers, exclude lists, limit, optional requestId; call app methods and handle errors via ConfigurationError.
Core app additions
components/lusha/lusha.app.mjs
Added prop definitions (signals, companySignals, startDate) and eight new API wrapper methods: searchSingleContact, searchSingleCompany, getContactSignalsById, searchContactSignals, searchCompanySignals, getContactRecommendations, getCompanyRecommendations, getSignalOptions.
Constants
components/lusha/common/constants.mjs
Added exported constants SIGNALS_OPTIONS, COMPANY_SIGNALS_OPTIONS, and FILTER_BY_OPTIONS as arrays of { label, value } pairs.
Package version
components/lusha/package.json
Bumped package version 0.2.1 → 0.3.0.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Review additions in components/lusha/lusha.app.mjs: verify endpoint paths, parameter mapping, and error handling for each new wrapper.
  • Inspect components/lusha/common/constants.mjs to ensure signal option values and labels match API specs and are used consistently by new actions.
  • Audit each new action file (components/lusha/actions/**) for prop schemas (required vs optional), parsing of identifier lists, summary export correctness, and consistent ConfigurationError usage.
  • Spot-check version bumps and annotation additions for correctness and consistency.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only contains 'Resolves ##19497' but the template requires a 'WHY' section. The description lacks meaningful context about the changes, rationale, and objectives. Add a 'WHY' section explaining the motivation behind adding these new actions and properties, and provide context about the changes being made to the Lusha component.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Enhance Lusha component with new actions and properties' accurately reflects the main changes: 7 new action files, 3 new constants, app method additions, and property enhancements across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 19497-action-add-new-actions-and-replace-deprecated-search-companycontact

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 12

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e27319f and 72a1733.

📒 Files selected for processing (17)
  • components/lusha/actions/company-enrich/company-enrich.mjs (1 hunks)
  • components/lusha/actions/company-search/company-search.mjs (1 hunks)
  • components/lusha/actions/contact-enrich/contact-enrich.mjs (1 hunks)
  • components/lusha/actions/contact-search/contact-search.mjs (1 hunks)
  • components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs (1 hunks)
  • components/lusha/actions/get-company-signals/get-company-signals.mjs (1 hunks)
  • components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs (1 hunks)
  • components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1 hunks)
  • components/lusha/actions/get-signal-options/get-signal-options.mjs (1 hunks)
  • components/lusha/actions/search-and-enrich-companies/search-and-enrich-companies.mjs (1 hunks)
  • components/lusha/actions/search-and-enrich-contacts/search-and-enrich-contacts.mjs (1 hunks)
  • components/lusha/actions/search-company-signals/search-company-signals.mjs (1 hunks)
  • components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1 hunks)
  • components/lusha/actions/single-company-search/single-company-search.mjs (1 hunks)
  • components/lusha/actions/single-contact-search/single-contact-search.mjs (1 hunks)
  • components/lusha/lusha.app.mjs (4 hunks)
  • components/lusha/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.

Applied to files:

  • components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/lusha/lusha.app.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.

Applied to files:

  • components/lusha/lusha.app.mjs
🧬 Code graph analysis (6)
components/lusha/actions/get-signal-options/get-signal-options.mjs (13)
components/lusha/actions/company-enrich/company-enrich.mjs (1)
  • response (32-38)
components/lusha/actions/company-search/company-search.mjs (1)
  • response (123-132)
components/lusha/actions/contact-enrich/contact-enrich.mjs (1)
  • response (32-38)
components/lusha/actions/contact-search/contact-search.mjs (1)
  • response (87-98)
components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs (1)
  • response (45-53)
components/lusha/actions/get-company-signals/get-company-signals.mjs (1)
  • response (46-53)
components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs (1)
  • response (45-53)
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)
  • response (48-55)
components/lusha/actions/search-company-signals/search-company-signals.mjs (1)
  • response (54-61)
components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1)
  • response (46-53)
components/lusha/actions/single-company-search/single-company-search.mjs (1)
  • response (34-40)
components/lusha/actions/single-contact-search/single-contact-search.mjs (1)
  • response (90-104)
components/lusha/lusha.app.mjs (1)
  • response (371-374)
components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs (2)
components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs (1)
  • response (45-53)
components/lusha/lusha.app.mjs (1)
  • response (371-374)
components/lusha/actions/get-company-signals/get-company-signals.mjs (5)
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)
  • response (48-55)
components/lusha/actions/get-signal-options/get-signal-options.mjs (1)
  • response (29-32)
components/lusha/actions/search-company-signals/search-company-signals.mjs (1)
  • response (54-61)
components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1)
  • response (46-53)
components/lusha/lusha.app.mjs (1)
  • response (371-374)
components/lusha/actions/search-contact-signals/search-contact-signals.mjs (5)
components/lusha/actions/contact-search/contact-search.mjs (1)
  • response (87-98)
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)
  • response (48-55)
components/lusha/actions/search-company-signals/search-company-signals.mjs (1)
  • response (54-61)
components/lusha/actions/single-contact-search/single-contact-search.mjs (1)
  • response (90-104)
components/lusha/lusha.app.mjs (1)
  • response (371-374)
components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs (3)
components/lusha/actions/contact-search/contact-search.mjs (1)
  • response (87-98)
components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs (1)
  • response (45-53)
components/lusha/lusha.app.mjs (1)
  • response (371-374)
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (2)
components/lusha/actions/get-company-signals/get-company-signals.mjs (1)
  • response (46-53)
components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1)
  • response (46-53)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (13)
components/lusha/actions/search-and-enrich-companies/search-and-enrich-companies.mjs (3)

1-2: LGTM: Import reordering.

The reorganized import order (utilities before app modules) improves code organization without affecting functionality.


8-8: LGTM: Version bump.

The patch version increment appropriately reflects the annotation and organizational updates in this action.


9-13: The readOnlyHint: true annotation is accurate—the enrichCompanies API call retrieves enriched company data without modifying records in Lusha's system.

components/lusha/package.json (1)

3-3: LGTM!

The version bump from 0.2.1 to 0.3.0 appropriately reflects the addition of new actions and features in this PR.

components/lusha/actions/company-search/company-search.mjs (1)

8-8: LGTM!

Version bump is appropriate.

components/lusha/actions/contact-enrich/contact-enrich.mjs (1)

7-7: LGTM!

Version bump is appropriate.

components/lusha/actions/contact-search/contact-search.mjs (1)

8-8: LGTM!

Version bump is appropriate.

components/lusha/actions/search-and-enrich-contacts/search-and-enrich-contacts.mjs (1)

8-12: LGTM!

The version bump and addition of readOnlyHint: true are appropriate for this search-and-enrich action.

components/lusha/actions/company-enrich/company-enrich.mjs (1)

7-7: LGTM!

Version bump is appropriate.

components/lusha/actions/get-signal-options/get-signal-options.mjs (1)

27-35: LGTM!

The action implementation is clean and straightforward, with appropriate annotations and a clear summary message.

components/lusha/actions/get-company-signals/get-company-signals.mjs (1)

1-61: LGTM!

The action is well-structured, follows Pipedream conventions, and implements proper error handling. The use of propDefinitions for reusability is appropriate.

components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)

1-63: LGTM!

The action follows the established pattern, uses proper error handling, and integrates well with the Lusha app's extended API surface.

components/lusha/lusha.app.mjs (1)

228-358: LGTM!

The new API methods follow the established pattern and integrate cleanly with the existing _makeRequest infrastructure. The destructuring of objectType in getSignalOptions is handled correctly.

- Introduced SIGNALS_OPTIONS and COMPANY_SIGNALS_OPTIONS constants to standardize signal types and enhance component functionality.
- Each constant includes labels and values for various signal categories, improving clarity and usability for users interacting with the Lusha component.
…onent

- Introduced two new actions: Get Company Recommendations and Get Contact Recommendations.
- Each action allows users to retrieve recommendations based on provided company or contact IDs, with options to exclude certain entries and limit results.
- Enhanced error handling for API responses to improve user experience.
- Updated documentation links for better guidance on usage.
- Revised the description for the companySignals property to clarify that it pertains to types of company signals to retrieve, enhancing user understanding.
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: 2

♻️ Duplicate comments (1)
components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs (1)

57-59: Improve error handling to avoid potential undefined access.

The catch block destructures response from the error object, but if the error doesn't have a response property (e.g., network errors, timeouts), this could lead to throwing a ConfigurationError with an undefined message.

Apply this diff to provide a fallback error message:

-    } catch ({ response }) {
-      throw new ConfigurationError(response?.data?.message);
+    } catch (error) {
+      throw new ConfigurationError(error?.response?.data?.message || error.message);
     }
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f6f234 and ca66762.

📒 Files selected for processing (3)
  • components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs (1 hunks)
  • components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs (1 hunks)
  • components/lusha/lusha.app.mjs (4 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.

Applied to files:

  • components/lusha/lusha.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/lusha/lusha.app.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.

Applied to files:

  • components/lusha/lusha.app.mjs
🧬 Code graph analysis (2)
components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs (1)
components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs (1)
  • response (45-53)
components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs (1)
components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs (1)
  • response (45-53)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (2)
components/lusha/lusha.app.mjs (2)

228-350: LGTM - New API methods follow established patterns.

The new API methods (searchSingleContact, searchSingleCompany, getContactSignalsById, searchContactSignals, searchCompanySignals, getContactRecommendations, getCompanyRecommendations) are well-structured and follow the established pattern of wrapping _makeRequest with appropriate HTTP methods and paths.


203-208: Confirm if client-side validation is needed for startDate format.

The startDate prop currently lacks client-side format validation. It's passed directly to the API without checking the YYYY-MM-DD format specified in the description. Verify whether the Lusha API returns clear, user-friendly error messages for invalid date formats, or if client-side validation should be added to catch format issues before the API call.

Copy link
Collaborator

@lcaresia lcaresia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, have some fixes to do.

- Updated summary messages in get-company-signals, get-contact-signals, search-company-signals, and search-contact-signals actions to include the count of retrieved signals.
- Introduced FILTER_BY_OPTIONS constant in single-contact-search for improved filtering options.
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: 1

♻️ Duplicate comments (5)
components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1)

54-54: Enhance the summary with additional response details.

The summary currently only reports the count of contact signals. Consider including additional context such as the signal types requested, date range applied, or other relevant metadata from the response to provide users with more actionable information.

Based on past review comments requesting more info about the response in the summary.

components/lusha/actions/search-company-signals/search-company-signals.mjs (2)

18-33: Combine the two info alerts into a single prop.

Having separate info and info2 props is unconventional and can confuse users. Merge the content into a single alert for better user experience.

🔎 Apply this diff to combine the alerts:
     info: {
       type: "alert",
       alertType: "info",
       content: `Each company must have at least one identifier:\
         \n* Company ID\
         \n* Domain Name\
-        \n* Company Domain
+        \n* Company Domain\
+        \n\n* Use \`startDate\` to customize the timeframe\
+        \n* Companies are matched based on provided identifiers
       `,
     },
-    info2: {
-      type: "alert",
-      alertType: "info",
-      content: `* Use \`startDate\` to customize the timeframe\
-        \n* Companies are matched based on provided identifiers
-      `,
-    },

Based on past review comments.


62-62: Enhance the summary with additional response details.

The summary currently only reports the count of company signals. Consider including additional context such as the signal types requested, date range applied, or other relevant metadata from the response to provide users with more actionable information.

Based on past review comments requesting more info about the response in the summary.

components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)

56-56: Enhance the summary with additional response details.

The summary currently only reports the count of contact signals. Consider including additional context such as the signal types requested, date range applied, or other relevant metadata from the response to provide users with more actionable information.

Based on past review comments requesting more info about the response in the summary.

components/lusha/actions/single-contact-search/single-contact-search.mjs (1)

98-102: Throw ConfigurationError directly for consistency.

Throwing a generic Error that gets caught and re-wrapped as ConfigurationError is convoluted. Throw ConfigurationError directly to match the pattern used in other actions and simplify the error handling flow.

🔎 Apply this diff to throw ConfigurationError directly:
       if (response.contact?.error?.name) {
 
         if (response.contact.error.name !== "EMPTY_DATA") {
-          throw new Error(response.contact.error.message || response.contact.error.name);
+          throw new ConfigurationError(response.contact.error.message || response.contact.error.name);
         }
         summary = "No contact found";
       }

Based on past review comments.

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca66762 and 7fe2e9d.

📒 Files selected for processing (6)
  • components/lusha/actions/get-company-signals/get-company-signals.mjs (1 hunks)
  • components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1 hunks)
  • components/lusha/actions/search-company-signals/search-company-signals.mjs (1 hunks)
  • components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1 hunks)
  • components/lusha/actions/single-contact-search/single-contact-search.mjs (1 hunks)
  • components/lusha/common/constants.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-09-15T22:01:17.593Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/README.md:45-49
Timestamp: 2025-09-15T22:01:17.593Z
Learning: In Leonardo AI components (and likely other Pipedream components), prefer using info alert props on the component itself rather than detailed "Key Features" sections in README files for action documentation.

Applied to files:

  • components/lusha/actions/search-company-signals/search-company-signals.mjs
📚 Learning: 2025-01-23T03:55:51.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 15376
File: components/monday/sources/column-value-updated/column-value-updated.mjs:17-24
Timestamp: 2025-01-23T03:55:51.998Z
Learning: Alert props in Pipedream components are a special case that do not require a label property, and use the 'content' property as a replacement for description.

Applied to files:

  • components/lusha/actions/search-company-signals/search-company-signals.mjs
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.

Applied to files:

  • components/lusha/actions/search-company-signals/search-company-signals.mjs
  • components/lusha/actions/get-company-signals/get-company-signals.mjs
  • components/lusha/actions/search-contact-signals/search-contact-signals.mjs
  • components/lusha/actions/get-contact-signals/get-contact-signals.mjs
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Applied to files:

  • components/lusha/actions/search-contact-signals/search-contact-signals.mjs
🧬 Code graph analysis (3)
components/lusha/actions/search-company-signals/search-company-signals.mjs (5)
components/lusha/actions/get-company-signals/get-company-signals.mjs (1)
  • response (46-53)
components/lusha/actions/search-contact-signals/search-contact-signals.mjs (1)
  • response (46-53)
components/lusha/actions/company-search/company-search.mjs (1)
  • response (123-132)
components/lusha/lusha.app.mjs (1)
  • response (371-374)
components/lusha/actions/single-company-search/single-company-search.mjs (1)
  • response (34-40)
components/lusha/actions/get-company-signals/get-company-signals.mjs (2)
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (1)
  • response (48-55)
components/lusha/actions/get-signal-options/get-signal-options.mjs (1)
  • response (29-32)
components/lusha/actions/get-contact-signals/get-contact-signals.mjs (4)
components/lusha/actions/get-company-signals/get-company-signals.mjs (1)
  • response (46-53)
components/lusha/actions/contact-enrich/contact-enrich.mjs (1)
  • response (32-38)
components/lusha/actions/get-signal-options/get-signal-options.mjs (1)
  • response (29-32)
components/lusha/lusha.app.mjs (1)
  • response (371-374)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (2)
components/lusha/common/constants.mjs (1)

1-44: LGTM!

The constants are well-structured and follow the standard pattern for option definitions. The values use consistent camelCase naming and labels are clear and user-friendly.

components/lusha/actions/get-company-signals/get-company-signals.mjs (1)

57-59: LGTM: Error handling is appropriate.

The error handling correctly uses optional chaining to safely access the error message and throws a ConfigurationError with the API's response message, which is consistent with similar actions in this PR.

startDate: this.startDate,
},
});
$.export("$summary", `Successfully retrieved ${Object.keys(response.companies).length} company signals`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add defensive check and enhance summary message.

The code accesses response.companies without verifying it exists, which could cause a runtime error if the API returns an unexpected structure. Additionally, a past review comment suggests adding more information about the response in the summary.

🔎 Apply this diff to add a defensive check and enhance the summary:
-      $.export("$summary", `Successfully retrieved ${Object.keys(response.companies).length} company signals`);
+      const companyCount = response?.companies ? Object.keys(response.companies).length : 0;
+      $.export("$summary", `Successfully retrieved signals for ${companyCount} ${companyCount === 1 ? 'company' : 'companies'}`);

Based on learnings, ensure the summary message is correctly formatted and informative. As per past review comments, add more info about the response in the summary.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$.export("$summary", `Successfully retrieved ${Object.keys(response.companies).length} company signals`);
const companyCount = response?.companies ? Object.keys(response.companies).length : 0;
$.export("$summary", `Successfully retrieved signals for ${companyCount} ${companyCount === 1 ? 'company' : 'companies'}`);
🤖 Prompt for AI Agents
In components/lusha/actions/get-company-signals/get-company-signals.mjs around
line 54, the code assumes response.companies exists and builds the summary
directly from it; add a defensive guard to compute companiesCount safely (e.g.,
const companies = response && response.companies ? response.companies : {};
const count = Object.keys(companies).length) and then update the summary to
include that count plus a small, safe bit of response context (for example
response.status or response.meta or a short JSON.stringify of a limited response
field) so the message becomes informative but not verbose; ensure you handle
missing fields gracefully and avoid dumping the entire response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ACTION] Add New Actions and Replace Deprecated Search Company/Contact

3 participants