Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Gong - Get Extensive Data Action #16106

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Gong - Get Extensive Data Action #16106

wants to merge 7 commits into from

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Apr 1, 2025

Resolves #16062

Note: This hasn't been tested because we're lacking the scope: api:calls:read:extensive.

Summary by CodeRabbit

  • New Features

    • Introduced a robust capability to retrieve extensive call data with versatile filtering options, ensuring users can access detailed insights with ease.
  • Chores

    • Updated the application version to 0.2.0 to reflect the latest improvements.

Copy link

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

Copy link
Contributor

coderabbitai bot commented Apr 1, 2025

Walkthrough

This pull request adds a new module to the Gong application that retrieves extensive call data. It introduces an action with properties such as fromDateTime, toDateTime, workspaceId, callIds, primaryUserIds, and maxResults, and includes a method to make a POST request to the Gong API. The action utilizes pagination via app.paginate and exports a summary message upon data retrieval. Additionally, the package version in package.json is updated from "0.1.2" to "0.2.0" to reflect the new release.

Changes

Files Change Summary
components/gong/actions/get-extensive-data/get-extensive-data.mjs Added a new action module for extensive call data retrieval with properties (fromDateTime, toDateTime, workspaceId, callIds, primaryUserIds, maxResults) and method getExtensiveData.
components/gong/package.json Updated the package version from "0.1.2" to "0.2.0".

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant A as Gong Action
  participant P as app.paginate
  participant G as Gong API

  U->>A: Trigger getExtensiveData with parameters
  A->>P: Call app.paginate with filters
  P->>G: Send POST request for extensive call data
  G-->>P: Return paginated call data
  P-->>A: Provide results
  A->>U: Return summary message (number of calls retrieved)
Loading

Assessment against linked issues

Objective Addressed Explanation
Retrieve extensive data for specific gong call(s) (#16062)

Possibly related PRs

  • [FEATURE] New prop to Gong action #14690: The changes in the main PR introduce a new callIds property in the get-extensive-data module, while the retrieved PR also adds a callIds property to a different Gong action, indicating a direct relationship between the two in terms of modifying similar functionality.

Suggested labels

action

Suggested reviewers

  • lcaresia

Poem

Hop, hop, a new feature in play,
Data hops in a brilliant display.
I, a little rabbit of code so bright,
Admire the calls that dance in the night.
With each line of change, our joy takes flight! 🐇

Happy coding and hopping ahead!


📜 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 e0dba5f and 22afa52.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • components/gong/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/gong/package.json
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: Verify TypeScript components

🪧 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 plan to trigger planning for file edits and PR creation.
  • @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: 0

🧹 Nitpick comments (4)
components/gong/actions/get-extensive-data/get-extensive-data.mjs (4)

57-64: Consider adding error handling to the API method.

The getExtensiveData method is a simple wrapper around the app's POST method, but it lacks explicit error handling.

getExtensiveData(args = {}) {
-  return this.app.post({
+  return this.app.post({
    path: "/calls/extensive",
    ...args,
  });
},

You might want to wrap this with try/catch in the calling code to handle potential API errors.


65-84: Consider validating input parameters.

The run method doesn't validate the relationship between time-related parameters. For example, there's no check to ensure that fromDateTime is before toDateTime.

async run({ $ }) {
  const {
    app,
    getExtensiveData,
    maxResults,
+   fromDateTime,
+   toDateTime,
    ...filter
  } = this;

+  // Validate date parameters if provided
+  if (fromDateTime && toDateTime && new Date(fromDateTime) > new Date(toDateTime)) {
+    throw new Error("fromDateTime must be before toDateTime");
+  }

  const calls = await app.paginate({
    resourceFn: getExtensiveData,
    resourceFnArgs: {
      $,
      data: {
        filter,
      },
    },
    resourceName: "calls",
    max: maxResults,
  });

85-89: Add explicit error handling.

The current implementation checks if calls exist but doesn't explicitly handle potential errors from the API call.

  if (calls?.length) {
    $.export("$summary", `Successfully retrieved data for ${calls.length} calls`);
+  } else {
+    $.export("$summary", "No calls found or no data returned");
  }
  return calls;

1-91: Add a note about testing limitations.

The PR description mentions that this implementation hasn't been tested due to the absence of required scope. Consider adding a code comment acknowledging this limitation.

import app from "../../gong.app.mjs";
import constants from "../../common/constants.mjs";

+// Note: This action requires the 'api:calls:read:extensive' scope to function correctly.
+// As of implementation, testing has been limited due to scope availability constraints.
export default {
  key: "gong-get-extensive-data",
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a2bdd59 and ec0299f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • components/gong/actions/get-extensive-data/get-extensive-data.mjs (1 hunks)
  • components/gong/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (4)
components/gong/package.json (1)

3-3: Version bump is appropriate for new feature addition.

The version change from 0.1.2 to 0.2.0 correctly follows semantic versioning principles, reflecting the addition of a new feature (the extensive data retrieval action).

components/gong/actions/get-extensive-data/get-extensive-data.mjs (3)

4-9: Action metadata looks good.

The metadata properly defines the action with appropriate key, name, description, version, and type. The documentation link helps users understand the API endpoint.


10-56: Props structure is well-defined.

The props are properly structured with appropriate types, labels, descriptions, and optional flags. The reuse of existing propDefinitions helps maintain consistency across the application.


38-48: Verify the retrieval of Primary User IDs.

The primaryUserIds prop uses the app's userId propDefinition, but it's unclear if this will correctly map to what the API expects as "primary user identifiers". Consider verifying this with the API documentation.

Could you confirm that the userId propDefinition returns values that match what the Gong API expects for the primaryUserIds parameter? The description mentions these should match the primaryUserId field of calls.

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] get extensive data on a specific gong call or list of calls in pipedream
2 participants