Skip to content

Renamed WelcomeEmailAutomation model to Automation#27658

Draft
EvanHahn wants to merge 1 commit intomainfrom
rename-welcome-email-automation-to-automation
Draft

Renamed WelcomeEmailAutomation model to Automation#27658
EvanHahn wants to merge 1 commit intomainfrom
rename-welcome-email-automation-to-automation

Conversation

@EvanHahn
Copy link
Copy Markdown
Contributor

@EvanHahn EvanHahn commented May 4, 2026

towards https://linear.app/ghost/issue/NY-1260

This change should have no user impact.

This renames "welcome email automation" to "automation" across the codebase. It does not rename any other models, so WelcomeEmailAutomatedEmail and WelcomeEmailAutomationRun still exist.

This should be safe because we take sites offline for migrations.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 00deb730-ddf5-4abc-8302-db1e9e665a58

📥 Commits

Reviewing files that changed from the base of the PR and between 3cf186d and bfdd26e.

📒 Files selected for processing (33)
  • ghost/admin/package.json
  • ghost/core/core/server/api/endpoints/automated-emails.js
  • ghost/core/core/server/api/endpoints/automations.js
  • ghost/core/core/server/data/exporter/table-lists.js
  • ghost/core/core/server/data/migrations/versions/6.37/2026-05-04-13-46-58-rename-welcome-email-automations-table-to-automations.js
  • ghost/core/core/server/data/schema/schema.js
  • ghost/core/core/server/models/automation.js
  • ghost/core/core/server/models/index.js
  • ghost/core/core/server/models/welcome-email-automated-email.js
  • ghost/core/core/server/models/welcome-email-automation-run.js
  • ghost/core/core/server/services/member-welcome-emails/service.js
  • ghost/core/core/server/services/members/api.js
  • ghost/core/core/server/services/members/members-api/members-api.js
  • ghost/core/core/server/services/members/members-api/repositories/event-repository.js
  • ghost/core/core/server/services/members/members-api/repositories/member-repository.js
  • ghost/core/core/server/services/outbox/handlers/member-created.js
  • ghost/core/core/server/services/welcome-email-automations/poll.js
  • ghost/core/package.json
  • ghost/core/test/e2e-api/admin/automated-emails.test.js
  • ghost/core/test/e2e-api/admin/automations.test.js
  • ghost/core/test/e2e-api/members/gift-subscriptions.test.js
  • ghost/core/test/integration/exporter/exporter.test.js
  • ghost/core/test/integration/jobs/process-outbox.test.js
  • ghost/core/test/integration/services/member-welcome-emails.test.js
  • ghost/core/test/integration/services/welcome-email-automations/poll.test.js
  • ghost/core/test/unit/api/endpoints/automations.test.js
  • ghost/core/test/unit/server/data/schema/integrity.test.js
  • ghost/core/test/unit/server/models/automation.test.js
  • ghost/core/test/unit/server/models/welcome-email-automation-run.test.js
  • ghost/core/test/unit/server/services/members/members-api/members-api.test.js
  • ghost/core/test/unit/server/services/members/members-api/repositories/event-repository.test.js
  • ghost/core/test/unit/server/services/members/members-api/repositories/member-repository.test.js
  • ghost/core/test/unit/server/services/outbox/handlers/member-created.test.js
✅ Files skipped from review due to trivial changes (9)
  • ghost/core/test/unit/server/data/schema/integrity.test.js
  • ghost/core/package.json
  • ghost/core/core/server/services/members/members-api/repositories/event-repository.js
  • ghost/core/core/server/services/members/members-api/repositories/member-repository.js
  • ghost/core/core/server/models/welcome-email-automation-run.js
  • ghost/core/test/integration/exporter/exporter.test.js
  • ghost/core/test/unit/server/services/members/members-api/repositories/member-repository.test.js
  • ghost/admin/package.json
  • ghost/core/test/unit/server/services/members/members-api/members-api.test.js
🚧 Files skipped from review as they are similar to previous changes (21)
  • ghost/core/core/server/services/welcome-email-automations/poll.js
  • ghost/core/test/unit/api/endpoints/automations.test.js
  • ghost/core/core/server/services/members/api.js
  • ghost/core/test/unit/server/models/welcome-email-automation-run.test.js
  • ghost/core/test/unit/server/models/automation.test.js
  • ghost/core/core/server/services/members/members-api/members-api.js
  • ghost/core/test/e2e-api/admin/automated-emails.test.js
  • ghost/core/test/unit/server/services/outbox/handlers/member-created.test.js
  • ghost/core/core/server/data/exporter/table-lists.js
  • ghost/core/test/unit/server/services/members/members-api/repositories/event-repository.test.js
  • ghost/core/core/server/api/endpoints/automated-emails.js
  • ghost/core/test/e2e-api/members/gift-subscriptions.test.js
  • ghost/core/core/server/models/welcome-email-automated-email.js
  • ghost/core/test/integration/services/welcome-email-automations/poll.test.js
  • ghost/core/core/server/services/outbox/handlers/member-created.js
  • ghost/core/core/server/data/migrations/versions/6.37/2026-05-04-13-46-58-rename-welcome-email-automations-table-to-automations.js
  • ghost/core/core/server/models/automation.js
  • ghost/core/test/integration/services/member-welcome-emails.test.js
  • ghost/core/test/e2e-api/admin/automations.test.js
  • ghost/core/test/integration/jobs/process-outbox.test.js
  • ghost/core/core/server/data/schema/schema.js

Walkthrough

Renames the database table welcome_email_automations to automations and replaces the WelcomeEmailAutomation Bookshelf model with Automation. Adds a non-transactional migration to perform the table rename and updates schema foreign-key targets to automations.id. Refactors models, API endpoints, services, and repositories to use the new model and relation names, updates queries/joins accordingly, and adjusts tests and fixtures to reference automations. Increments package versions in ghost/admin/package.json and ghost/core/package.json from 6.36.1-rc.0 to 6.37.0-rc.0.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change in the pull request: renaming the WelcomeEmailAutomation model to Automation across the codebase.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the model rename, scope of changes, and rationale for the migration.
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.

✏️ 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 rename-welcome-email-automation-to-automation

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@github-actions github-actions Bot added the migration [pull request] Includes migration for review label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

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
  • Tested in MySQL and SQLite

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 86.84211% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.19%. Comparing base (7ddd8db) to head (bfdd26e).

Files with missing lines Patch % Lines
...mbers/members-api/repositories/event-repository.js 33.33% 2 Missing ⚠️
...ore/server/models/welcome-email-automated-email.js 50.00% 1 Missing ⚠️
...core/server/models/welcome-email-automation-run.js 50.00% 1 Missing ⚠️
...e/server/services/member-welcome-emails/service.js 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #27658   +/-   ##
=======================================
  Coverage   73.19%   73.19%           
=======================================
  Files        1561     1561           
  Lines      127073   127073           
  Branches    15396    15394    -2     
=======================================
  Hits        93014    93014           
  Misses      33101    33101           
  Partials      958      958           
Flag Coverage Δ
admin-tests 49.88% <ø> (ø)
e2e-tests 73.19% <86.84%> (ø)

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.

@EvanHahn EvanHahn force-pushed the rename-welcome-email-automation-to-automation branch 4 times, most recently from 98f8bd5 to 3cf186d Compare May 5, 2026 18:42
@EvanHahn EvanHahn marked this pull request as ready for review May 5, 2026 19:08
@EvanHahn EvanHahn requested a review from troyciesco May 5, 2026 19:17
towards https://linear.app/ghost/issue/NY-1260

This change should have no user impact.

This renames "welcome email automation" to "automation" across the
codebase. It does *not* rename any other models, so
`WelcomeEmailAutomatedEmail` and `WelcomeEmailAutomationRun` still
exist.

This should be safe because we take sites offline for migrations.
@EvanHahn EvanHahn force-pushed the rename-welcome-email-automation-to-automation branch from 3cf186d to bfdd26e Compare May 5, 2026 20:16
@EvanHahn EvanHahn marked this pull request as draft May 6, 2026 18:19
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.

1 participant