Skip to content

Conversation

@tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Jan 2, 2026

What is this pull request for?

Page metadata (title, meta_description, meta_keywords) is now stored on
PageVersion, enabling different content for draft and published versions.

The Page model delegates these attributes to public_version for backward
compatibility. Admin forms write to draft_version, and publishing copies
metadata from draft to the new public version.

Provides a rake task to copy existing page metadata to all page versions during upgrade.

bin/rake alchemy:upgrade:8.1:migrate_page_metadata

Notable changes

Deprecates setting title=, meta_description= and meta_keywords= on page.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@tvdeyen tvdeyen added this to the 8.1 milestone Jan 2, 2026
@tvdeyen tvdeyen requested a review from a team as a code owner January 2, 2026 20:24
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

A few comments here. Otherwise moving metadata to versions is great!

@tvdeyen tvdeyen force-pushed the move-page-meta-data-to-page-version branch from 067b570 to 7489441 Compare January 5, 2026 13:58
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.26%. Comparing base (7ecc5d3) to head (7e01082).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3554      +/-   ##
==========================================
+ Coverage   97.25%   97.26%   +0.01%     
==========================================
  Files         291      291              
  Lines        7682     7721      +39     
==========================================
+ Hits         7471     7510      +39     
  Misses        211      211              

☔ 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.

@tvdeyen tvdeyen force-pushed the move-page-meta-data-to-page-version branch 7 times, most recently from 797a5e0 to 8a58ac5 Compare January 5, 2026 16:51
Replace the top-level Upgrader constant with Alchemy::Upgrader[version]
class method (similar to ActiveRecord::Migration[version]). This avoids
constant redefinition warnings when the rake file is loaded multiple
times, while still ensuring todos are accumulated across rake tasks
via memoization.
Add title, meta_description, and meta_keywords to alchemy_page_versions
table. This prepares for versioned page metadata where each version
(draft/public) maintains its own content metadata.
Page metadata (title, meta_description, meta_keywords) is now stored on
PageVersion, enabling different content for draft and published versions.

The Page model delegates these attributes to public_version for backward
compatibility. Admin forms write to draft_version, and publishing copies
metadata from draft to the new public version.
Provides a rake task to copy existing page metadata (title,
meta_description, meta_keywords) to all page versions during upgrade.
In other tests we add todos and this is a cached singleton
attribute.
@tvdeyen tvdeyen force-pushed the move-page-meta-data-to-page-version branch from 8a58ac5 to 7e01082 Compare January 7, 2026 17:00
@tvdeyen tvdeyen merged commit a0ca3f9 into main Jan 8, 2026
19 checks passed
@tvdeyen tvdeyen deleted the move-page-meta-data-to-page-version branch January 8, 2026 15:12
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.

3 participants