Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Jun 19, 2025

Resolves #17171

Summary by CodeRabbit

  • New Features

    • Added a new "Lead Updated (Instant)" source to trigger workflows when a lead is updated in Pipedrive.
  • Enhancements

    • Renamed sources for improved clarity: "New Deal Update (Instant)" to "Deal Updated (Instant)" and "Updated Person (Instant)" to "Person Updated (Instant)".
    • Added asynchronous data parsing to improve event data handling.
    • Extended app API to fetch custom fields for deals and persons.
  • Version Updates

    • Incremented version numbers for multiple actions and sources to reflect recent updates.
  • Chores

    • Updated package and dependency versions for improved compatibility.
    • Added a test event for the new "Lead Updated (Instant)" source.

@vercel
Copy link

vercel bot commented Jun 19, 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 Jun 24, 2025 8:47pm
pipedream-docs ⬜️ Ignored (Inspect) Jun 24, 2025 8:47pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jun 24, 2025 8:47pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 19, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

"""

Walkthrough

This update introduces a new "Lead Updated (Instant)" source trigger for Pipedrive, including its implementation and a sample test event. Additionally, several existing actions and sources have their version numbers incremented, some import statements are reordered, and helper methods for parsing custom fields were added. The package version was also incremented.

Changes

File(s) Change Summary
components/pipedrive/actions/add-activity/add-activity.mjs
components/pipedrive/actions/add-deal/add-deal.mjs
components/pipedrive/actions/add-organization/add-organization.mjs
components/pipedrive/actions/add-person/add-person.mjs
components/pipedrive/actions/search-persons/search-persons.mjs
Incremented version numbers in exported default objects.
components/pipedrive/actions/add-lead/add-lead.mjs
components/pipedrive/actions/remove-duplicate-notes/remove-duplicate-notes.mjs
Incremented version numbers and reordered import statements.
components/pipedrive/actions/add-note/add-note.mjs
components/pipedrive/actions/update-deal/update-deal.mjs
components/pipedrive/actions/update-person/update-person.mjs
Incremented version numbers only.
components/pipedrive/actions/search-notes/search-notes.mjs Incremented version number in exported default object.
components/pipedrive/package.json Updated package version from 0.6.0 to 0.7.0 only.
components/pipedrive/sources/new-deal-instant/new-deal-instant.mjs
components/pipedrive/sources/new-person-instant/new-person-instant.mjs
Incremented version numbers in exported default objects.
components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs
components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs
Renamed name property values and incremented version numbers in exported default objects; added async parseData methods.
components/pipedrive/sources/updated-lead-instant/updated-lead-instant.mjs Added new "Lead Updated (Instant)" source trigger implementation with metadata, methods, and sample event.
components/pipedrive/sources/updated-lead-instant/test-event.mjs Added new test event JSON object for the "Lead Updated (Instant)" source.
components/pipedrive/common/utils.mjs Added async helper functions parseCustomFields and parseData for resolving and normalizing custom fields.
components/pipedrive/pipedrive.app.mjs Added methods getDealCustomFields and getPersonCustomFields to fetch custom fields via API clients.
components/pipedrive/sources/common/base.mjs Added async parseData method and modified run method to await parseData before emitting events.

Sequence Diagram(s)

sequenceDiagram
    participant Pipedrive as Pipedrive
    participant Source as "Lead Updated (Instant) Source"
    participant App as Application

    Pipedrive->>Source: Webhook event (lead updated)
    Source->>Source: getExtraData() returns event info
    Source->>Source: getSummary(event) generates summary
    Source->>App: Emit event with lead update data and summary
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement new trigger action "New Lead Update (Instant)" in Pipedrive (#17171)
Provide sample/test event for the new trigger (#17171)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Version bumps and import reordering in unrelated actions and sources (multiple files) These changes are not related to the objective of implementing the "Lead Updated (Instant)" trigger.
Package version update in components/pipedrive/package.json Not directly related to the new trigger implementation.
Addition of custom field parsing utilities and new app methods for fetching custom fields These enhancements extend functionality beyond the scope of the new lead update trigger.
Modifications in base source to add parseData method and await it before event emission Infrastructure improvement not specifically required by the linked issue.

Suggested reviewers

  • lcaresia

Poem

A lead hops up, updated anew,
The trigger’s set—events come through!
With version bumps and tidy code,
The Pipedrive garden’s in new mode.
🐇✨
Here’s to changes, neat and bright,
May your updates always be right!
"""


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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d223e5f and 234ba4f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • components/pipedrive/actions/add-activity/add-activity.mjs (1 hunks)
  • components/pipedrive/actions/add-deal/add-deal.mjs (1 hunks)
  • components/pipedrive/actions/add-lead/add-lead.mjs (1 hunks)
  • components/pipedrive/actions/add-note/add-note.mjs (1 hunks)
  • components/pipedrive/actions/add-organization/add-organization.mjs (1 hunks)
  • components/pipedrive/actions/add-person/add-person.mjs (1 hunks)
  • components/pipedrive/actions/remove-duplicate-notes/remove-duplicate-notes.mjs (1 hunks)
  • components/pipedrive/actions/search-notes/search-notes.mjs (1 hunks)
  • components/pipedrive/actions/search-persons/search-persons.mjs (1 hunks)
  • components/pipedrive/actions/update-deal/update-deal.mjs (1 hunks)
  • components/pipedrive/actions/update-person/update-person.mjs (1 hunks)
  • components/pipedrive/package.json (2 hunks)
  • components/pipedrive/sources/new-deal-instant/new-deal-instant.mjs (1 hunks)
  • components/pipedrive/sources/new-person-instant/new-person-instant.mjs (1 hunks)
  • components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs (1 hunks)
  • components/pipedrive/sources/updated-lead-instant/test-event.mjs (1 hunks)
  • components/pipedrive/sources/updated-lead-instant/updated-lead-instant.mjs (1 hunks)
  • components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (21)
components/pipedrive/package.json (1)

3-3: Version and dependency updated correctly.

The package version has been bumped to 0.7.0 and the @pipedream/platform dependency updated to ^3.1.0, aligning with the coordinated release across Pipedrive components.

Also applies to: 17-17

components/pipedrive/actions/update-person/update-person.mjs (1)

9-9: Patch version bump for update-person action.

Version updated to 0.0.3, consistent with the minor version increments applied to other Pipedream components in this release.

components/pipedrive/sources/new-deal-instant/new-deal-instant.mjs (1)

9-9: Version bump for new-deal-instant source.

Updated version to 0.0.7, matching the coordinated version updates for instant sources in this PR.

components/pipedrive/actions/update-deal/update-deal.mjs (1)

8-8: Minor version increment for update-deal action.

Version bumped to 0.1.13 to stay in sync with the overall Pipedream component release.

components/pipedrive/actions/add-note/add-note.mjs (1)

8-8: Incremented version for add-note action.

Version updated to 0.0.9, consistent with other Pipedream actions receiving minor version bumps in this release.

components/pipedrive/actions/add-organization/add-organization.mjs (1)

8-8: Consistent version bump
Updated the action version to "0.1.11" to align with the coordinated release across Pipedrive actions.

components/pipedrive/actions/remove-duplicate-notes/remove-duplicate-notes.mjs (2)

2-2: Alphabetize imports
Reordering the imports to have decode before pipedriveApp matches the style used in other components.


8-8: Consistent version bump
Updated the action version to "0.0.2" in line with the bulk version upgrade for Pipedrive actions.

components/pipedrive/actions/add-person/add-person.mjs (1)

9-9: Consistent version bump
Action version updated to "0.1.11" to stay in sync with related modules.

components/pipedrive/actions/add-deal/add-deal.mjs (1)

8-8: Consistent version bump
Updated the action version to "0.1.11" matching the coordinated release update.

components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs (1)

9-9: Consistent version bump
Bumped the source version to "0.0.7" in line with other Pipedrive source components.

components/pipedrive/actions/search-notes/search-notes.mjs (1)

7-7: Consistent version bump
Version updated to "0.0.2", matching the coordinated versioning update across Pipedrive actions.

components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs (1)

9-9: Consistent version bump
Updated version to "0.0.7", aligning with other instant sources in this PR.

components/pipedrive/sources/new-person-instant/new-person-instant.mjs (1)

9-9: Consistent version bump
Incremented version to "0.0.7" to maintain parity across instant sources.

components/pipedrive/actions/search-persons/search-persons.mjs (1)

10-10: Consistent version bump
Version updated to "0.1.11", matching related action components.

components/pipedrive/actions/add-activity/add-activity.mjs (1)

10-10: Consistent version bump
Bumped version to "0.1.11", in line with other Pipedrive action updates.

components/pipedrive/actions/add-lead/add-lead.mjs (2)

1-3: LGTM! Import organization follows best practices.

The reordering of imports (platform imports → utility imports → app imports) improves code organization and readability.


9-9: Version bump looks appropriate.

The version increment from 0.0.4 to 0.0.5 aligns with the coordinated update across Pipedrive components mentioned in the summary.

components/pipedrive/sources/updated-lead-instant/test-event.mjs (1)

1-56: Well-structured test event data.

The test event provides comprehensive mock data that accurately represents a Pipedrive lead update webhook event, including current state, previous state, and metadata. The structure aligns well with Pipedrive's webhook format.

components/pipedrive/sources/updated-lead-instant/updated-lead-instant.mjs (2)

4-11: Component metadata looks well-defined.

The component key, name, description, version, type, and dedupe strategy are all appropriately configured for a new Pipedrive lead update source.


14-19: getExtraData method correctly configured.

The method properly returns the event action and object type for lead update events, which aligns with Pipedrive's webhook event structure.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

LGTM!

…ged "New Deal Update" to "Deal Updated", "Updated Lead" to "Lead Updated", and "Updated Person" to "Person Updated".
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: 0

🧹 Nitpick comments (2)
components/jobber/actions/search-quotes/search-quotes.mjs (2)

65-76: Consider adding date format validation.

The date props specify YYYY-MM-DD format but lack validation. Invalid date formats could cause GraphQL errors at runtime.

Consider adding format validation:

  dateFrom: {
    type: "string",
    label: "Date From",
    description: "Filter quotes created from this date (YYYY-MM-DD)",
    optional: true,
+   pattern: "^\\d{4}-\\d{2}-\\d{2}$",
  },
  dateTo: {
    type: "string",
    label: "Date To", 
    description: "Filter quotes created until this date (YYYY-MM-DD)",
    optional: true,
+   pattern: "^\\d{4}-\\d{2}-\\d{2}$",
  },

152-230: Consider using template literals for better query readability.

The string concatenation approach works but could be more maintainable using template literals.

Consider refactoring to use template literals:

-    let query = `query SearchQuotes {
-      quotes${filterString}(first: ${limit}) {
+    const query = `
+      query SearchQuotes {
+        quotes${filterString}(first: ${limit}) {
+          nodes {
+            id
+            quoteNumber
+            title
+            message
+            quoteStatus
+            previewUrl
+            jobberWebUri
+            createdAt
+            updatedAt
+            transitionedAt
+            clientHubViewedAt
+            client {
+              id
+              firstName
+              lastName
+              companyName
+            }
+            property {
+              id
+              address {
+                street
+                city
+                state
+                zip
+              }
+            }
+            amounts {
+              subtotal
+              tax
+              total
+            }
+            ${includeLineItems ? `
+              lineItems {
+                nodes {
+                  id
+                  name
+                  description
+                  quantity
+                  unitPrice
+                  total
+                }
+              }
+            ` : ''}
+            ${includeNotes ? `
+              notes {
+                nodes {
+                  id
+                  body
+                  createdAt
+                }
+              }
+            ` : ''}
+            ${includeCustomFields ? `
+              customFields {
+                id
+                name
+                value
+              }
+            ` : ''}
+          }
+          pageInfo {
+            hasNextPage
+            endCursor
+          }
+        }
+      }
+    `;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 234ba4f and 1b5a611.

📒 Files selected for processing (4)
  • components/jobber/actions/search-quotes/search-quotes.mjs (1 hunks)
  • components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs (1 hunks)
  • components/pipedrive/sources/updated-lead-instant/updated-lead-instant.mjs (1 hunks)
  • components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs
  • components/pipedrive/sources/updated-lead-instant/updated-lead-instant.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (4)
components/jobber/actions/search-quotes/search-quotes.mjs (4)

1-8: LGTM! Clean module setup and metadata.

The import structure and module metadata follow standard conventions. The documentation link could be more specific to the GraphQL API, but the current reference is acceptable.


121-150: Excellent filter building logic.

The dynamic filter construction is well-implemented with proper GraphQL syntax. The enum value handling (unquoted) and string value escaping (quoted) are correct.


239-241: Error handling is adequate but basic.

The current error handling takes only the first GraphQL error, which is a common and acceptable practice.


243-250: Excellent response handling and summary generation.

The data extraction and summary export with proper pluralization handling are well-implemented.

@luancazarine
Copy link
Collaborator Author

/approve

GTFalcao
GTFalcao previously approved these changes Jun 21, 2025
…rive sources

- Introduced `getDealCustomFields` and `getPersonCustomFields` methods in the Pipedrive app for fetching custom fields.
- Implemented `parseCustomFields` utility to map custom fields to their respective names.
- Updated `parseData` method in common utilities to handle custom fields for both deals and persons.
- Enhanced `parseData` methods in updated deal and person sources to utilize the new parsing logic.
- Bumped version for updated deal and person sources to 0.1.0.
…-in-pipedrive' of https://github.com/PipedreamHQ/pipedream into 17171-action-new-trigger-action-new-lead-update-instant-in-pipedrive
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

♻️ Duplicate comments (1)
components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs (1)

8-8: Name change addresses previous review feedback.

The name change from "Updated Person (Instant)" to "Person Updated (Instant)" addresses the previous review suggestion.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 689b80a and fd2ecbf.

📒 Files selected for processing (5)
  • components/pipedrive/common/utils.mjs (1 hunks)
  • components/pipedrive/pipedrive.app.mjs (1 hunks)
  • components/pipedrive/sources/common/base.mjs (2 hunks)
  • components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs (2 hunks)
  • components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
🔇 Additional comments (3)
components/pipedrive/sources/common/base.mjs (1)

41-41: LGTM! Proper async handling of parseData.

The implementation correctly awaits the parseData method call before emitting the event.

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

362-369: LGTM! New API methods follow established patterns.

The getDealCustomFields and getPersonCustomFields methods are correctly implemented following the existing pattern used by other API methods in this file.

components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs (1)

24-29: LGTM! Proper integration of custom field parsing.

The parseData method correctly integrates the utility function with the appropriate API method for fetching person custom fields.

@luancazarine
Copy link
Collaborator Author

/approve

@luancazarine luancazarine merged commit 2de0914 into master Jun 24, 2025
11 checks passed
@luancazarine luancazarine deleted the 17171-action-new-trigger-action-new-lead-update-instant-in-pipedrive branch June 24, 2025 21:16
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] New Trigger action "New Lead Update (Instant)" in Pipedrive

3 participants