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

Update zoho_subscriptions to use Zoho Billing API endpoints #15036

Merged
merged 10 commits into from
Jan 7, 2025

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Dec 19, 2024

Resolves #15008

Summary by CodeRabbit

  • Version Updates

    • Updated version numbers for Zoho Subscriptions components
    • Updated package dependency for Zoho Subscriptions
  • API Changes

    • Updated API documentation links from Subscriptions to Billing API
    • Enhanced customer and subscription creation functionality
  • Improvements

    • Added more descriptive labels for billing and shipping address fields
    • Improved error handling for subscription creation
    • Added methods for customer and contact person management
  • Minor Chores

    • Added newline endings to several app configuration files

Copy link

vercel bot commented Dec 19, 2024

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

Copy link
Contributor

coderabbitai bot commented Dec 19, 2024

Walkthrough

The pull request focuses on updating the Zoho Subscriptions component to transition from the Zoho Subscriptions API to the Zoho Billing API. This involves modifying multiple files within the zoho_subscriptions component, including updating API documentation links, version numbers, and adding new methods for customer and contact person management. The changes primarily reflect the consolidation of Zoho Subscriptions into the Zoho Billing product.

Changes

File Change Summary
components/zoho_subscriptions/actions/create-customer/create-customer.mjs - Updated version from 0.0.1 to 0.0.2
- Updated API documentation link
- Added prefixes to billing and shipping address labels
components/zoho_subscriptions/actions/create-subscription/create-subscription.mjs - Updated version from 0.0.1 to 0.0.2
- Updated API documentation link
- Added reloadProps to customerId prop
- Introduced additionalProps method
components/zoho_subscriptions/package.json - Updated version from 0.1.0 to 0.1.1
- Added @pipedream/platform dependency
components/zoho_subscriptions/sources/payment-failure/payment-failure.mjs - Updated version from 0.0.1 to 0.0.2
components/zoho_subscriptions/sources/subscription-created/subscription-created.mjs - Updated version from 0.0.1 to 0.0.2
components/zoho_subscriptions/zoho_subscriptions.app.mjs - Updated API URL from /subscriptions/v1 to /billing/v1
- Added getCustomer, getContactPerson, and updateCustomer methods

Assessment against linked issues

Objective Addressed Explanation
Update Zoho Subscriptions endpoints to Zoho Billing API
Migrate from deprecated Zoho Subscriptions API

Possibly related PRs

Suggested labels

enhancement, docs, pd-api, tracked internally, prioritized

Suggested reviewers

  • GTFalcao

Poem

🐰 Hopping through APIs with glee,
Zoho's new path, now clear to see!
From Subscriptions to Billing we leap,
Updating endpoints, no time to weep.
A rabbit's guide to smooth transition! 🚀


📜 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 cccdaa7 and eb7c484.

📒 Files selected for processing (5)
  • components/acronis_cyber_protect_cloud/acronis_cyber_protect_cloud.app.mjs (1 hunks)
  • components/bitdefender_gravityzone/bitdefender_gravityzone.app.mjs (1 hunks)
  • components/demandbase/demandbase.app.mjs (1 hunks)
  • components/goto_meeting/goto_meeting.app.mjs (1 hunks)
  • components/recruiterflow/recruiterflow.app.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • components/recruiterflow/recruiterflow.app.mjs
  • components/acronis_cyber_protect_cloud/acronis_cyber_protect_cloud.app.mjs
  • components/goto_meeting/goto_meeting.app.mjs
  • components/demandbase/demandbase.app.mjs
  • components/bitdefender_gravityzone/bitdefender_gravityzone.app.mjs

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • 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. (Beta)
  • @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

🔭 Outside diff range comments (1)
components/zoho_subscriptions/zoho_subscriptions.app.mjs (1)

Version bump and documentation updates required for Zoho Billing migration

The codebase requires the following updates:

  • Package version needs to be bumped from 0.1.1 to 0.2.0 due to the breaking API endpoint change
  • Documentation in README.md needs to be updated to replace "Zoho Subscriptions" with "Zoho Billing"
  • Component descriptions in package.json and source files need to be updated to reflect the new Zoho Billing branding
🔗 Analysis chain

Line range hint 1-248: Update version numbers and documentation references.

Since this is a breaking change in the API endpoint, ensure that:

  1. The component version is bumped appropriately
  2. All API documentation references are updated to point to Zoho Billing instead of Zoho Subscriptions
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check version numbers and documentation references

# Check version numbers in related files
echo "Files containing version numbers:"
fd -e mjs -e json . components/zoho_subscriptions/ -x grep -l "version"

# Check for any remaining references to Zoho Subscriptions API
echo -e "\nFiles containing old API references:"
rg "zoho.com/subscriptions" components/zoho_subscriptions/

Length of output: 653


Script:

#!/bin/bash
# Let's check the actual content of these files to verify version numbers and API references

echo "=== Package.json version ==="
cat components/zoho_subscriptions/package.json | grep -A 1 "version"

echo -e "\n=== Checking API domain references ==="
rg "api_domain|api\.zoho\.com" components/zoho_subscriptions/

echo -e "\n=== Checking documentation and comments for Zoho Subscriptions references ==="
rg -i "zoho subscriptions" components/zoho_subscriptions/

Length of output: 2820

🧹 Nitpick comments (1)
components/zoho_subscriptions/zoho_subscriptions.app.mjs (1)

Line range hint 1-248: Consider adding migration guide in documentation.

Since this is a significant change from Zoho Subscriptions to Zoho Billing API, consider adding migration notes or documentation to help users understand:

  1. The reason for the change
  2. Any potential breaking changes
  3. Steps required to migrate

Would you like me to help draft a migration guide or create a GitHub issue to track this documentation task?

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1a006e0 and 20bddc8.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • components/zoho_subscriptions/actions/create-customer/create-customer.mjs (1 hunks)
  • components/zoho_subscriptions/actions/create-subscription/create-subscription.mjs (1 hunks)
  • components/zoho_subscriptions/package.json (2 hunks)
  • components/zoho_subscriptions/sources/payment-failure/payment-failure.mjs (1 hunks)
  • components/zoho_subscriptions/sources/subscription-created/subscription-created.mjs (1 hunks)
  • components/zoho_subscriptions/zoho_subscriptions.app.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • components/zoho_subscriptions/sources/subscription-created/subscription-created.mjs
  • components/zoho_subscriptions/sources/payment-failure/payment-failure.mjs
  • components/zoho_subscriptions/actions/create-customer/create-customer.mjs
  • components/zoho_subscriptions/actions/create-subscription/create-subscription.mjs
🔇 Additional comments (3)
components/zoho_subscriptions/zoho_subscriptions.app.mjs (1)

137-137: Verify API endpoint compatibility with Zoho Billing.

The change from /subscriptions/v1 to /billing/v1 affects all API calls. While this aligns with the migration to Zoho Billing API, we should verify that all endpoint paths remain valid under the new base URL.

✅ Verification successful

Base URL change is compatible with all endpoints

Based on the complete file analysis, the change from /subscriptions/v1 to /billing/v1 is safe because:

  1. All API endpoints (customers, subscriptions, events, plans, etc.) use relative paths that are compatible with both the old and new base URLs
  2. The authentication and organization ID header handling remain unchanged
  3. All method implementations follow a consistent pattern using _makeRequest which properly combines the base URL with the endpoints
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all API endpoint paths used in the code are valid under the new Zoho Billing API

# List all API endpoint paths used in the code
echo "API endpoints used in the code:"
rg -o 'path: "[^"]+' components/zoho_subscriptions/zoho_subscriptions.app.mjs | sort -u

# Check for any Zoho API documentation references that might need updating
echo -e "\nAPI documentation references that might need updating:"
rg -l "subscriptions/v1|subscriptions.zoho" components/zoho_subscriptions/

Length of output: 450


Script:

#!/bin/bash
# Let's check the actual API endpoint usage patterns and documentation references

# Check for all HTTP method calls and their paths
echo "API endpoint usage patterns:"
rg -A 1 '(get|post|put|patch|delete)\(' components/zoho_subscriptions/zoho_subscriptions.app.mjs

# Check for any API documentation or version references
echo -e "\nAPI documentation and version references:"
rg -i "(zoho|api).*(subscriptions|billing)" components/zoho_subscriptions/zoho_subscriptions.app.mjs

# Check the complete _apiUrl method implementation
echo -e "\nAPI URL method implementation:"
ast-grep --pattern 'methods: {
  $_apiUrl() {
    $$$
  }
}'

Length of output: 665


Script:

#!/bin/bash
# Let's examine the actual API endpoints and method implementations more thoroughly

# Search for all method definitions and their API paths
echo "Method implementations with API paths:"
ast-grep --pattern 'async $_($$$) {
  return this.$_({
    $$$
  });
}'

# Check the complete file content to understand the full context
echo -e "\nFull file content:"
cat components/zoho_subscriptions/zoho_subscriptions.app.mjs

Length of output: 6170

components/zoho_subscriptions/package.json (2)

3-3: LGTM: Version bump follows semantic versioning

The minor version increment from 0.1.0 to 0.1.1 is appropriate for the API endpoint changes and dependency updates.


16-16: Verify @pipedream/platform version compatibility

Let's ensure the specified version of @pipedream/platform is compatible with the Zoho Billing API integration changes.

✅ Verification successful

Based on the output, I can see that several Zoho components (Zoho Survey, Zoho Books, Zoho CRM, Zoho Sheet) are already using the same version ^3.0.3 of @pipedream/platform. This indicates version compatibility across the Zoho ecosystem within Pipedream.

Version ^3.0.3 is compatible with Zoho Subscriptions integration

The specified version aligns with other Zoho components in the ecosystem, ensuring consistency and compatibility.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check @pipedream/platform version compatibility

# Check if other components using Zoho APIs are using the same platform version
echo "Checking platform dependency in other Zoho components..."
fd -e json package.json -x jq -r '. | select(.dependencies["@pipedream/platform"]) | "\(.name): @pipedream/platform \(.dependencies["@pipedream/platform"])"' {}

# Check the changelog or release notes for this version
echo "Fetching package details..."
npm view @pipedream/[email protected] time.modified

Length of output: 66128

lcaresia
lcaresia previously approved these changes Dec 20, 2024
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 (1)
components/zoho_subscriptions/zoho_subscriptions.app.mjs (1)

183-191: Consider enhancing error handling for customer updates

While the implementation is correct, consider adding input validation or specific error handling for common update scenarios.

 updateCustomer({
   customerId, ...args
 }) {
+  if (!customerId) {
+    throw new Error('Customer ID is required for updates');
+  }
   return this._makeRequest({
     method: "PUT",
     path: `customers/${customerId}`,
     ...args,
   });
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 20bddc8 and 39f37db.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • components/zoho_subscriptions/actions/create-customer/create-customer.mjs (2 hunks)
  • components/zoho_subscriptions/actions/create-subscription/create-subscription.mjs (5 hunks)
  • components/zoho_subscriptions/zoho_subscriptions.app.mjs (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/zoho_subscriptions/actions/create-subscription/create-subscription.mjs
  • components/zoho_subscriptions/actions/create-customer/create-customer.mjs
🔇 Additional comments (3)
components/zoho_subscriptions/zoho_subscriptions.app.mjs (3)

11-11: LGTM! Minor documentation improvement

The wording change in the description provides better clarity.


160-175: LGTM! Well-structured customer retrieval methods

The new getCustomer and getContactPerson methods follow consistent patterns with the rest of the codebase and proper REST practices.


137-137: Verify API endpoint compatibility across all methods

The change from /subscriptions/v1 to /billing/v1 is a significant update. While this aligns with the transition to Zoho Billing API, we should ensure all existing methods remain compatible with the new endpoints.

Consider bumping the major version number of this component due to this breaking change.

✅ Verification successful

API endpoint change appears safe to proceed

Based on the verification results:

  1. No remaining references to subscriptions/v1 were found in the codebase
  2. All API endpoints use relative paths (customers, events, plans, etc.) that are appended to the base URL
  3. The endpoints follow RESTful patterns that are commonly maintained across API versions

Since the endpoints are defined using relative paths and there are no hardcoded references to the old API version, the base URL change should work correctly with the new /billing/v1 endpoint. However, as this is a breaking change in the API version, the suggestion to bump the major version number remains valid.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to the old API endpoint
# and verify the existence of all used endpoints in the new API

# Check for any remaining references to subscriptions/v1
rg -l 'subscriptions/v1' 

# List all API endpoint paths used in the file
ast-grep --pattern 'path: "$_"' | sort -u

Length of output: 68


Script:

#!/bin/bash
# Let's try a different approach to find API endpoint patterns

# Search for HTTP method patterns to find API endpoints
rg -A 2 '(get|post|put|delete)\(' components/zoho_subscriptions/

# Search for path definitions in the component
rg 'path:' components/zoho_subscriptions/

# Check for any remaining references to subscriptions/v1 with broader context
rg -i 'subscriptions/v1' components/zoho_subscriptions/ -A 2 -B 2

Length of output: 1941

@michelle0927
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 08fa304 into master Jan 7, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-15008 branch January 7, 2025 15:38
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.

[FEATURE] Update zoho_subscriptions to use Zoho Billing API endpoints
2 participants