Skip to content

Added nullable posts.auto_excerpt and posts.reading_time columns - #30587

Merged
louisghost merged 4 commits into
mainfrom
add-posts-auto-excerpt-reading-time-columns
Sep 15, 2026
Merged

louisghost merged 4 commits into
mainfrom
add-posts-auto-excerpt-reading-time-columns

Conversation

@louisghost

@louisghost louisghost commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds nullable posts.auto_excerpt and posts.reading_time columns (DDL only, { algorithm: 'auto' }) so automatic excerpt and reading time can later be stored instead of recomputed on every Posts API response.
  • Updates schema.js and the schema integrity hash to match.
  • Strips auto_excerpt from post serializers so it stays internal; reading_time remains the existing public API field and is still computed at read time in this PR.
  • Also strips the new columns from member activity-feed attribution and avoids leaking null reading_time into webhook payloads before population exists.
  • Migration lives in 6.64/ (after v6.63.0); bumps Core + ember-admin to 6.64.0-rc.0.

No write-path population, backfill, or stored read path yet — those land in follow-up PRs.

Test plan

  • Confirm migration adds both columns on MySQL (pnpm knex-migrator migrate for 6.64) and rolls back cleanly
  • pnpm test:single test/unit/server/data/schema/integrity.test.js
  • Spot-check Content/Admin post responses: no auto_excerpt key; reading_time / excerpt unchanged from today
  • Migration review checklist on the PR

@github-actions github-actions Bot added the migration [pull request] Includes migration for review label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

It looks like this PR contains a migration 👀
Here's the checklist for reviewing migrations:

General requirements

  • ⚠️ Tested performance on staging database servers, as performance on local machines is not comparable to a production environment
  • Satisfies idempotency requirement (both up() and down())
  • Does not reference models
  • Filename is in the correct format (and correctly ordered)
  • Targets the next minor version
  • All code paths have appropriate log messages
  • Uses the correct utils
  • Contains a minimal changeset
  • Does not mix DDL/DML operations

Schema changes

  • Both schema change and related migration have been implemented
  • For index changes: has been performance tested for large tables
  • For new tables/columns: fields use the appropriate predefined field lengths
  • For new tables/columns: field names follow the appropriate conventions
  • Does not drop a non-alpha table outside of a major version

Data changes

  • Mass updates/inserts are batched appropriately
  • Does not loop over large tables/datasets
  • Defends against missing or invalid data
  • For settings updates: follows the appropriate guidelines

@nx-cloud

nx-cloud Bot commented Sep 8, 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 2ea556d

Command Status Duration Result
nx run ghost:test:ci:integration ✅ Succeeded 4m 33s View ↗
nx run ghost:test:integration ✅ Succeeded 3m 27s View ↗
nx run ghost:test:ci:e2e ✅ Succeeded 4m 7s View ↗
nx run ghost:test:legacy ✅ Succeeded 3m 12s View ↗
nx run ghost:test:e2e ✅ Succeeded 2m 52s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 27s View ↗
nx run-many -t lint -p ghost,ghost-monorepo ✅ Succeeded 21s View ↗
nx run-many -t test:unit -p ghost ✅ Succeeded 33s View ↗
Additional runs (4) ✅ Succeeded ... View ↗

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


☁️ Nx Cloud last updated this comment at 2026-09-14 14:22:40 UTC

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Advanced

Run ID: 48dbfba8-95aa-4b8d-abcc-3312977e1c43

📥 Commits

Reviewing files that changed from the base of the PR and between 48aee70 and d3e9f2a.

📒 Files selected for processing (3)
  • apps/ember-admin/package.json
  • ghost/core/core/server/data/migrations/versions/6.64/2026-09-08-11-01-12-add-posts-auto-excerpt-and-reading-time-columns.js
  • ghost/core/package.json

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

📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (4)
Review migration safety beyond lint: schema and migration parity, existing-data shape and volume, deploy/rollback compatibility, transaction and locking risk, idempotency, export/integrity updates, and preservation of constraints/defaults.

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/core/server/data/migrations/versions/6.64/2026-09-08-11-01-12-add-posts-auto-excerpt-and-reading-time-columns.js
New source files must be TypeScript: flag new JS files as a required change unless exempt (DB migrations, apps/ember-admin/, tool/config files, scripts/, docker/, generated code).

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/core/server/data/migrations/versions/6.64/2026-09-08-11-01-12-add-posts-auto-excerpt-and-reading-time-columns.js
Prioritise concrete correctness, security, data-integrity, compatibility, and regression risks.

⚙️ CodeRabbit configuration file

Files:

  • apps/ember-admin/package.json
  • ghost/core/package.json
  • ghost/core/core/server/data/migrations/versions/6.64/2026-09-08-11-01-12-add-posts-auto-excerpt-and-reading-time-columns.js
New files are TypeScript: Fail if the PR adds a new .js/.jsx/.cjs/.mjs source file, unless it is: a DB migration (ghost/core/core/server/data/migrations/), under apps/ember-admin/, a tool/config file, under scripts/ or docker/, or generated...

📄 CodeRabbit inference engine (Custom checks)

Files:

  • ghost/core/core/server/data/migrations/versions/6.64/2026-09-08-11-01-12-add-posts-auto-excerpt-and-reading-time-columns.js
🔇 Additional comments (3)
ghost/core/core/server/data/migrations/versions/6.64/2026-09-08-11-01-12-add-posts-auto-excerpt-and-reading-time-columns.js (1)

1-17: LGTM!

ghost/core/package.json (1)

3-3: LGTM!

apps/ember-admin/package.json (1)

3-3: LGTM!


Walkthrough

The posts schema adds nullable auto_excerpt and reading_time columns through a new migration. The schema integrity hash and package versions are updated. Post serializers remove internal metadata from output, including raw reading_time values when no computed value exists. Member signup and donation event serialization also removes both fields. Tests cover the schema hash and null reading_time behavior.

Suggested reviewers: acburdine, 9larsons

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to d3e9f

This change adds nullable post metadata columns while keeping internal values out of public responses, webhooks, and member event attribution. The migration and serialization behavior are aligned, with no remaining concrete merge-blocking risk.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the primary change: adding nullable posts.auto_excerpt and posts.reading_time columns.
Description check ✅ Passed The description directly explains the schema changes, migration, serializer behavior, version updates, and test plan.
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 The PR introduces no typing bypasses: the added lines contain no any, unchecked as, @ts-nocheck, or @ts-ignore. The new migration and schema.js entries declare database columns; they do not …
New Files Are Typescript ✅ Passed The exact PR diff adds one JavaScript-family file: ghost/core/core/server/data/migrations/versions/6.64/2026-09-08-11-01-12-add-posts-auto-excerpt-and-reading-time-columns.js. This file is a DB migr…
✨ 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 add-posts-auto-excerpt-reading-time-columns

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

@louisghost
louisghost requested a review from ErisDS September 8, 2026 11:52
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.66%. Comparing base (46b4f39) to head (2ea556d).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...mbers/members-api/repositories/event-repository.js 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30587      +/-   ##
==========================================
- Coverage   67.71%   67.66%   -0.05%     
==========================================
  Files        1676     1676              
  Lines       60538    60547       +9     
  Branches    10470    10472       +2     
==========================================
- Hits        40992    40970      -22     
- Misses      17226    17257      +31     
  Partials     2320     2320              
Flag Coverage Δ
e2e-tests 70.41% <66.66%> (-0.06%) ⬇️

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.

@louisghost
louisghost removed the request for review from ErisDS September 8, 2026 14:41
@louisghost
louisghost force-pushed the add-posts-auto-excerpt-reading-time-columns branch from 24f30a3 to 48aee70 Compare September 9, 2026 07:51
@louisghost
louisghost removed this pull request from stack #30594 September 9, 2026 11:25
@louisghost
louisghost added this pull request to stack #30621 September 9, 2026 11:34
louisghost and others added 4 commits September 14, 2026 16:09
Store automatic excerpt and reading time as schema so later write/read paths can stop recomputing them on every API response. Strip auto_excerpt from serializers so it stays internal for now.
Drop the raw DB reading_time before computing so responses only include it when derived from html, matching pre-column behavior.
Strip auto_excerpt and reading_time from postAttribution on signup/donation events so activity-feed payloads stay unchanged until those fields are intentionally exposed.
Co-authored-by: Cursor <cursoragent@cursor.com>
@louisghost
louisghost merged commit b79666a into main Sep 15, 2026
59 checks passed
@louisghost
louisghost deleted the add-posts-auto-excerpt-reading-time-columns branch September 15, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migration [pull request] Includes migration for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants