Skip to content

Fixed email validation during member stripe checkout - #30405

Merged
acburdine merged 1 commit into
mainfrom
stripe-validation
Aug 31, 2026
Merged

Fixed email validation during member stripe checkout#30405
acburdine merged 1 commit into
mainfrom
stripe-validation

Conversation

@acburdine

Copy link
Copy Markdown
Member

no ref

no ref

---------

Co-authored-by: Steve Larson <9larsons@gmail.com>
Co-authored-by: Austin Burdine <austin@ghost.org>
@nx-cloud

nx-cloud Bot commented Aug 31, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 44fbb82

Command Status Duration Result
nx run ghost:test:ci:integration ✅ Succeeded 3m 31s View ↗
nx run ghost:test:legacy ✅ Succeeded 3m 29s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 16s View ↗
nx run-many -t lint -p ghost,ghost-monorepo ✅ Succeeded 15s View ↗
nx run-many -t test:unit -p ghost ✅ Succeeded 27s View ↗
nx run @tryghost/admin:build ✅ Succeeded 4s View ↗
nx run-many --target=build --projects=tag:publi... ✅ Succeeded <1s View ↗
nx run @tryghost/e2e:test:fixtures ✅ Succeeded 1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-31 23:52:32 UTC

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Team

Run ID: f21cef86-18c4-4f72-aa92-9c620b3afaee

📥 Commits

Reviewing files that changed from the base of the PR and between 85fc64e and 44fbb82.

⛔ Files ignored due to path filters (1)
  • ghost/core/test/e2e-api/members/__snapshots__/create-stripe-checkout-session.test.js.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • ghost/core/core/server/services/email-service/email-renderer.js
  • ghost/core/core/server/services/email-service/mailgun-email-provider.js
  • ghost/core/core/server/services/members/members-api/controllers/router-controller.js
  • ghost/core/test/e2e-api/members/create-stripe-checkout-session.test.js
  • ghost/core/test/unit/server/services/email-service/mailgun-email-provider.test.js
  • ghost/core/test/unit/server/services/members/members-api/controllers/router-controller.test.js

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (14)
  • GitHub Check: E2E Tests (Main 1/10)
  • GitHub Check: E2E Tests (Main 9/10)
  • GitHub Check: E2E Tests (Main 7/10)
  • GitHub Check: E2E Tests (Main 4/10)
  • GitHub Check: E2E Tests (Main 3/10)
  • GitHub Check: E2E Tests (Main 8/10)
  • GitHub Check: E2E Tests (Analytics 2/2)
  • GitHub Check: E2E Tests (Main 2/10)
  • GitHub Check: E2E Tests (Analytics 1/2)
  • GitHub Check: E2E Tests (Main 5/10)
  • GitHub Check: E2E Tests (Main 6/10)
  • GitHub Check: E2E Tests (Main 10/10)
  • GitHub Check: Legacy tests (Node 22.23.1, mysql8)
  • GitHub Check: Acceptance tests (Node 22.23.1, mysql8)
🧰 Additional context used
📓 Path-based instructions (7)
Review new or changed service boundaries for explicit dependency ownership,

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/core/server/services/members/members-api/controllers/router-controller.js
  • ghost/core/core/server/services/email-service/email-renderer.js
  • ghost/core/core/server/services/email-service/mailgun-email-provider.js
Review whether tests prove changed behaviour, meaningful error/edge paths, and

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/test/unit/server/services/members/members-api/controllers/router-controller.test.js
  • ghost/core/test/unit/server/services/email-service/mailgun-email-provider.test.js
  • ghost/core/test/e2e-api/members/create-stripe-checkout-session.test.js
New source files must be TypeScript: flag new JS files as a required change

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/core/server/services/members/members-api/controllers/router-controller.js
  • ghost/core/test/unit/server/services/members/members-api/controllers/router-controller.test.js
  • ghost/core/core/server/services/email-service/email-renderer.js
  • ghost/core/test/unit/server/services/email-service/mailgun-email-provider.test.js
  • ghost/core/core/server/services/email-service/mailgun-email-provider.js
  • ghost/core/test/e2e-api/members/create-stripe-checkout-session.test.js
Prioritise concrete correctness, security, data-integrity, compatibility,

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/core/server/services/members/members-api/controllers/router-controller.js
  • ghost/core/test/unit/server/services/members/members-api/controllers/router-controller.test.js
  • ghost/core/core/server/services/email-service/email-renderer.js
  • ghost/core/test/unit/server/services/email-service/mailgun-email-provider.test.js
  • ghost/core/core/server/services/email-service/mailgun-email-provider.js
  • ghost/core/test/e2e-api/members/create-stripe-checkout-session.test.js
Boot owns service initialization; do not

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • ghost/core/core/server/services/members/members-api/controllers/router-controller.js
  • ghost/core/core/server/services/email-service/email-renderer.js
  • ghost/core/core/server/services/email-service/mailgun-email-provider.js
New files are TypeScript: Fail if the PR adds a new .js/.jsx/.cjs/.mjs source file, unless it is: a DB

📄 CodeRabbit inference engine (Custom checks)

Files:

  • ghost/core/core/server/services/members/members-api/controllers/router-controller.js
  • ghost/core/test/unit/server/services/members/members-api/controllers/router-controller.test.js
  • ghost/core/core/server/services/email-service/email-renderer.js
  • ghost/core/test/unit/server/services/email-service/mailgun-email-provider.test.js
  • ghost/core/core/server/services/email-service/mailgun-email-provider.js
  • ghost/core/test/e2e-api/members/create-stripe-checkout-session.test.js
Always use `pnpm`, never npm or Yarn.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • ghost/core/core/server/services/members/members-api/controllers/router-controller.js
  • ghost/core/test/unit/server/services/members/members-api/controllers/router-controller.test.js
  • ghost/core/core/server/services/email-service/email-renderer.js
  • ghost/core/test/unit/server/services/email-service/mailgun-email-provider.test.js
  • ghost/core/core/server/services/email-service/mailgun-email-provider.js
  • ghost/core/test/e2e-api/members/create-stripe-checkout-session.test.js
🔇 Additional comments (3)
ghost/core/core/server/services/members/members-api/controllers/router-controller.js (1)

602-604: LGTM!

ghost/core/test/e2e-api/members/create-stripe-checkout-session.test.js (1)

40-40: LGTM!

Also applies to: 68-110, 300-300

ghost/core/test/unit/server/services/members/members-api/controllers/router-controller.test.js (1)

295-350: LGTM!


Walkthrough

Email replacement definitions now mark server-generated values as trusted. Mailgun HTML bodies use escaped variants for untrusted replacement values and raw values for trusted replacements. Subscription checkout now blocks existing paid members and unauthenticated existing members. Authenticated free, comped, and gift members remain eligible to subscribe. Tests cover email rendering and checkout behavior.

Suggested reviewers: evanhahn, 9larsons

Merge Risk: ⚪ Minimal · up to 44fbb

This localized email-validation change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description only says "no ref" and does not provide meaningful information about the checkout or email-validation changes. Replace "no ref" with a brief summary of the email-validation and member Stripe checkout changes.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary objective: fixing email validation during member Stripe checkout.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Type-Safe Boundaries ✅ Passed No explicit type-safe-boundary failure is introduced. The email changes process replacement definitions and values through existing internal service calls. The checkout change uses the already-derived…
New Files Are Typescript ✅ Passed The pull request adds no new files. The diff from merge base 85fc64e to HEAD contains only modified JavaScript files and one modified snapshot file. Therefore, it does not trigger the failure con…
Full details: Type-Safe Boundaries

Explanation

No explicit type-safe-boundary failure is introduced. The email changes process replacement definitions and values through existing internal service calls. The checkout change uses the already-derived isAuthenticated boolean and the existing member status check. Existing direct req.body reads, repository lookup, and Mailgun response handling are unchanged. The diff adds no any, unchecked as, @ts-nocheck, @ts-ignore, or hand-written type duplicating a Zod schema.

Full details: New Files Are Typescript

Explanation

The pull request adds no new files. The diff from merge base 85fc64e to HEAD contains only modified JavaScript files and one modified snapshot file. Therefore, it does not trigger the failure condition for adding a new .js/.jsx/.cjs/.mjs source file.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stripe-validation

Warning

Some tools did not complete. Review the errors below.

🔧 ast-grep (0.45.2)
ghost/core/test/unit/server/services/members/members-api/controllers/router-controller.test.js

ast-grep timed out on this file


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

@acburdine
acburdine enabled auto-merge (squash) August 31, 2026 23:45
@acburdine
acburdine merged commit b4f0eed into main Aug 31, 2026
51 checks passed
@acburdine
acburdine deleted the stripe-validation branch August 31, 2026 23:53
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.06%. Comparing base (85fc64e) to head (44fbb82).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...r/services/email-service/mailgun-email-provider.js 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30405      +/-   ##
==========================================
- Coverage   76.09%   76.06%   -0.04%     
==========================================
  Files        1679     1679              
  Lines      160100   160180      +80     
  Branches    19611    19623      +12     
==========================================
+ Hits       121833   121843      +10     
- Misses      37282    37352      +70     
  Partials      985      985              
Flag Coverage Δ
e2e-tests 77.72% <96.77%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants