Home

>

Tools

>

Ghost

>

Releases

>

5.2.2

Ghost Release: 5.2.2

Tag Name: v5.2.2

Release Date: 6/3/2022

Ghost LogoGhost

Open-source publishing platform specifically designed for professional bloggers and publications. Focuses on clean, minimalist writing and publishing experience.

TL;DR

Ghost v5.2.2 brings important bug fixes for tier imports and webhook testing improvements. This release fixes issues with duplicate tiers during imports and improves the mapping of Stripe products. It also introduces a new framework for webhook end-to-end testing, making it easier to test webhook functionality. The update includes the latest versions of Casper theme (v5.1.4) and Admin (v5.2.2).

Highlight of the Release

    • Fixed issue with duplicate tiers being created during imports
    • Improved mapping of Stripe products during imports to ensure members are assigned to correct tiers
    • Added new framework for webhook end-to-end testing
    • Updated Casper theme to v5.1.4

Migration Guide

No specific migration steps are required for this update. This is a minor release with bug fixes and improvements that should not affect existing functionality.

To update:

  1. Back up your Ghost installation
  2. Follow the standard update procedure for your installation method
  3. No additional configuration changes are needed

Upgrade Recommendations

This update is recommended for all Ghost users, especially those who:

  • Use the import/export functionality for site migrations
  • Have members with paid subscriptions
  • Are developing with webhooks
  • Run tests in CI environments with matrix configurations

The bug fixes for tier imports and Stripe product mapping are particularly important for maintaining data integrity during migrations.

Bug Fixes

Fixed Duplicate Tiers on Import

Fixed an issue where duplicate tiers were being created with different slugs during the import process.

Improved Stripe Product Mapping

Updated mapping for stripe_products when product import is skipped:

  • When migrating a site, default and free tiers are skipped as they exist by default
  • Previously, without proper ID mapping, imported members wouldn't be mapped to the correct tier
  • Now the system performs a lookup for the product by name and slug to restore the correct stripe_product mapping

Fixed Database Environment Variables

Fixed an issue where database environment variables were leaking across matrix runs:

  • Environment variables for SQLite were leaking to MySQL test runs
  • This was causing warnings due to the strict nature of mysql2
  • Switched to optionally setting environment variables as a workaround

Fixed Webhook Testing Issues

  • Fixed webhook snapshot test error output that was previously showing misleading errors
  • Added a temporary matcher to overcome 404 URL problems caused by the async nature of URL processing in the URL Service
  • Fixed post.published event test suite to use updated webhook mock methods

New Features

New Webhook Testing Framework

A new framework for webhook end-to-end testing has been introduced, making it easier to test webhook functionality:

  • Added basic framework for intercepting and matching webhook request snapshots
  • Extracted webhook mock receiver into a separate package
  • Added webhook fixture utilities for easier test creation
  • Integrated webhook tests into the test:e2e command
  • Added test coverage for post.added and post.published events

This new testing framework follows a similar approach to API E2E tests, using "matchBodySnapshot" and other matching methods to test webhook request data.

Security Updates

No security fixes were mentioned in this release.

Performance Improvements

No specific performance improvements were mentioned in this release.

Impact Summary

Ghost v5.2.2 is a maintenance release that addresses important bugs and enhances developer tooling. The fixes for duplicate tiers and Stripe product mapping ensure more reliable site migrations, particularly for sites with paid memberships.

The new webhook testing framework significantly improves the developer experience when working with Ghost's webhook functionality, making it easier to test and validate webhook implementations.

For most end users, this update will be seamless, with the benefit of the latest Casper theme improvements. Site administrators will benefit from more reliable import/export functionality, especially when migrating sites with paid memberships.

Full Release Notes

Statistics:

File Changed13
Line Additions533
Line Deletions22
Line Changes555
Total Commits15

User Affected:

  • Fixed issue with duplicate tiers being created during imports
  • Improved mapping of Stripe products when product import is skipped
  • Updated to latest Casper theme (v5.1.4) with its improvements

Contributors:

daniellockyernazmatthanley