Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented May 29, 2025

Resolves #16873

Summary by CodeRabbit

  • New Features

    • Introduced an action to update an existing person record in Pipedrive, allowing updates to fields such as name, owner, organization, emails, phones, and visibility.
    • Added support for reusable email and phone properties for person-related actions.
  • Improvements

    • Standardized email and phone property definitions for person actions, improving consistency and maintainability.
  • Chores

    • Updated version numbers for multiple Pipedrive actions and sources.
    • Updated the Pipedrive package version to 0.5.0.

@vercel
Copy link

vercel bot commented May 29, 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) May 29, 2025 3:41pm
pipedream-docs ⬜️ Ignored (Inspect) May 29, 2025 3:41pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) May 29, 2025 3:41pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 29, 2025

Walkthrough

The changes introduce a new "Update Person" action for the Pipedrive integration, add reusable property definitions for emails and phones, and implement an updatePerson method in the Pipedrive app module. Several action and source files have their version numbers incremented, with no other functional changes.

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-lead/add-lead.mjs
components/pipedrive/actions/add-note/add-note.mjs
components/pipedrive/actions/add-organization/add-organization.mjs
components/pipedrive/actions/search-persons/search-persons.mjs
components/pipedrive/sources/new-deal-instant/new-deal-instant.mjs
components/pipedrive/sources/new-person-instant/new-person-instant.mjs
components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs
components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs
Incremented version numbers only; no functional changes.
components/pipedrive/actions/add-person/add-person.mjs Updated emails and phones properties to use propDefinition references; incremented version.
components/pipedrive/actions/update-person/update-person.mjs Added new "Update Person" action for updating a person in Pipedrive via API.
components/pipedrive/pipedrive.app.mjs Added emails and phones prop definitions; added updatePerson method; improved pagination logic.
components/pipedrive/package.json Bumped package version from 0.4.1 to 0.5.0.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UpdatePersonAction
    participant PipedriveApp
    participant PipedriveAPI

    User->>UpdatePersonAction: Provide personId and update fields
    UpdatePersonAction->>PipedriveApp: Call updatePerson({personId, ...fields})
    PipedriveApp->>PipedriveAPI: PATCH /persons/{personId} with updated data
    PipedriveAPI-->>PipedriveApp: Return updated person data
    PipedriveApp-->>UpdatePersonAction: Return response
    UpdatePersonAction-->>User: Return summary and API response
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement "Update a Person" action using Pipedrive API (issue #16873)
Add support for updating person fields: name, ownerId, organizationId, emails, phones, etc. (issue #16873)
Use Pipedrive API endpoint for updating a person (issue #16873)

Suggested reviewers

  • jcortes

Poem

A rabbit hops with code so neat,
Updating persons is quite a feat!
With emails and phones now unified,
And version numbers multiplied.
Pipedrive grows with every hop,
This fluffy coder just won’t stop!
🐇✨

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/pipedrive/actions/add-activity/add-activity.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 Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

components/pipedrive/actions/add-note/add-note.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 Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

components/pipedrive/actions/add-lead/add-lead.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 Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

  • 11 others

📜 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 86d3c48 and 7adbc01.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (15)
  • 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 (2 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 (1 hunks)
  • components/pipedrive/pipedrive.app.mjs (5 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-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: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (24)
components/pipedrive/actions/add-activity/add-activity.mjs (1)

10-10: Bump action version to 0.1.9
This increments the action’s version to stay in sync with the coordinated version updates across all Pipedrive actions in this PR.

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

9-9:

✅ Verification successful

Align component version with coordinated release bump.

The version has been correctly updated from "0.0.4" to "0.0.5" to stay in sync with other Pipedrive sources and actions in this PR. Please ensure no remaining references to the old version exist and that any related documentation or changelog entries reflect this change.

Run this script to verify there are no leftover "0.0.4" occurrences in the Pipedrive directory:


🏁 Script executed:

#!/bin/bash
rg -l 'version: "0\.0\.4"' components/pipedrive

Length of output: 49


Version bump verified – no references to “0.0.4” remain

  • Ran rg -l 'version: "0\.0\.4"' components/pipedrive and found zero matches.
  • The bump to "0.0.5" in components/pipedrive/sources/new-deal-instant/new-deal-instant.mjs is consistent across all Pipedrive components.

Proceed with merging.

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

48-48: Good fix for consistent pagination behavior.

The explicit || false ensures that the cursor is consistently set to false when additionalData.next_cursor is falsy, preventing potential issues with undefined or null values in pagination logic.


149-149: Consistent pagination improvement.

Same improvement as applied to personId options - ensuring consistent false value for pagination termination.


216-216: Pagination consistency maintained.

This change aligns with the pagination improvements made in other option methods, ensuring uniform behavior across all paginated option lists.


419-427: Proper implementation following established patterns.

The updatePerson method correctly follows the same pattern as other API methods in this file, using the PersonsApi v2 and properly destructuring the personId parameter.


297-308:

✅ Verification successful

Well-structured reusable prop definitions.

The new emails and phones prop definitions are well-documented with clear descriptions and helpful examples. This promotes consistency and reusability across different actions.

Let me verify these prop definitions are being used consistently across the codebase:


🏁 Script executed:

#!/bin/bash
# Description: Check if the new emails and phones prop definitions are being used in other action files
# Expected: Find usage of these props in add-person and update-person actions

echo "Searching for emails prop usage:"
rg -A 3 -B 1 '"emails"' --type js

echo -e "\nSearching for phones prop usage:"
rg -A 3 -B 1 '"phones"' --type js

Length of output: 227


#!/bin/bash
# Search for prop definitions and usages of `emails` and `phones` in .mjs and .js files
echo "Searching for '\"emails\"' in .mjs and .js files:"
rg -g '*.mjs' -g '*.js' -B1 -A3 '"emails"'

echo -e "\nSearching for '\"phones\"' in .mjs and .js files:"
rg -g '*.mjs' -g '*.js' -B1 -A3 '"phones"'

#!/bin/bash
# Search for prop definitions and references of `emails` and `phones` across .mjs and .js files
echo "Searching for '\"emails\"' occurrences in .mjs and .js files:"
rg -n '"emails"' -g '*.mjs' -g '*.js' -C3

echo -e "\nSearching for '\"phones\"' occurrences in .mjs and .js files:"
rg -n '"phones"' -g '*.mjs' -g '*.js' -C3

🏁 Script executed:

#!/bin/bash
# Search for usage of the new `emails` and `phones` prop definitions in .mjs files
echo "Looking for \"emails\" in .mjs files:"
rg -n '"emails"' -g '*.mjs' -C3 || echo "No matches found for emails"

echo -e "\nLooking for \"phones\" in .mjs files:"
rg -n '"phones"' -g '*.mjs' -C3 || echo "No matches found for phones"

Length of output: 41880


Prop definitions usage confirmed

Verified that the new emails and phones props in components/pipedrive/pipedrive.app.mjs are correctly referenced via propDefinition in both action files and align with usage elsewhere:

  • components/pipedrive/actions/add-person/add-person.mjs
  • components/pipedrive/actions/update-person/update-person.mjs

No further changes needed—approving.

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

8-8: Routine version increment.

Version bump aligns with the coordinated updates across Pipedrive integration components.

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

8-8: Coordinated version update.

Version increment is consistent with the broader package updates across the Pipedrive integration.

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

10-10: Standard version maintenance.

Version bump maintains consistency with other Pipedrive action components in this update cycle.

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

9-9: Consistent version bump for updated-deal-instant
Version updated to "0.0.5" to align with the overall Pipedream Pipedrive integration release. No functional changes detected.

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

8-8: Bump action version for add-organization
Version incremented from "0.1.8" to "0.1.9" to reflect the latest release. No other modifications.

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

9-9: Update source version for new-person-instant
Version changed to "0.0.5" to stay consistent with related component updates. No functional logic altered.

components/pipedrive/package.json (1)

3-3: Package.json version bump to 0.5.0
The root package version has been updated from "0.4.1" to "0.5.0" to match the coordinated component version increments. Dependencies remain unchanged.

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

9-9: Increment version for add-lead action
Version updated to "0.0.3" in line with other Pipedrive actions in this release. No logic changes detected.

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

8-8: LGTM: Version bump is appropriate.

The version increment aligns with the coordinated updates across Pipedrive components in this PR.

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

9-9: LGTM: Version bump is appropriate.

The version increment is consistent with the coordinated updates across Pipedrive components in this PR.

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

9-9: LGTM: Version bump is appropriate.

The version increment aligns with the coordinated updates across Pipedrive components.


33-43: Excellent refactoring to use propDefinition.

Converting the inline emails and phones property definitions to use propDefinition references promotes code reusability and ensures consistency across actions. This follows best practices for component development.

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

1-3: LGTM: Imports are correct and consistent.

The imports follow the established pattern used in other Pipedrive actions.


5-10: LGTM: Component metadata is well-defined.

The action key, name, description, and version are appropriate. The documentation link is correctly formatted and helpful.


13-20: LGTM: PersonId property is correctly configured.

The personId is appropriately marked as required (optional: false) since it's needed to identify which person to update.


21-60: LGTM: Property definitions are consistent and well-structured.

All update properties are correctly marked as optional, which is appropriate for an update operation. The use of propDefinition references ensures consistency with other actions.


62-83:

✅ Verification successful

LGTM: Implementation follows established patterns.

The run method correctly:

  • Calls the updatePerson method with appropriate parameters
  • Uses parseObject for emails and phones arrays
  • Provides a descriptive success summary including the person ID
  • Handles errors consistently with other actions

Let me verify that the updatePerson method exists in the Pipedrive app component:


🏁 Script executed:

#!/bin/bash
# Description: Verify that updatePerson method exists in the Pipedrive app component
# Expected: Find the updatePerson method implementation

ast-grep --pattern $'updatePerson($_) {
  $$$
}'

Length of output: 49


Let’s search the full codebase for any definition or reference of updatePerson to confirm it exists:


🏁 Script executed:

#!/bin/bash
# Search for the updatePerson method or usage across the repo
rg -n "updatePerson" -A3

Length of output: 9070


LGTM: updatePerson implementation confirmed

The run method in components/pipedrive/actions/update-person/update-person.mjs correctly calls this.pipedriveApp.updatePerson, and the updatePerson method is implemented in components/pipedrive/pipedrive.app.mjs (lines ~419–426). No further changes needed.

✨ Finishing Touches
  • 📝 Generate Docstrings

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

@michelle0927 michelle0927 merged commit fb1c64a into master May 30, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-16873 branch May 30, 2025 14:47
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.

Pipedrive

3 participants