Skip to content

Gong - Get Extensive Data Action #16106

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

Merged
merged 10 commits into from
Apr 16, 2025
Merged

Gong - Get Extensive Data Action #16106

merged 10 commits into from
Apr 16, 2025

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 15, 2025 3:12pm
pipedream-docs ⬜️ Ignored (Inspect) Apr 15, 2025 3:12pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Apr 15, 2025 3:12pm

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)

Suggested labels

ai-assisted

Suggested reviewers

  • jcortes

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

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/gong/actions/get-extensive-data/get-extensive-data.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 packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)


📜 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 c490e46 and c22f0f1.

📒 Files selected for processing (1)
  • components/gong/actions/get-extensive-data/get-extensive-data.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/gong/actions/get-extensive-data/get-extensive-data.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • 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 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.

GTFalcao
GTFalcao previously approved these changes Apr 2, 2025
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: 4

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

91-94: Handle empty results consistently

The code only exports a summary when calls are found, but it would be more consistent to export a summary in all successful cases, including when no calls are found (which is different from an error case).

      if (calls?.length) {
        $.export("$summary", `Successfully retrieved data for ${calls.length} calls`);
+      } else {
+        $.export("$summary", "No calls found matching the provided criteria");
      }
      return calls;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 22afa52 and c490e46.

📒 Files selected for processing (1)
  • components/gong/actions/get-extensive-data/get-extensive-data.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (4)
components/gong/actions/get-extensive-data/get-extensive-data.mjs (4)

9-9: Check version number consistency

The component version is set to "0.0.1" while the package version was updated from "0.1.2" to "0.2.0" according to the summary. Consider whether this is the appropriate version number for a new component in the updated package.


1-3: LGTM!

The imports look appropriate, importing the necessary modules and error handling from the Pipedream platform.


58-64: LGTM!

The getExtensiveData method implementation is concise and correctly constructed to make the API request.


78-90: LGTM!

The pagination implementation using app.paginate is well-structured and correctly passes the filter parameters to the API.

@michelle0927
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 5424b40 into master Apr 16, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-16062 branch April 16, 2025 16:01
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