Skip to content

[ACTION] Apollo.io Add Contact to List and Remove Contact from List #15670 #15798

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 7 commits into from
Mar 18, 2025

Conversation

lcaresia
Copy link
Collaborator

@lcaresia lcaresia commented Mar 3, 2025

WHY

Summary by CodeRabbit

  • New Features

    • Updated versioning to reflect the latest release.
    • Added a method to retrieve available labels, enhancing user flexibility in label selection.
  • Improvements

    • Enhanced label handling to accept both string and array formats, streamlining contact management.
    • Updated descriptions for label selection to clarify usage options for users.

Copy link

vercel bot commented Mar 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 17, 2025 0:51am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
pipedream-docs ⬜️ Ignored (Inspect) Mar 17, 2025 0:51am
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Mar 17, 2025 0:51am

Copy link
Contributor

coderabbitai bot commented Mar 3, 2025

Walkthrough

The changes update several components, primarily focusing on version increments across various actions and sources. Notably, the update-contact action's version is now "0.0.5", with a modification to the run method to conditionally parse labelNames. The Apollo app file updates the labelNames property description and introduces an asynchronous options function that retrieves label data via a new listLabels method.

Changes

File(s) Change Summary
components/apollo_io/actions/update-contact/update-contact.mjs Updated version from "0.0.4" to "0.0.5" and modified the run method to conditionally parse this.labelNames if it is a string.
components/apollo_io/apollo_io.app.mjs Revised labelNames property description and added an asynchronous options function that retrieves label names using a new listLabels method calling the /labels endpoint.
components/apollo_io/actions/add-contacts-to-sequence/add-contacts-to-sequence.mjs Updated version from "0.0.3" to "0.0.4".
components/apollo_io/actions/create-account/create-account.mjs Updated version from "0.0.3" to "0.0.4".
components/apollo_io/actions/create-contact/create-contact.mjs Updated version from "0.0.4" to "0.0.5".
components/apollo_io/actions/create-opportunity/create-opportunity.mjs Updated version from "0.0.2" to "0.0.3".
components/apollo_io/actions/create-update-contact/create-update-contact.mjs Updated version from "0.0.1" to "0.0.2".
components/apollo_io/actions/get-opportunity/get-opportunity.mjs Updated version from "0.0.2" to "0.0.3".
components/apollo_io/actions/people-enrichment/people-enrichment.mjs Updated version from "0.0.5" to "0.0.6".
components/apollo_io/actions/search-accounts/search-accounts.mjs Updated version from "0.0.2" to "0.0.3".
components/apollo_io/actions/search-contacts/search-contacts.mjs Updated version from "0.0.2" to "0.0.3".
components/apollo_io/actions/search-sequences/search-sequences.mjs Updated version from "0.0.2" to "0.0.3".
components/apollo_io/actions/update-account-stage/update-account-stage.mjs Updated version from "0.0.3" to "0.0.4".
components/apollo_io/actions/update-account/update-account.mjs Updated version from "0.0.3" to "0.0.4".
components/apollo_io/actions/update-contact-stage/update-contact-stage.mjs Updated version from "0.0.3" to "0.0.4".
components/apollo_io/actions/update-opportunity/update-opportunity.mjs Updated version from "0.0.2" to "0.0.3".
components/apollo_io/sources/account-created/account-created.mjs Updated version from "0.0.3" to "0.0.4".
components/apollo_io/sources/account-updated/account-updated.mjs Updated version from "0.0.3" to "0.0.4".
components/apollo_io/sources/contact-created/contact-created.mjs Updated version from "0.0.5" to "0.0.6".
components/apollo_io/sources/contact-updated/contact-updated.mjs Updated version from "0.0.5" to "0.0.6".
components/apollo_io/package.json Updated package version from "0.4.1" to "0.5.0".

Suggested reviewers

  • michelle0927

Poem

I’m a little rabbit, hopping through code,
Dynamic versions and labels now in mode.
Parsing strings or arrays, both in line,
New endpoints call out, oh so fine!
With hops of joy, I celebrate the change sublime.
🐇🌟


📜 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 56abf5e and 3d540ea.

📒 Files selected for processing (1)
  • components/apollo_io/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/apollo_io/package.json
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base

🪧 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.
  • @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: 3

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 492fbe1 and 77d0982.

📒 Files selected for processing (2)
  • components/apollo_io/actions/update-contact/update-contact.mjs (2 hunks)
  • components/apollo_io/apollo_io.app.mjs (2 hunks)
🧰 Additional context used
🪛 GitHub Check: Lint Code Base
components/apollo_io/actions/update-contact/update-contact.mjs

[warning] 9-9:
{{ts}} macro should be removed before committing

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (3)
components/apollo_io/apollo_io.app.mjs (3)

176-176: LGTM: Improved description for labelNames property.

The updated description is more informative and includes helpful usage examples for creating new labels using custom expressions.


392-397: LGTM: New method for retrieving labels.

The new listLabels method follows the same pattern as other API methods in the file, which maintains consistency in the codebase.


178-182:

❓ Verification inconclusive

Verify the response structure from the labels endpoint.

The options() function assumes the response from listLabels() is an array containing objects with a name property. Let's verify this assumption by checking the API response structure.

Also applies to: 392-397


🏁 Script executed:

#!/bin/bash
# Description: Capture and verify the structure of the response from the Apollo.io labels endpoint

# Create a mock file for testing the API response structure
cat > mockApolloResponse.js << 'EOF'
const mockResponse = require('./mockResponse.json');
console.log('Response structure:', JSON.stringify(mockResponse, null, 2));
console.log('Is array?', Array.isArray(mockResponse));
if (Array.isArray(mockResponse) && mockResponse.length > 0) {
  console.log('First item has name property?', mockResponse[0].hasOwnProperty('name'));
  console.log('Sample names:', mockResponse.slice(0, 3).map(item => item.name));
} else {
  console.log('Expected array structure not found. Actual structure:', typeof mockResponse);
  if (typeof mockResponse === 'object') {
    console.log('Keys:', Object.keys(mockResponse));
    // Check if response has a labels property that might contain the array
    if (mockResponse.labels && Array.isArray(mockResponse.labels)) {
      console.log('Found labels array. First item has name property?', 
        mockResponse.labels[0].hasOwnProperty('name'));
      console.log('Sample names:', mockResponse.labels.slice(0, 3).map(item => item.name));
    }
  }
}
EOF

# Find API responses in the codebase to see if there's sample data
rg -l "labels" --json-path "components" --include "*.json" -l | head -n 3

Length of output: 513


Attention: Verify API Response Structure Manually

The initial verification script did not execute as expected due to an unsupported --json-path argument. Please manually confirm that the listLabels() function returns an array of objects with a name property. If the API instead returns a nested structure (for instance, an object containing a labels array), update the options() function accordingly.

  • Check the actual API response (or the sample in mockResponse.json) to ensure it’s an array.
  • If the response is an object with a nested array (e.g., under a labels key), extract that array before mapping the name property.

Also applies to: Lines 392-397.

Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @lcaresia I've just added a couple of request changes and in addition to that please change the version in package.json as well, thanks!

@lcaresia lcaresia requested a review from jcortes March 12, 2025 19:28
@lcaresia
Copy link
Collaborator Author

@jcortes Can you review this one?

@vunguyenhung vunguyenhung merged commit 94aba6c into master Mar 18, 2025
11 checks passed
@vunguyenhung vunguyenhung deleted the issue-15670 branch March 18, 2025 03:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ACTION] Improve update contact with label
3 participants