Skip to content

Conversation

@lcaresia
Copy link
Collaborator

@lcaresia lcaresia commented Dec 12, 2025

WHY

Summary by CodeRabbit

  • New Features
    • Create customer charges to process billing transactions
    • Create and track customer events for analytics
    • Create or update customer records with custom attributes support
  • Improvements
    • Crowdpower integration: configurable inputs and built-in API calls for charges, customers, and events
  • Chores
    • Component version updated and platform dependency added

✏️ Tip: You can customize this high-level summary in your review settings.

@lcaresia lcaresia self-assigned this Dec 12, 2025
@vercel
Copy link

vercel bot commented Dec 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Dec 18, 2025 1:05pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Walkthrough

Adds three Crowdpower action modules (create charge, create event, upsert customer), extends the Crowdpower app with HTTP request helpers and API wrapper methods, and updates package metadata (version and dependency).

Changes

Cohort / File(s) Summary
New Action Modules
components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs, components/crowdpower/actions/create-customer-event/create-customer-event.mjs, components/crowdpower/actions/upsert-customer/upsert-customer.mjs
Three new action descriptors exporting metadata, props (bound to the app propDefinitions), and async run methods that call corresponding this.app API wrapper methods, export a $summary based on response fields, and return the API response.
App Module Enhancement
components/crowdpower/crowdpower.app.mjs
Populated propDefinitions (userId, amount, email, name, customAttributes, action); added _baseUrl(), _makeRequest(opts) (uses Bearer token from this.$auth.application_key), and API wrapper methods createCustomerCharge, upsertCustomer, and createCustomerEvent that POST to Crowdpower endpoints. Removed previous authKeys() logic.
Package Configuration
components/crowdpower/package.json
Bumped version 0.0.40.1.0; added dependencies with @pipedream/platform set to ^3.1.1.

Sequence Diagram(s)

mermaid
sequenceDiagram
autonumber
participant Runtime as Platform Runtime
participant Action as Action Module
participant App as Crowdpower App
participant API as Crowdpower API
Note over Runtime,Action: action invoked by runtime with props and $
Runtime->>Action: invoke run({ $ })
Action->>App: call createCustomerCharge / upsertCustomer / createCustomerEvent(payload)
App->>API: POST /charges or /customers or /events (Authorization: Bearer <application_key>)
API-->>App: HTTP response (JSON: { success, code, ... })
App-->>Action: return response object
Action->>Runtime: $.export("$summary", ...) and return response

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus review on:
    • _makeRequest — axios usage, header/auth handling, error propagation and status handling.
    • API wrapper methods — endpoint paths and payload field mappings (user_id, custom_attributes) and expected response shape.
    • Action modules — propDefinition bindings align with propDefinitions in the app and correct mapping of props into API calls.
    • package.json — version bump and added dependency compatibility.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete with only the 'WHY' template section present and unfilled, containing just a placeholder comment. Complete the 'WHY' section by explaining the business rationale, context, and motivation for adding these three new Crowdpower actions.
Title check ❓ Inconclusive The title references a Crowdpower component update with an issue number, but lacks specific detail about what was implemented. Replace the vague title with a specific summary of the main changes, e.g., 'Add Crowdpower customer charge, event, and upsert actions' or 'Implement Crowdpower API integration with customer management actions'.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-13454

Comment @coderabbitai help to get the list of available commands and usage tips.

@lcaresia lcaresia linked an issue Dec 12, 2025 that may be closed by this pull request
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: 6

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3317f40 and 8264853.

📒 Files selected for processing (5)
  • components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs (1 hunks)
  • components/crowdpower/actions/create-customer-event/create-customer-event.mjs (1 hunks)
  • components/crowdpower/actions/upsert-customer/upsert-customer.mjs (1 hunks)
  • components/crowdpower/crowdpower.app.mjs (1 hunks)
  • components/crowdpower/package.json (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/crowdpower/package.json
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Applied to files:

  • components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs
  • components/crowdpower/actions/create-customer-event/create-customer-event.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.

Applied to files:

  • components/crowdpower/crowdpower.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/crowdpower/crowdpower.app.mjs
🧬 Code graph analysis (2)
components/crowdpower/actions/upsert-customer/upsert-customer.mjs (2)
components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs (1)
  • response (30-36)
components/crowdpower/actions/create-customer-event/create-customer-event.mjs (1)
  • response (37-44)
components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs (2)
components/crowdpower/actions/create-customer-event/create-customer-event.mjs (1)
  • response (37-44)
components/crowdpower/actions/upsert-customer/upsert-customer.mjs (1)
  • response (43-51)
🪛 GitHub Actions: Components Checks
components/crowdpower/package.json

[error] 1-1: Lockfile specifiers do not match package.json: the lockfile has {} while package.json requires "@pipedream/platform":"^1.6.8".

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: pnpm publish
🔇 Additional comments (3)
components/crowdpower/package.json (1)

3-3: Version bump OK, but ensure it matches your release intent (0.0.4 → 0.1.0).

Confirm this is intended as a minor bump (new actions + app surface). Also confirm any internal component registry/versioning expectations for Pipedream components.

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

42-57: Confirm @pipedream/platform axios behavior (return shape + non-2xx errors) matches action expectations.

Actions rely on response.success / response.code. Please verify axios($, config) returns the API JSON body (not an AxiosResponse wrapper), and whether it throws on non-2xx (in which case action summaries won’t run unless wrapped).

components/crowdpower/actions/upsert-customer/upsert-customer.mjs (1)

16-22: The current implementation is correct as-is. The userId parameter cannot be optional because it is embedded in the API endpoint path: PUT /customers/${user_id}. Without userId, the API call would fail with an invalid endpoint (e.g., /customers/undefined).

The review comment misunderstands the action's purpose. This action is designed for updating/upserting an existing customer identified by their userId. If the Crowdpower API supports true create-or-update semantics via the PUT /customers/{userId} endpoint, then userId remains required. If the intended use case is to create customers without pre-existing IDs, a separate endpoint or action logic would be needed, but the current implementation correctly uses the endpoint as designed.

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.

Looks good to me. But I did leave one comment regarding summaries that may need to be improved.

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

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

♻️ Duplicate comments (2)
components/crowdpower/crowdpower.app.mjs (2)

12-16: Amount type should be number, not string.

For better input UX and type consistency, the amount prop should use type: "number".

🔎 Apply this diff:
 amount: {
-  type: "string",
+  type: "number",
   label: "Amount",
   description: "Amount of the charge",
 },

39-57: Use new URL() for safer URL construction.

While the current string concatenation may work, it's fragile. If the base URL or path format changes, it could break. Use the standard new URL() constructor for robust URL joining, as confirmed by maintainer feedback.

🔎 Apply this diff:
 async _makeRequest(opts = {}) {
   const {
     $ = this,
     path,
     headers,
     ...otherOpts
   } = opts;
   return axios($, {
     ...otherOpts,
-    url: this._baseUrl() + path,
+    url: new URL(path, this._baseUrl()).toString(),
     headers: {
       "Authorization": `Bearer ${this.$auth.application_key}`,
       ...headers,
     },
   });
 },
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1bec5cc and e1dda51.

📒 Files selected for processing (2)
  • components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs (1 hunks)
  • components/crowdpower/crowdpower.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.

Applied to files:

  • components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.

Applied to files:

  • components/crowdpower/crowdpower.app.mjs
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.

Applied to files:

  • components/crowdpower/crowdpower.app.mjs
📚 Learning: 2025-02-05T21:58:03.118Z
Learnt from: jverce
Repo: PipedreamHQ/pipedream PR: 15479
File: packages/connect-react/src/components/ComponentForm.tsx:23-24
Timestamp: 2025-02-05T21:58:03.118Z
Learning: In the connect-react package, the `enableDebugging` property should be of type `boolean` as it's used for toggling debugging features and conditional rendering.

Applied to files:

  • components/crowdpower/crowdpower.app.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.

Applied to files:

  • components/crowdpower/crowdpower.app.mjs
🧬 Code graph analysis (1)
components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs (2)
components/crowdpower/actions/upsert-customer/upsert-customer.mjs (1)
  • response (43-51)
components/crowdpower/actions/create-customer-event/create-customer-event.mjs (1)
  • response (37-44)
🪛 GitHub Actions: Pull Request Checks
components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs

[error] 41-41: Trailing spaces not allowed. (no-trailing-spaces)

🪛 GitHub Check: Lint Code Base
components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs

[failure] 41-41:
Trailing spaces not allowed

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (6)
components/crowdpower/actions/create-customer-charge/create-customer-charge.mjs (2)

1-13: LGTM: Action metadata is well-structured.

The import, key, naming, versioning, and annotations follow Pipedream conventions. Documentation link is provided.


14-27: LGTM: Props correctly reference app propDefinitions.

The prop structure follows Pipedream conventions for reusing definitions from the app file.

components/crowdpower/crowdpower.app.mjs (4)

1-1: LGTM: Correct axios import.

Using @pipedream/platform axios is the standard approach for Pipedream integrations.


6-26: LGTM: PropDefinitions for userId, email, and name are properly structured.

Type, label, and description fields are appropriate for these string-based properties.


27-37: LGTM: CustomAttributes and action props are appropriately typed.

The object type for custom attributes and string type for action are suitable for their respective use cases.


58-78: LGTM: Public API methods are well-structured.

All three methods (createCustomerCharge, upsertCustomer, createCustomerEvent) follow a consistent pattern, correctly delegate to _makeRequest, and use appropriate HTTP methods and endpoints.

Copy link
Collaborator

@michelle0927 michelle0927 left a comment

Choose a reason for hiding this comment

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

This is failing the Lint Code Base PR check. Please remember to run npx eslint --fix on any updates before pushing the changes, and make sure the PR is passing checks before moving to "Ready for PR Review".

Comment on lines +40 to +42
user_id: this.userId,
custom_attributes: this.customAttributes,
action: this.action,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The docs show this endpoint accepting properties user_id, action, and properties. Are you sure custom_attributes is correct?

If correct, add an example to the description of prop customAttributes.
If not, add prop properties with an example in the prop description.

Comment on lines +35 to +40
customAttributes: {
propDefinition: [
app,
"customAttributes",
],
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should include an example of valid input in the prop description.

Comment on lines +7 to +11
userId: {
type: "string",
label: "User ID",
description: "ID of the user",
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you use the get customers endpoint to list the ids?

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.

[Components] crowdpower

5 participants