Skip to content

🎨 Moved x402 adapter dependencies off of boot hotpath - #30266

Merged
acburdine merged 1 commit into
mainfrom
fix/hotpath
Aug 25, 2026
Merged

acburdine merged 1 commit into
mainfrom
fix/hotpath

Conversation

@acburdine

Copy link
Copy Markdown
Member

no ref

  • x402 adapters dependencies were loaded unconditionally on boot due to configuration defaults, even if machinePayments is not configured or enabled
  • adds a enabled flag to x402 config block to only load deps when actually used

@acburdine
acburdine requested a review from louisghost August 25, 2026 10:46
@nx-cloud

nx-cloud Bot commented Aug 25, 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 6151ebc

Command Status Duration Result
nx run ghost:test:ci:integration ✅ Succeeded 2m 24s View ↗
nx run ghost:test:integration ✅ Succeeded 3m 19s View ↗
nx run ghost:test:legacy ✅ Succeeded 3m 7s View ↗
nx run ghost:test:e2e ✅ Succeeded 2m 49s View ↗
nx run-many -t test:unit -p ghost ✅ Succeeded 31s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 23s View ↗
nx run-many -t lint -p ghost,ghost-monorepo ✅ Succeeded 20s View ↗
nx run @tryghost/admin:build ✅ Succeeded 8s View ↗
nx run-many --target=build --projects=tag:publi... ✅ 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-25 11:27:18 UTC

@coderabbitai

coderabbitai Bot commented Aug 25, 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: Pro Plus

Run ID: d38d3dae-caf4-4939-8fdf-8fb8c85c571c

📥 Commits

Reviewing files that changed from the base of the PR and between b4fe996 and 6151ebc.

📒 Files selected for processing (2)
  • ghost/core/core/shared/config/defaults.json
  • ghost/core/test/integration/services/machine-payments/orchestration.test.js

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

📜 Recent review details
⏰ Context from checks skipped due to timeout. (13)
  • GitHub Check: Build Docker Images
  • GitHub Check: Acceptance tests (Node 22.23.1, mysql8)
  • GitHub Check: Build Admin
  • GitHub Check: Acceptance tests (Node 22.23.1, better-sqlite3)
  • GitHub Check: Stripe fixture checks
  • GitHub Check: Unit tests (Node 22.23.1)
  • GitHub Check: Legacy tests (Node 22.23.1, better-sqlite3)
  • GitHub Check: Build E2E Public App Assets
  • GitHub Check: Legacy tests (Node 22.23.1, mysql8)
  • GitHub Check: Lint
  • GitHub Check: i18n
  • GitHub Check: Check app version bump
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (5)
Review whether tests prove changed behaviour, meaningful error/edge paths, and

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/test/integration/services/machine-payments/orchestration.test.js
New source files must be TypeScript: flag new JS files as a required change

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/test/integration/services/machine-payments/orchestration.test.js
Prioritise concrete correctness, security, data-integrity, compatibility,

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/test/integration/services/machine-payments/orchestration.test.js
  • ghost/core/core/shared/config/defaults.json
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/test/integration/services/machine-payments/orchestration.test.js
Always use `pnpm`, never npm or Yarn.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • ghost/core/test/integration/services/machine-payments/orchestration.test.js
  • ghost/core/core/shared/config/defaults.json
🔇 Additional comments (2)
ghost/core/core/shared/config/defaults.json (1)

282-282: LGTM!

ghost/core/test/integration/services/machine-payments/orchestration.test.js (1)

539-545: LGTM!

Also applies to: 575-581, 613-614


Walkthrough

The x402 configuration schema now includes enabled, defaulting to false, and uses z.url() for facilitatorUrl. A shared X402RawConfig type updates configuration dependencies and parsing. Adapter initialization reads the enabled setting and returns false without loading runtime modules when x402 is disabled. Tests cover explicit and default enablement, Base Sepolia configuration, and disabled initialization behavior.

Suggested reviewers: louisghost, 9larsons

Merge Risk: ⚪ Minimal · up to 6151e

The change is merge-ready after normal checks and review, with no actionable merge-blocking risk remaining.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes moving x402 adapter dependencies off the boot hotpath, which is the main change.
Description check ✅ Passed The description explains that an enabled flag prevents unconditional x402 dependency loading and matches the changeset.
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 PASS. The changed configuration values from config.get and configProvider enter parseX402Config, which validates them with x402ConfigSchema.safeParse before use. The new enabled value is als…
New Files Are Typescript ✅ Passed The pull request adds no files. The diff contains four modified files only. The two changed .js files existed in the parent revision, so they are pre-existing JavaScript files. The new adapter chang…
Full details: Type-Safe Boundaries

Explanation

PASS. The changed configuration values from config.get and configProvider enter parseX402Config, which validates them with x402ConfigSchema.safeParse before use. The new enabled value is also part of that schema. The PR adds no any, TypeScript suppression, or unchecked cast. X402RawConfig is a raw boundary type with optional unknown fields, not a duplicate of the schema's validated field types; X402Config remains derived with z.infer. Config and test-file changes are exempt by the check.

Full details: New Files Are Typescript

Explanation

The pull request adds no files. The diff contains four modified files only. The two changed .js files existed in the parent revision, so they are pre-existing JavaScript files. The new adapter changes are in .ts, and the configuration change is in .json.

✨ 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 fix/hotpath

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

no ref
- x402 adapters dependencies were loaded unconditionally on boot due to configuration defaults, even if machinePayments is not configured or enabled
- adds a enabled flag to x402 config block to only load deps when actually used
@github-actions

Copy link
Copy Markdown
Contributor

E2E Tests Failed

To view the Playwright test report locally, run:

REPORT_DIR=$(mktemp -d) && gh run download 32841443106 -n playwright-report -D "$REPORT_DIR" && npx playwright show-report "$REPORT_DIR"

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.47%. Comparing base (837155c) to head (6151ebc).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30266      +/-   ##
==========================================
+ Coverage   75.45%   75.47%   +0.02%     
==========================================
  Files        1641     1641              
  Lines      155794   155796       +2     
  Branches    18770    18781      +11     
==========================================
+ Hits       117549   117594      +45     
+ Misses      37239    37218      -21     
+ Partials     1006      984      -22     
Flag Coverage Δ
e2e-tests 77.14% <100.00%> (+0.03%) ⬆️

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.

@acburdine
acburdine enabled auto-merge (squash) August 25, 2026 11:31
@acburdine
acburdine merged commit c08c6b5 into main Aug 25, 2026
84 of 97 checks passed
@acburdine
acburdine deleted the fix/hotpath branch August 25, 2026 11: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.

1 participant