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

chore(deps): bump stripe from 9.16.0 to 17.7.0 #3004

Merged
merged 2 commits into from
Mar 7, 2025

Conversation

Tomdrouv1
Copy link
Contributor

@Tomdrouv1 Tomdrouv1 commented Mar 6, 2025

Information

Type Breaking change
Chore Yes

Update Stripe Node.js dependency version since a lot have changed since June 2022.

Refer to breaking changes from v9 to v17 on Stripe docs

Summary by CodeRabbit

  • Chores
    • Upgraded the Stripe integration to version 17.7.0 for enhanced compatibility and performance.
    • Updated API configuration to version 2025-02-24.acacia for improved payment processing.
    • Enhanced error messages for webhook signature verification to provide clearer guidance and links to documentation.

Copy link

coderabbitai bot commented Mar 6, 2025

Walkthrough

The changes update the Stripe library configuration. In the package manifest, the Stripe dependency versions are upgraded to ^17.7.0 in both development and peer sections. Additionally, the API version used in test setups and the server configuration is changed from "2020-08-27" to "2025-02-24.acacia" across several files. Error messages related to webhook signature verification are also enhanced for clarity and guidance.

Changes

File(s) Change Summary
packages/third-parties/stripe/package.json Updated Stripe dependency versions: in devDependencies from ^8.222.0 to ^17.7.0 and in peerDependencies from ^9.16.0 to ^17.7.0.
packages/third-parties/stripe/{src/middlewares/WebhookEventMiddleware.spec.ts, src/services/StripeFactory.spec.ts, test/app/Server.ts} Updated the apiVersion in configuration objects from "2020-08-27" to "2025-02-24.acacia".
packages/third-parties/stripe/test/stripe.integration.spec.ts Enhanced error message for webhook signature verification failures, providing additional guidance and a link to documentation.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d703658 and c6d6519.

📒 Files selected for processing (2)
  • packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.spec.ts (2 hunks)
  • packages/third-parties/stripe/test/stripe.integration.spec.ts (1 hunks)
🔇 Additional comments (3)
packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.spec.ts (2)

101-108: Enhanced error message with improved guidance

The error message has been significantly improved with:

  • Detailed explanation about preserving raw request bodies
  • Guidance on handling webhook forwarding through third-party tools
  • Link to Stripe's documentation on webhook signing and integration examples

This change provides much better developer experience when troubleshooting webhook signature issues.


20-20:

✅ Verification successful

API version updated to match new Stripe library version

The update from "2020-08-27" to "2025-02-24.acacia" aligns with the Stripe dependency upgrade from 9.16.0 to 17.7.0. The new API version format includes both a date and the "acacia" suffix, which is standard for Stripe's versioning scheme.


🌐 Web query:

What is the latest API version for Stripe 17.7.0?

💡 Result:

The latest API version for Stripe 17.7.0 is 2025-02-24.acacia[2][7]. This version is part of the Acacia major release series, which includes backward-incompatible changes, and it reflects the most recent API updates as of the library's release.

When using Stripe's Node.js library (stripe-node) versions 12 and above, the SDK defaults to the API version that was current at the time of the library's release unless explicitly overridden. For Stripe 17.7.0, this means requests align with 2025-02-24.acacia by default[2][5]. However, developers can override this by specifying a different apiVersion during initialization or per request, though this may lead to TypeScript type mismatches if the selected API version differs from the library's pinned version[2][3][5].

For example, initializing the Stripe client with the latest API version in Node.js would look like this:

const stripe = require('stripe')('sk_test_...', {
  apiVersion: '2025-02-24.acacia'
});

Key considerations:

  • Monthly releases (e.g., 2025-02-24.acacia) include backward-compatible changes and share the same major release name[1][7].
  • Major releases (like Acacia) require code updates due to breaking changes[1][2].
  • Webhook events and automated billing operations default to the account's configured API version unless explicitly versioned[1][7].

Always review the API changelog for detailed updates before upgrading[2][7].

Citations:


API version update is correctly applied

  • File: packages/third-parties/stripe/src/middlewares/WebhookEventMiddleware.spec.ts
  • Line 20: The API version "2025-02-24.acacia" now correctly replaces the old version, aligning with the Stripe dependency upgrade from 9.16.0 to 17.7.0.
  • The updated API version matches the latest version for Stripe 17.7.0 as confirmed by the documentation.
packages/third-parties/stripe/test/stripe.integration.spec.ts (1)

91-98: Consistent error message improvements across tests

The error message enhancements match those in the WebhookEventMiddleware tests, ensuring consistency throughout the codebase. The improved formatting with line breaks makes the message more readable while providing the same valuable guidance on webhook signature verification.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.

@Tomdrouv1 Tomdrouv1 changed the title chore(stripe): update dependency version chore(deps): bump stripe version from v9.16.0 to v.17.7.0 Mar 6, 2025
@Tomdrouv1 Tomdrouv1 changed the title chore(deps): bump stripe version from v9.16.0 to v.17.7.0 chore(deps): bump stripe from 9.16.0 to 17.7.0 Mar 6, 2025
@Tomdrouv1
Copy link
Contributor Author

@Romakita I fixed tests about Stripe webhool error message which changed

@Romakita Romakita merged commit 95bdf6b into tsedio:production Mar 7, 2025
12 checks passed
@Romakita
Copy link
Collaborator

Romakita commented Mar 7, 2025

🎉 This PR is included in version 8.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants