Skip to content

Updated SDK Packages#27290

Merged
vershwal merged 1 commit into
mainfrom
SDKUpdates
Apr 9, 2026
Merged

Updated SDK Packages#27290
vershwal merged 1 commit into
mainfrom
SDKUpdates

Conversation

@vershwal
Copy link
Copy Markdown
Member

@vershwal vershwal commented Apr 9, 2026

Updated @tryghost/* SDK packages (from TryGhost/SDK) to their latest published versions across the monorepo. Also bumped @tryghost/announcement-bar to 1.1.15.

Updated packages

Package Previous Updated Changed in
@tryghost/color-utils 0.2.10 0.2.16 ghost/core, ghost/admin, admin-x-settings
@tryghost/config-url-helpers 1.0.17 1.0.23 ghost/core
@tryghost/content-api 1.12.0 1.12.6 announcement-bar
@tryghost/custom-fonts 1.0.2 1.0.8 ghost/core, admin-x-settings
@tryghost/helpers 1.1.97 1.1.103 ghost/core, ghost/admin
@tryghost/html-to-plaintext 1.0.4 1.0.8 ghost/core
@tryghost/limit-service 1.4.1 1.5.2 ghost/core, ghost/admin, admin-x-settings
@tryghost/members-csv 2.0.3 2.0.5 ghost/core, ghost/admin
@tryghost/string 0.2.17 0.3.2 ghost/core, ghost/admin
@tryghost/timezone-data 0.4.12 0.4.18 ghost/admin, admin-x-settings

The following SDK packages were already at their latest versions on main (updated via #27264): adapter-base-cache, admin-api-schema, image-transform, referrer-parser, social-urls.

Note

@tryghost/url-utils has been intentionally excluded from this PR and will be updated separately.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Walkthrough

The pull request updates version pins for @tryghost/* packages across four package.json files: 4 dependency bumps in apps/admin-x-settings, 1 version bump in apps/announcement-bar, 6 devDependency bumps in ghost/admin, and 8 dependency bumps in ghost/core — 19 total version changes. No other manifest fields, scripts, exported/public entity declarations, or API surface were modified.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess relevance to the changeset. Add a description explaining the purpose of the SDK package updates, versions being updated, and any testing or validation performed.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'Updated SDK Packages' accurately summarizes the main change—updating multiple @tryghost SDK package dependencies across several package.json files in the monorepo.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 SDKUpdates

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 and usage tips.

Copy link
Copy Markdown
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ghost/core/package.json`:
- Around line 76-77: The upgrade to `@tryghost/admin-api-schema` changed AJV error
shapes (dataPath → instancePath) and format handling; update the validator
utilities in json-schema.js (e.g., any function that builds ValidationError or
extracts the failing property) to normalize both AJV v6 and v8 shapes by reading
error.instancePath || error.dataPath and deriving the same "property" value for
nested paths, and ensure ajv-formats is registered with the AJV instance used in
build/validate functions; then update all call sites that consume
ValidationError.property (images, webhooks, posts, pages handlers) to use the
normalized property accessor (or a helper method you add in json-schema.js) so
both old and new error objects work consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b0184b23-c83b-46f0-945d-c1b3b36d7435

📥 Commits

Reviewing files that changed from the base of the PR and between d875a48 and 75d2761.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • apps/admin-x-settings/package.json
  • apps/announcement-bar/package.json
  • ghost/admin/package.json
  • ghost/core/package.json

Comment thread ghost/core/package.json
Comment on lines +76 to +77
"@tryghost/adapter-base-cache": "0.1.23",
"@tryghost/admin-api-schema": "4.7.2",
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect direct call sites tied to bumped SDKs.
rg -nP "require\('@tryghost/admin-api-schema'\)|jsonSchema\.validate\s*\(" ghost/core -C3
rg -nP "require\('@tryghost/limit-service'\)|loadLimits\s*\(" ghost/core -C4
rg -nP "require\('@tryghost/string'\)|\{slugify\}\s*=\s*require\('@tryghost/string'\)" ghost/core -C3

Repository: TryGhost/Ghost

Length of output: 16073


🌐 Web query:

What are the breaking or behavioral changes from @tryghost/admin-api-schema4.5.10 to 4.7.2 forvalidate(...), and from @tryghost/limit-service1.4.1 to 1.5.2 forloadLimits(...) options?

💡 Result:

@tryghost/admin-api-schema 4.5.10 → 4.7.2 (validate(...))

No breaking change in the validate({data, schema, definition}) signature itself (it still defaults definition to schema?.split('-')[0]). What did change is the validation engine behavior/output, due to an AJV upgrade and related wiring:

  • AJV error path field changed from errors[0].dataPath (AJV v6-style) to errors[0].instancePath (AJV v8-style). This affects how the library derives the key used in the thrown ValidationError (property and the "Validation failed for X" message). In practice, you may see different property values for the same invalid payload, especially for nested paths.

    • 4.5.10 uses dataPath and splits on . to get the last segment. [1]
    • 4.7.2 uses instancePath and splits on / to get the last segment. [2]
  • Format handling changed:

    • 4.5.10 defines the custom json-string format via the AJV constructor formats option. [1]
    • 4.7.2 registers formats via ajv-formats, and registers json-string via ajv.addFormat(...). This can change which standard formats are recognized/validated (and thus what now fails validation). [2]

@tryghost/limit-service 1.4.1 → 1.5.2 (loadLimits(...) options)

No breaking or behavioral changes found in loadLimits({limits = {}, subscription, helpLink, db, errors}) options between these versions:

  • Same parameter shape (including limits defaulting to {}), same requirement that errors must be provided, and same behavior around requiring subscription when using maxPeriodic. [3] [4]

Sources:
[1] @tryghost/admin-api-schema@4.5.10 json-schema.js (AJV setup + dataPath usage)
[2] @tryghost/admin-api-schema@4.7.2 json-schema.js (AJV setup + instancePath usage, ajv-formats)
[3] @tryghost/limit-service@1.4.1 LimitService.js (loadLimits(...) signature/options)
[4] @tryghost/limit-service@1.5.2 LimitService.js (loadLimits(...) signature/options)


Validate error handling for @tryghost/admin-api-schema upgrade (4.5.10 → 4.7.2)—breaking validation error path change detected.

The bump to @tryghost/admin-api-schema 4.7.2 introduces a breaking behavioral change: the validation error path field changed from dataPath (AJV v6 style) to instancePath (AJV v8 style). This affects the property field in ValidationError messages, especially for nested validation paths. Additionally, format validation changed from AJV constructor-based to ajv-formats registration, which may alter which custom formats are recognized.

Review error handling in ghost/core/core/server/api/endpoints/utils/validators/utils/json-schema.js and all call sites (images, webhooks, posts, pages) to ensure they do not depend on the previous error property structure. The @tryghost/limit-service and @tryghost/string upgrades are safe—no breaking changes detected.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ghost/core/package.json` around lines 76 - 77, The upgrade to
`@tryghost/admin-api-schema` changed AJV error shapes (dataPath → instancePath)
and format handling; update the validator utilities in json-schema.js (e.g., any
function that builds ValidationError or extracts the failing property) to
normalize both AJV v6 and v8 shapes by reading error.instancePath ||
error.dataPath and deriving the same "property" value for nested paths, and
ensure ajv-formats is registered with the AJV instance used in build/validate
functions; then update all call sites that consume ValidationError.property
(images, webhooks, posts, pages handlers) to use the normalized property
accessor (or a helper method you add in json-schema.js) so both old and new
error objects work consistently.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey this is a false positive. The dataPathinstancePath change (AJV v6 → v8) is handled internally by the @tryghost/admin-api-schema package, the thrown ValidationError shape (message, property, errorDetails) is identical from the consumer's perspective.

Ghost's wrapper is a one-line pass-through that never inspects raw AJV errors. Verified: zero references to dataPath or instancePath anywhere in the Ghost codebase.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vershwal, you're absolutely right — I apologize for the noise. Since @tryghost/admin-api-schema fully encapsulates the AJV v6 → v8 migration internally and presents a stable ValidationError interface (message, property, errorDetails) to consumers, Ghost's pass-through wrapper requires no changes. I'll record this for future reviews.


✏️ Learnings added
Learnt from: vershwal
Repo: TryGhost/Ghost PR: 27290
File: ghost/core/package.json:76-77
Timestamp: 2026-04-09T09:44:26.783Z
Learning: In the TryGhost/Ghost monorepo, the `tryghost/admin-api-schema` package fully encapsulates AJV version differences (e.g., `dataPath` → `instancePath` from AJV v6 to v8) internally. The public `ValidationError` shape (`message`, `property`, `errorDetails`) is stable from the consumer's perspective. Ghost's wrapper code is a one-line pass-through and never inspects raw AJV error objects. There are zero references to `dataPath` or `instancePath` anywhere in the Ghost codebase. Future reviews should not flag AJV internal changes as issues for Ghost consumers of this package.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@vershwal vershwal force-pushed the SDKUpdates branch 2 times, most recently from f5e61d6 to da53a7e Compare April 9, 2026 09:26
@vershwal vershwal changed the title Updated SDK Packages [WIP] Updated SDK Packages Apr 9, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.45%. Comparing base (2b6c0fd) to head (a7aa19a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27290      +/-   ##
==========================================
- Coverage   73.45%   73.45%   -0.01%     
==========================================
  Files        1545     1545              
  Lines      123666   123666              
  Branches    14958    14958              
==========================================
- Hits        90839    90835       -4     
- Misses      31830    31832       +2     
- Partials      997      999       +2     
Flag Coverage Δ
admin-tests 54.37% <ø> (-0.03%) ⬇️
e2e-tests 73.45% <ø> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 9, 2026

@vershwal vershwal changed the title [WIP] Updated SDK Packages Updated SDK Packages Apr 9, 2026
@vershwal vershwal requested a review from ErisDS April 9, 2026 10:22
@vershwal vershwal merged commit c92425f into main Apr 9, 2026
40 checks passed
@vershwal vershwal deleted the SDKUpdates branch April 9, 2026 10:43
franky19 pushed a commit to franky19/Ghost that referenced this pull request Apr 18, 2026
no issue

Updated `@tryghost/*` SDK packages (from
[TryGhost/SDK](https://github.com/TryGhost/SDK)) to their latest
published versions across the monorepo. Also bumped
`@tryghost/announcement-bar` to 1.1.15.

### Updated packages

| Package | Previous | Updated | Changed in |
|---|---|---|---|
| `@tryghost/color-utils` | 0.2.10 | 0.2.16 | `ghost/core`,
`ghost/admin`, `admin-x-settings` |
| `@tryghost/config-url-helpers` | 1.0.17 | 1.0.23 | `ghost/core` |
| `@tryghost/content-api` | 1.12.0 | 1.12.6 | `announcement-bar` |
| `@tryghost/custom-fonts` | 1.0.2 | 1.0.8 | `ghost/core`,
`admin-x-settings` |
| `@tryghost/helpers` | 1.1.97 | 1.1.103 | `ghost/core`, `ghost/admin` |
| `@tryghost/html-to-plaintext` | 1.0.4 | 1.0.8 | `ghost/core` |
| `@tryghost/limit-service` | 1.4.1 | 1.5.2 | `ghost/core`,
`ghost/admin`, `admin-x-settings` |
| `@tryghost/members-csv` | 2.0.3 | 2.0.5 | `ghost/core`, `ghost/admin`
|
| `@tryghost/string` | 0.2.17 | 0.3.2 | `ghost/core`, `ghost/admin` |
| `@tryghost/timezone-data` | 0.4.12 | 0.4.18 | `ghost/admin`,
`admin-x-settings` |
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